I am trying to start an api-service using an instrumented jar in order to run automated test cases, when the service is trying to start with jacoco agent the next exception has been thrown:
INFO [] org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean: Creating Service {http://api.enterprise.com/soap}TokenService from class com.enterprise.api.resource.soap.TokenService
java.lang.IllegalStateException: Different class names com/enterprise/api/dto/TokenRequestDTO$JaxbAccessorM_getPassword_setPassword_java_lang_String and com/enterprise/api/dto/TokenRequestDTO$JaxbAccessorM_getSecret_setSecret_java_lang_String for id 3f788295c470c3f4.
java.nio.channels.OverlappingFileLockException
at sun.nio.ch.SharedFileLockTable.checkList(FileLockTable.java:255)
at sun.nio.ch.SharedFileLockTable.add(FileLockTable.java:152)
at sun.nio.ch.FileChannelImpl.lock(FileChannelImpl.java:1063)
at java.nio.channels.FileChannel.lock(FileChannel.java:1053)
at org.jacoco.agent.rt.internal_c13123e.output.FileOutput.openFile(FileOutput.java:69)
at org.jacoco.agent.rt.internal_c13123e.output.FileOutput.writeExecutionData(FileOutput.java:53)
at org.jacoco.agent.rt.internal_c13123e.Agent.shutdown(Agent.java:137)
at org.jacoco.agent.rt.internal_c13123e.Agent$1.run(Agent.java:54)
Steps. Please, correct me if I am doing something wrong.
1. Instrument jar file
java -jar jacoco-0.8.1/lib/jacococli.jar instrument build/libs/service-1.0.0-SNAPSHOT-fat.jar --dest build/libs/instrumented
2.Run it with JaCoCo agent in the class path
java -Djacoco-agent.output=tcpserver -Duser.timezone="UTC" -XX:MaxPermSize=512M -Xmx4G -cp /var/www/html/api/service/jacoco-0.8.1/lib/jacocoagent.jar:/var/www/html/api/service/build/libs/instrumented/service-1.0.0-SNAPSHOT-fat.jar com.enterprise.custom.metadata.ServiceRun server config-service.yml
3. When the server is trying to start the above exception mentioned is thrown.
Any idea what is whappening ? or Any hint ?
If you need any further information please let me know.
Thanks in advance.
is that the full log output? Looks like you have two different exceptions here:
1) java.lang.IllegalStateException: Different class names ...
JaCoCo internally uses a CRC64 checksum as class ids. This exception indicates that the classes mentioned in the message actually result in the same hash.
Can you please provide the two *.class files from your "fat.jar"?
Also isn't there any stack trace for this exception?
2) java.nio.channels.OverlappingFileLockException
This is strange. From the stack trace JaCoCo agent uses the file output but the command line shows you configured tcpserver.
Also this typically happens when there are two JaCoCo agents configured from different versions at the same time.
Is there more going on that we can not see in the command line?
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/b341a1e67363a27ee07b981a8f8847df%40mountainminds.com.--
You received this message because you are subscribed to a topic in the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jacoco/UDD5eamWUXQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jacoco+unsubscribe@googlegroups.com.
Hi Ronald,
these are probably two inner classes. The class files are named:
Do you find these classes in your JAR?
BTW: What is the reason that you use offline instrumentation? Why does the JaCoCo agent not work for you?
https://www.jacoco.org/jacoco/trunk/doc/agent.html
Regards,
-marc
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/CAFLA3OBmCwc03UdkdWyODb%2BRN%2Ba_ZsvKV852vxNXVA0weSUiEw%40mail.gmail.com.
these are probably two inner classes. The class files are named:
- TokenRequestDTO$JaxbAccessorM_getPassword_setPassword_java_lang_String.class
Do you find these classes in your JAR?
- TokenRequestDTO$JaxbAccessorM_getSecret_setSecret_java_lang_String.class
BTW: What is the reason that you use offline instrumentation? Why does the JaCoCo agent not work for you?
https://www.jacoco.org/jacoco/trunk/doc/agent.html
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/CAFLA3OBmCwc03UdkdWyODb%2BRN%2Ba_ZsvKV852vxNXVA0weSUiEw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jacoco/UDD5eamWUXQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jacoco+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/9fde9cd9660a9b905117f0eb540c3045%40mountainminds.com.
Hi Ronald,
ok, I see. These classes are created on the fly by Jaxb. So why should they get instrumented by JaCoCo when there is no JaCoCo agent in the game? Also the second issue indicates that there is another JaCoCo agent configured for the JVM. Please double check with "ps -f" for the effective command line.
If you want us to have a deeper look (instead of wild guessing) please provide a runnable reproducer.
Regards,
-marc
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/CAFLA3OBv0kRLM_P43EoHwV2e-gi70OzfeG0q9f7F9Vgp_zpBJA%40mail.gmail.com.