I'm trying to enable a Jacoco agent for my Websphere 8.5 (JDK7) with following VM parameters:
-javaagent:d:/temp/jacocoagent.jar=excludes=*,output=tcpserver,address=*,port=2220,exclclassloader=*
Due to the fact that Websphere seems to instrument class files while deploying [1] I use offline instrumentation for all my EARs.
With the configuration above though I'm not able to start my Websphere anymore:
Caused by: java.lang.RuntimeException: Class java/util/UUID could not be instrumented.
at org.jacoco.agent.rt_1r70et.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:139)
at org.jacoco.agent.rt_1r70et.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:100)
at org.jacoco.agent.rt_1r70et.JacocoAgent.createRuntime(JacocoAgent.java:128)
at org.jacoco.agent.rt_1r70et.JacocoAgent.init(JacocoAgent.java:74)
at org.jacoco.agent.rt_1r70et.JacocoAgent.premain(JacocoAgent.java:165)
... 6 more
Caused by: java.lang.NoSuchFieldException: $jacocoAccess
at java.lang.Class.getFieldImpl(Native Method)
at java.lang.Class.getField(Class.java:775)
at org.jacoco.agent.rt_1r70et.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:137)
... 10 more
Additional notes:
* Jacoco agent is the first and only agent defined in the VM args
* I need a TCP server for the entire VM as the integration tests run remotely and concurrently for all my EARs. At the end of the tests the results are collected by my Jacoco client and dumped to the target folder of each application
Is there any fix for this? Different runtime [2]?
[1] https://groups.google.com/forum/#!msg/jacoco/-ZE9ZGwEMJQ/4nU1j0YKzz8J
[2] http://sourceforge.net/p/eclemma/discussion/614869/thread/fa17b9b2
Thanks
Yves