Fully featured low overhead profiler for Java EE and Java SE platforms.
Ultimate profiling and monitoring solution for Gradle, Maven, Ant, JUnit and TestNG.
Easy to use performance and memory profiler for .NET framework.

Getting NoSuchMethodError when profiling Liberty Profile

Moderators: Vladimir Kondratyev, Anton Katilin

Getting NoSuchMethodError when profiling Liberty Profile

Postby vishalendu » Fri Apr 24, 2015 12:09 pm

I was able to profile Websphere Liberty Profile application server with the previous versions of YouKit Profiler (yjp-2014-build-14120). I just renewed the license for 2015 product. After downloading the latest version (yjp-2015-build-15050). I am getting the following exception in the console.log: (And the server is not able to start)

[YourKit Java Profiler 2015 build 15050] Log file: /u02/qasp01/.yjp/log/ws-server-5063.log
Exception in thread "Attach API initializer" java/lang/NoSuchMethodError: com/yourkit/probes/builtin/Processes.access$1300(Ljava/io/FileOutputStream;I)I
at com/yourkit/probes/builtin/Processes$FileOutputStream_writeBytes_Probe.onEnter (Processes.java:284)
at java/io/FileOutputStream.writeBytes (FileOutputStream.java:4294967295)
at java/io/FileOutputStream.write (FileOutputStream.java:357)
at java/io/BufferedOutputStream.flushBuffer (BufferedOutputStream.java:94)
at java/io/BufferedOutputStream.flush (BufferedOutputStream.java:152)
at java/io/PrintStream.write (PrintStream.java:507)
at sun/nio/cs/StreamEncoder.writeBytes (StreamEncoder.java:234)
at sun/nio/cs/StreamEncoder.implFlushBuffer (StreamEncoder.java:304)
at sun/nio/cs/StreamEncoder.flushBuffer (StreamEncoder.java:117)
at java/io/OutputStreamWriter.flushBuffer (OutputStreamWriter.java:204)
at java/io/PrintStream.write (PrintStream.java:552)
at java/io/PrintStream.print (PrintStream.java:694)
at java/lang/ThreadGroup.uncaughtException (ThreadGroup.java:853)
at java/lang/ThreadGroup.uncaughtException (ThreadGroup.java:843)
at java/lang/Thread.uncaughtException (Thread.java:1384)
Exception in thread "main" java/lang/NoSuchMethodError: com/yourkit/probes/builtin/Processes.access$1300(Ljava/io/FileOutputStream;I)I
at com/yourkit/probes/builtin/Processes$FileOutputStream_writeBytes_Probe.onEnter (Processes.java:284)
at java/io/FileOutputStream.writeBytes (FileOutputStream.java:4294967295)
at java/io/FileOutputStream.write (FileOutputStream.java:357)
at java/io/BufferedOutputStream.flushBuffer (BufferedOutputStream.java:94)
at java/io/BufferedOutputStream.flush (BufferedOutputStream.java:152)
at java/io/PrintStream.write (PrintStream.java:507)
at sun/nio/cs/StreamEncoder.writeBytes (StreamEncoder.java:234)
at sun/nio/cs/StreamEncoder.implWrite (StreamEncoder.java:295)
at sun/nio/cs/StreamEncoder.write (StreamEncoder.java:138)
at java/io/OutputStreamWriter.write (OutputStreamWriter.java:245)
at java/io/BufferedWriter.flushBuffer (BufferedWriter.java:141)
at java/io/PrintStream.write (PrintStream.java:551)
at java/io/PrintStream.print (PrintStream.java:694)
at java/lang/ThreadGroup.uncaughtException (ThreadGroup.java:853)
at java/lang/ThreadGroup.uncaughtException (ThreadGroup.java:843)
at java/lang/Thread.uncaughtException (Thread.java:1384)


Content of /u02/qasp01/.yjp/log/ws-server-5063.log file are below:
15050 0.001: Command line:
/u02/qasp01/JAVA/jre/bin/java
-XX:MaxPermSize=256m
-Xms2g
-Xmx2g
-Duser.timezone=GMT
-DpassphraseFile=passphrase
-agentpath:/u02/qasp01/yourkit/bin/linux-x86-64/libyjpagent.so
-javaagent:/u02/qasp01/mrm/bin/tools/ws-javaagent.jar
-jar
/u02/qasp01/mrm/bin/tools/ws-server.jar
sudha
15050 0.001: Executable: /u02/qasp01/ibm-java-x86_64-71/jre/bin/java
15050 0.001: uname:
sysname: Linux
release: 2.6.32-504.8.1.el6.x86_64
version: #1 SMP Fri Dec 19 12:09:25 EST 2014
machine: x86_64
15050 0.001: Linux; fast_thread_cpu_time=1; 64-bit process
15050 0.007: hid: 360209994943YW2X98W7V19WYZ 64-bit machine
15050 0.007: Today is 20150424
15050 0.007: full_build_stamp: 15050 201504232455
15050 0.007: Agent library path: /u02/qasp01/yourkit/bin/linux-x86-64/libyjpagent.so
15050 0.007: Agent_OnLoad: orig_options=
full_options=
15050 0.007: phase: 1
15050 0.007: jvmtiVersion: 30010201
15050 0.007: vendor: IBM Corporation
15050 0.007: version: 2.7
15050 0.007: info: 20141215_227395
15050 0.007: session_id: 21746849295895 (1429876247,5063)
15050 0.010: line_method: 1
15050 0.010: can_generate_exception_events: disabled by default on IBM - specify startup option "_enable_exception_events" to override
15050 0.010: can_access_local_variables: disabled by default on IBM - specify startup option "_with_local_vars" to override
15050 0.020: Reusing existing jar file: /tmp/yjp201504232455.jar
15050 0.021: JVMTI 30010201; 2.7; IBM Corporation; 20141215_227395; JR=0; I=1
15050 0.050: Successfully registered probe classes: 121
Registered: .AWTEvents$EventQueue_dispatchEvent_Probe
Registered: .AgentLoadingSupport$JBoss
Registered: .AgentLoadingSupport$OSGi1
Registered: .AgentLoadingSupport$OSGi2
Registered: .AgentLoadingSupport$OSGi3
Registered: .CPUTracingSupport
Registered: .Databases$Connection_close_Probe
Registered: .Databases$Connection_createStatement_Probe
Registered: .Databases$Connection_prepareStatement_Probe
Registered: .Databases$DataSource_getConnection_Probe
Registered: .Databases$DataSource_setName_Probe
Registered: .Databases$DriverManager_getConnection_Probe
Registered: .Databases$Driver_connect_Probe
Registered: .Databases$InitialContext_lookup_Probe
Registered: .Databases$PooledConnection_getConnection_Probe
Registered: .Databases$PreparedStatement_addBatch_Probe
Registered: .Databases$PreparedStatement_clearBatch_Probe
Registered: .Databases$PreparedStatement_execute_Probe
Registered: .Databases$Statement_addBatch_Probe
Registered: .Databases$Statement_clearBatch_Probe
Registered: .Databases$Statement_close_Probe
Registered: .Databases$Statement_executeBatch_Probe
Registered: .Databases$Statement_execute_Probe
Registered: .DatabasesLW$Connection_close_Probe
Registered: .DatabasesLW$Connection_createStatement_Probe
Registered: .DatabasesLW$Connection_prepareStatement_Probe
Registered: .DatabasesLW$DataSource_getConnection_Probe
Registered: .DatabasesLW$DriverManager_getConnection_Probe
Registered: .DatabasesLW$Driver_connect_Probe
Registered: .DatabasesLW$PooledConnection_getConnection_Probe
Registered: .DatabasesLW$PreparedStatement_execute_Probe
Registered: .DatabasesLW$Statement_close_Probe
Registered: .DatabasesLW$Statement_execute_Probe1
Registered: .DatabasesLW$Statement_execute_Probe2
Registered: .Files$FileChannel_read_Probe
Registered: .Files$FileChannel_write_Probe
Registered: .Files$FileInputStream_close_Probe
Registered: .Files$FileInputStream_open_Probe
Registered: .Files$FileInputStream_readBytes_Probe
Registered: .Files$FileInputStream_read_Probe
Registered: .Files$FileOutputStream_close_Probe
Registered: .Files$FileOutputStream_open_Probe
Registered: .Files$FileOutputStream_writeBytes_Probe
Registered: .Files$FileOutputStream_write_Probe
Registered: .Files$GetChannel_Probe
Registered: .Files$RandomAccessFile_close_Probe
Registered: .Files$RandomAccessFile_open_Probe
Registered: .Files$RandomAccessFile_readBytes_Probe
Registered: .Files$RandomAccessFile_read_Probe
Registered: .Files$RandomAccessFile_writeBytes_Probe
Registered: .Files$RandomAccessFile_write_Probe
Registered: .FilesLW$FileChannelsTelemetry$FileChannel_read_Probe
Registered: .FilesLW$FileChannelsTelemetry$FileChannel_write_Probe
Registered: .FilesLW$FileChannelsTelemetry$GetChannel_Probe
Registered: .FilesLW$FileStreamsTelemetry$FileInputStream_close_Probe
Registered: .FilesLW$FileStreamsTelemetry$FileInputStream_open_Probe
Registered: .FilesLW$FileStreamsTelemetry$FileInputStream_readBytes_Probe
Registered: .FilesLW$FileStreamsTelemetry$FileInputStream_read_Probe
Registered: .FilesLW$FileStreamsTelemetry$FileOutputStream_close_Probe
Registered: .FilesLW$FileStreamsTelemetry$FileOutputStream_open_Probe
Registered: .FilesLW$FileStreamsTelemetry$FileOutputStream_writeBytes_Probe
Registered: .FilesLW$FileStreamsTelemetry$FileOutputStream_write_Probe
Registered: .FilesLW$RandomAccessFilesTelemetry$RandomAccessFile_close_Probe
Registered: .FilesLW$RandomAccessFilesTelemetry$RandomAccessFile_open_Probe
Registered: .FilesLW$RandomAccessFilesTelemetry$RandomAccessFile_readBytes_Probe
Registered: .FilesLW$RandomAccessFilesTelemetry$RandomAccessFile_read_Probe
Registered: .FilesLW$RandomAccessFilesTelemetry$RandomAccessFile_writeBytes_Probe
Registered: .FilesLW$RandomAccessFilesTelemetry$RandomAccessFile_write_Probe
Registered: .JNDI$DirContext_1
Registered: .JNDI$DirContext_2
Registered: .JNDI$NamingContext_1
Registered: .JNDI$NamingContext_2
Registered: .JUnitTests$Old_Run_Probe
Registered: .JUnitTests$Old_SetUp_Probe
Registered: .JUnitTests$Old_TearDown_Probe
Registered: .JUnitTests$Run_Probe
Registered: .JUnitTests$SetUp_Probe
Registered: .JUnitTests$TearDown_Probe
Registered: .Processes$FileOutputStream_writeBytes_Probe
Registered: .Processes$FileOutputStream_write_Probe
Registered: .Processes$InputStream_readBytes_Probe
Registered: .Processes$InputStream_read_Probe
Registered: .Processes$ProcessImpl_getErrorStream_Probe
Registered: .Processes$ProcessImpl_getInputStream_Probe
Registered: .Processes$ProcessImpl_getOutputStream_Probe
Registered: .Processes$ProcessImpl_start_Probe
Registered: .Processes$ProcessImpl_waitFor_Probe
Registered: .Processes$.
Registered: .Servlets$Filter_doFilter_Probe
Registered: .Servlets$HttpJspPage_jspService_Probe
Registered: .Servlets$Servlet_service_Probe
Registered: .ServletsLW$Filter_doFilter_Probe
Registered: .ServletsLW$HttpJspPage_jspService_Probe
Registered: .ServletsLW$Servlet_service_Probe
Registered: .Sockets$ServerSocketChannel_accept_Probe
Registered: .Sockets$ServerSocket_accept_Probe
Registered: .Sockets$SocketChannel_close_Probe
Registered: .Sockets$SocketChannel_connect_Probe
Registered: .Sockets$SocketChannel_read_Probe
Registered: .Sockets$SocketChannel_write_Probe
Registered: .Sockets$SocketInputStream_read_Probe
Registered: .Sockets$SocketOutputStream_write_Probe
Registered: .Sockets$Socket_close_Probe
Registered: .Sockets$Socket_connect_Probe
Registered: .Sockets$Socket_getInputStream_Probe
Registered: .Sockets$Socket_getOutputStream_Probe
Registered: .SocketsLW$ServerSocketChannel_accept_Probe
Registered: .SocketsLW$ServerSocket_accept_Probe
Registered: .SocketsLW$SocketChannel_close_Probe
Registered: .SocketsLW$SocketChannel_connect_Probe
Registered: .SocketsLW$SocketChannel_read_Probe
Registered: .SocketsLW$SocketChannel_write_Probe
Registered: .SocketsLW$SocketInputStream_read_Probe
Registered: .SocketsLW$SocketOutputStream_write_Probe
Registered: .SocketsLW$Socket_close_Probe
Registered: .SocketsLW$Socket_connect_Probe
Registered: .TestNG$Test_Probe
Registered: .Threads$Thread_constructor_Probe
Registered: .Threads$Thread_run_Probe
Registered: .Threads$Thread_setName_Probe
Registered: .Threads$Thread_start_Probe
15050 0.336: tracing=off: large method: 6154 sun.io.CharacterEncoding.installAll()
15050 0.387: tracing=off: large method: 5376 sun.nio.cs.StandardCharsets$Aliases.init(java.lang.Object[])
15050 0.669: agentStart: 1
15050 0.669: agentStart: 2
15050 0.669: agentStart: OK
15050 0.838: agentInit: 1
15050 0.839: agentInit: Core loaded
15050 0.849: setTriggers:

15050 0.902: setTriggers: to unregister: 0
15050 0.902: setTriggers: method listeners to register: 0
15050 0.902: setTriggers: OK
15050 0.902: ourUnsafe: true
15050 0.902: shmem 42341490: OK
15050 0.902: shmem 4234148E: OK
15050 0.960: Profiler agent is listening on port 10001
15050 0.961: *** HINT ***: To get profiling results, connect to the application from the profiler UI
15050 0.961: agentInit: Core.init() called
15050 0.966: agentInit: OK
15050 0.966: startProfiling: 1
15050 0.966: startProfiling: OK
15050 0.967: socket timeout: 30000
15050 1.034: tracing=off: large method: 3123 javax.management.MBeanPermission.getMask(java.lang.String)
15050 1.275: [m: 4266 106] total classes: processed=1000 instrumented=1000 ms=523 ms
15050 1.370: tracing=off: large method: 7984 java.math.BigDecimal.dpd2bcdinit()
15050 1.436: f_t_a_d: #5 trn=14 conv=0/15 ms=1
15050 1.445: vmDeath: 1
15050 1.445: vmDeath: 2
15050 1.445: vmDeath: 3
15050 1.445: vmDeath: 4
15050 1.445: vmDeath: OK
vishalendu
 
Posts: 3
Joined: Fri Apr 24, 2015 11:58 am

Re: Getting NoSuchMethodError when profiling Liberty Profile

Postby Anton Katilin » Fri Apr 24, 2015 1:18 pm

Hi,

It's a new issue, we're investigating.

As a workaround please try specifying the startup option probe_disable=*
https://www.yourkit.com/docs/java/help/ ... ptions.jsp

Best regards,
Anton
Anton Katilin
 
Posts: 5574
Joined: Wed Aug 11, 2004 8:37 am

Re: Getting NoSuchMethodError when profiling Liberty Profile

Postby Anton Katilin » Fri Apr 24, 2015 1:28 pm

Please also try removing

-javaagent:/u02/qasp01/mrm/bin/tools/ws-javaagent.jar

or re-order the agents such that the YourKit agent goes last:

-javaagent:/u02/qasp01/mrm/bin/tools/ws-javaagent.jar
-agentpath:/u02/qasp01/yourkit/bin/linux-x86-64/libyjpagent.so
Anton Katilin
 
Posts: 5574
Joined: Wed Aug 11, 2004 8:37 am

Re: Getting NoSuchMethodError when profiling Liberty Profile

Postby vishalendu » Mon Apr 27, 2015 10:37 am

I have tried both your suggestion,
1) Added -Dprobe_disable=* to JVM arguments.
2) Modified the server startup script so that the -agentpath for youkit comes at the last of the classpath/arguments.

both of the above are not working. The server is not able to start.

However, I was able to run the Liberty server with Sun/Oracle JDK and it ran without any issues. I am able to connect to it using the Console application. I did not need to change anything for this. I only mentioned the -agentpath under java arguments, as I used to do in the past.

So, looks like this issue is limited to IBM JDK. The problem for me is that I want to profile the application with IBM JDK.
Please let me know if I can provide any further information.
vishalendu
 
Posts: 3
Joined: Fri Apr 24, 2015 11:58 am

Re: Getting NoSuchMethodError when profiling Liberty Profile

Postby Anton Katilin » Mon Apr 27, 2015 3:01 pm

1) Added -Dprobe_disable=* to JVM arguments.

Unfortunately you did it wrong. It's not a Java option to be specified via -D. It's the agent option, it should be specified as described here:
https://www.yourkit.com/docs/java/help/ ... ptions.jsp

So, looks like this issue is limited to IBM JDK.

Yes, indeed.
Anton Katilin
 
Posts: 5574
Joined: Wed Aug 11, 2004 8:37 am

Re: Getting NoSuchMethodError when profiling Liberty Profile

Postby Anton Katilin » Mon Apr 27, 2015 3:02 pm

It's the agent option, it should be specified as described


That is, you should change

-agentpath:/u02/qasp01/yourkit/bin/linux-x86-64/libyjpagent.so

to

-agentpath:/u02/qasp01/yourkit/bin/linux-x86-64/libyjpagent.so=probe_disable=*
Anton Katilin
 
Posts: 5574
Joined: Wed Aug 11, 2004 8:37 am

Re: Getting NoSuchMethodError when profiling Liberty Profile

Postby vishalendu » Tue Apr 28, 2015 6:13 am

As you have mentioned above, I have added the following as JVM argument:
-agentpath:/u02/qasp01/yourkit/bin/linux-x86-64/libyjpagent.so=probe_disable=*

Now, I am able to start the server and am able to connect using the console. (This is with IBM JDK.)

Just wanted to check, if this issue is going to be fixed in some future release.

Thanks
vishalendu
 
Posts: 3
Joined: Fri Apr 24, 2015 11:58 am

Re: Getting NoSuchMethodError when profiling Liberty Profile

Postby Anton Katilin » Tue Apr 28, 2015 9:27 am

We don't know how to reproduce this issue, but according to the error stack trace the problem is with IBM Java, not with the agent. The stack trace is obviously corrupt, and a profiler agent cannot not be responsible for that.

I can only recommend that you:
- try the latest IBM Java build available if you are not already using the latest one;
- if you have an IBM contract please try to report this case to IBM.
Anton Katilin
 
Posts: 5574
Joined: Wed Aug 11, 2004 8:37 am


Return to Java Profiler

Who is online

Users browsing this forum: Bing [Bot] and 3 guests

cron