Skip to content

Classpath of JAR-Manifest not taken into account when forking #14

Description

@8191

When JCS forks a Java process (e.g. in at.ac.tuwien.infosys.jcloudscale.vm.localVm.LocalVM#launchHost), the classpath "injected" by a JAR manifest is not taken into account. This leads to the problem, that the JCS class files (and other libraries) are not found by the forked process and leads to a JCloudScaleException.

In this example I execute a JAR file containing only my JCS application and load JCS into the classpath by specifying Class-Path: jcloudscale.core-0.4.4.jar in the META-INF/MANIFEST.MF file. When the scaling policy decides to scale up, the exception is thrown:

Error: Could not find or load main class at.ac.tuwien.infosys.jcloudscale.server.JCloudScaleServerRunner
at.ac.tuwien.infosys.jcloudscale.exception.JCloudScaleException: Scaling policy "selectHost" method invocation thrown an exception: at.ac.tuwien.infosys.jcloudscale.exception.ScalingException: JVM failed to launch. Launch Line:
'/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java -cp jcloudscale.genetics.jar at.ac.tuwien.infosys.jcloudscale.server.JCloudScaleServerRunner'
from folder '/tmp'. Exit code 1
        at at.ac.tuwien.infosys.jcloudscale.management.CloudManager.createNewInstance(CloudManager.java:117)
        at at.ac.tuwien.infosys.jcloudscale.api.CloudObjects.create(CloudObjects.java:106)
        at at.ac.tuwien.infosys.jcloudscale.aspects.CloudObjectAspect.deployCloudObject(CloudObjectAspect.java:93)
        at at.ac.tuwien.infosys.jcloudscale.aspects.CloudObjectAspect.createNewCloudObject(CloudObjectAspect.java:56)
        at at.conf.jcs.genetics.computation.GeneticsComputationImpl.getInstance(GeneticsComputationImpl.java:47)
...

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions