Jacoco in Unix failing with com/sun/jmx/remote/internal/PRef is already instrumented

137 views
Skip to first unread message

kanc...@gmail.com

unread,
May 14, 2013, 1:31:44 PM5/14/13
to jac...@googlegroups.com

Hi ,

I'm trying to set up jacoco agent on weblogic in Unix. So I have exported the Jacocoagent.jar at run time as a java_options when I run the startup.sh in weblogic.This is standalone jacoco set up I'm trying to with following Java_Options to test some webapplication which is hosted on weblogic

-javaagent:/prd/products/jacoco/latest/jacocoagent.jar=output=tcpserver,port=8010,includes=com.jpmorgan.*,address=*

I'm failing with the following issue.

I have sucessfully configured the jacococ agent in weblogic/windows and generated reports.
I use the same jar file in the unix system too.
Weblogic uses JRockit java version rather Jdk.
Please helpt to get rid of this issue.


java.lang.instrument.IllegalClassFormatException: Error while instrumenting class com/sun/jmx/remote/internal/PRef.
at org.jacoco.agent.rt.internal_8fe5d47.CoverageTransformer.transform(CoverageTransformer.java:91)
at sun.instrument.TransformerManager.transform(TransformerManager.java:169)
at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:365)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at javax.management.remote.rmi.NoCallStackClassLoader.findClass(NoCallStackClassLoader.java:108)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at javax.management.remote.rmi.RMIConnector$1.run(RMIConnector.java:2065)
at javax.management.remote.rmi.RMIConnector.<clinit>(RMIConnector.java:2086)
at javax.management.remote.rmi.RMIConnectorServer.objectToBind(RMIConnectorServer.java:728)
at javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:392)
at sun.management.jmxremote.ConnectorBootstrap.exportMBeanServer(ConnectorBootstrap.java:716)
at sun.management.jmxremote.ConnectorBootstrap.initialize(ConnectorBootstrap.java:396)
at sun.management.Agent.startAgent(Agent.java:127)
at sun.management.Agent.startAgent(Agent.java:239)
at bea.jrockit.management.server.Main.start0(Main.java:297)
at bea.jrockit.management.server.Main.access$000(Main.java:51)
at bea.jrockit.management.server.Main$2.run(Main.java:387)
at bea.jrockit.management.server.Main.start(Main.java:385)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at jrockit.management.AgentStarter.startAgent(AgentStarter.java:135)
Caused by: java.lang.IllegalStateException: Class com/sun/jmx/remote/internal/PRef is already instrumented.

Marc R. Hoffmann

unread,
May 14, 2013, 4:57:59 PM5/14/13
to jac...@googlegroups.com
Hi,

this problem typically occurs if you add the JaCoCo Java agent options
twice to the command line.

It also happens if you combine the Java agent with offline instrumentation.

Best regards,
-marc

kanc...@gmail.com

unread,
May 15, 2013, 2:17:46 PM5/15/13
to jac...@googlegroups.com
On Tuesday, May 14, 2013 4:57:59 PM UTC-4, Marc R. Hoffmann wrote:
> Hi, this problem typically occurs if you add the JaCoCo Java agent options twice to the command line. It also happens if you combine the Java agent with offline instrumentation. Best regards, -marc On 14.05.13 19:31, kanc...@gmail.com wrote: > > Hi , > > I'm trying to set up jacoco agent on weblogic in Unix. So I have exported the Jacocoagent.jar at run time as a java_options when I run the startup.sh in weblogic.This is standalone jacoco set up I'm trying to with following Java_Options to test some webapplication which is hosted on weblogic > > -javaagent:/prd/products/jacoco/latest/jacocoagent.jar=output=tcpserver,port=8010,includes=com.jpmorgan.*,address=* > > I'm failing with the following issue. > > I have sucessfully configured the jacococ agent in weblogic/windows and generated reports. > I use the same jar file in the unix system too. > Weblogic uses JRockit java version rather Jdk. > Please helpt to get rid of this issue. > > > java.lang.instrument.IllegalClassFormatException: Error while instrumenting class com/sun/jmx/remote/internal/PRef. > at org.jacoco.agent.rt.internal_8fe5d47.CoverageTransformer.transform(CoverageTransformer.java:91) > at sun.instrument.TransformerManager.transform(TransformerManager.java:169) > at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:365) > at java.lang.ClassLoader.defineClass1(Native Method) > at java.lang.ClassLoader.defineClass(ClassLoader.java:621) > at javax.management.remote.rmi.NoCallStackClassLoader.findClass(NoCallStackClassLoader.java:108) > at java.lang.ClassLoader.loadClass(ClassLoader.java:307) > at java.lang.ClassLoader.loadClass(ClassLoader.java:252) > at javax.management.remote.rmi.RMIConnector$1.run(RMIConnector.java:2065) > at javax.management.remote.rmi.RMIConnector.<clinit>(RMIConnector.java:2086) > at javax.management.remote.rmi.RMIConnectorServer.objectToBind(RMIConnectorServer.java:728) > at javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:392) > at sun.management.jmxremote.ConnectorBootstrap.exportMBeanServer(ConnectorBootstrap.java:716) > at sun.management.jmxremote.ConnectorBootstrap.initialize(ConnectorBootstrap.java:396) > at sun.management.Agent.startAgent(Agent.java:127) > at sun.management.Agent.startAgent(Agent.java:239) > at bea.jrockit.management.server.Main.start0(Main.java:297) > at bea.jrockit.management.server.Main.access$000(Main.java:51) > at bea.jrockit.management.server.Main$2.run(Main.java:387) > at bea.jrockit.management.server.Main.start(Main.java:385) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at jrockit.management.AgentStarter.startAgent(AgentStarter.java:135) > Caused by: java.lang.IllegalStateException: Class com/sun/jmx/remote/internal/PRef is already instrumented. >

Thanks Marc.It helped and resolved.

kanc...@gmail.com

unread,
May 17, 2013, 11:58:22 AM5/17/13
to jac...@googlegroups.com
Hi Marc,
For this issue what is the fix in a Unix box ? I keep on getting following error . I tried kill the web logic process and restrated and it didn't work
Please advice.
Is there a way to clear up the export history?

Thanks
Kanchana

On Tuesday, May 14, 2013 4:57:59 PM UTC-4, Marc R. Hoffmann wrote:

Marc R. Hoffmann

unread,
May 19, 2013, 12:29:12 PM5/19/13
to jac...@googlegroups.com
Hi Kanchana,

as I said before: this problem happens, if you configure the JaCoCo
agent twice to the JVM. Please check with the vendor of your application
server how to correctly specify JVM arguments.

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