Jacoco agent 0.7.6 - failed to start forked VM - missing PreMain class attribute in manifest

1,471 views
Skip to first unread message

grze...@gmail.com

unread,
May 10, 2016, 4:27:50 AM5/10/16
to JaCoCo and EclEmma Users
Hi all

I have problem after upgrade from jacoco 0.7.4 to jacoco 0.7.6 : maven surefire does not start forked VM:

Error occurred during initialization of VM
Failed to find Premain-Class manifest attribute in ***org.jacoco.agent\\0.7.6.201602180812\\org.jacoco.agent-0.7.6.201602180812-runtime.jar
agent library failed to init: instrument.

From what I discovered:
- jacoco agent 0.7.4 has META-INF/MANIFEST.MF with Premain class attribute
- jacoco agent 0.7.6 has META-INF/MANIFEST.MF without Premain class attribute, however it contains jacocoagent.jar inside with correct Manifest mf.

I have used http://central.maven.org/maven2/org/jacoco/org.jacoco.agent/0.7.6.201602180812/org.jacoco.agent-0.7.6.201602180812.jar from mavencentral, it seems that instead of re-package all classes it have some jar-archives inside. Is this correct way of packaging ? It seems that JVM is searching for Premain Class attribute in META-INF/MANIFEST.MF, where it is missing.


Also I don't think that having jar in jar is correct approach in java, JVM probably won't find classes in internal archive (at least nativley, they are some solutions to make it possible, but I am not aware if jacoco-agent is using it), could somebody explain how this is supposed to work ? Does only me is having an issue with jacoco-agent 0.7.6 ?


Regards,


Grzesiek

Marc Hoffmann

unread,
May 10, 2016, 12:21:03 PM5/10/16
to jac...@googlegroups.com
Hi,

for all JaCoCo versions the following applies:

org.jacoco.agent-NNN.jar contains an API to obtain the Agent as a
resource, there is no Premain-Class header.

org.jacoco.agent-NNN-runtime.jar is the agent itself (with a
Premain-Class header).

Best regards,
-marc
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages