Hi Ronald,

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?

As a workaround you can exclude one of these classes during offline instrumentation.

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?

Regards,
-marc

On 2018-05-04 23:19, [email protected] wrote:
Hi,

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.

--
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/b341a1e67363a27ee07b981a8f8847df%40mountainminds.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to