This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 251066 - Unable to profile wls process
Summary: Unable to profile wls process
Status: RESOLVED FIXED
Alias: None
Product: profiler
Classification: Unclassified
Component: Engine (show other bugs)
Version: 8.1
Hardware: All All
: P2 normal (vote)
Assignee: Tomas Hurka
URL:
Keywords: VISUALVM
Depends on:
Blocks:
 
Reported: 2015-03-10 12:37 UTC by Jiri Sedlacek
Modified: 2016-08-12 08:49 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Sedlacek 2015-03-10 12:37:51 UTC
From the related bugdb:

"Oracle Linux Release 6.4, JDK 1.8.40 

Problem Description: 
-------------------- 
Failure attempting to profile a local JDev integrated WLS server.  Profiler 
runs on JDK 8.  Profiled WLS was running with JDK 8 as well. 
Used the Local, Dynamic configuration to attach to the running WLS process.   

Error-Stack Obtained / Diagnostic Analysis: 
------------------------------------------- 
*** Profiler error (Fri Mar 06 10:03:31 PST 2015): connection with server not 
open 
Mar 06, 2015 10:03:49 AM org.netbeans.lib.profiler.ProfilerLogger log 
SEVERE: com.sun.tools.attach.AgentInitializationException: Agent JAR loaded but agent failed to initialize 
     at 
sun.tools.attach.HotSpotVirtualMachine.loadAgent(HotSpotVirtualMachine.java:121) 
     at 
org.netbeans.modules.profiler.NetBeansProfiler.loadAgentIntoTargetJVM(NetBeansProfiler.java:843) 
     at 
org.netbeans.modules.profiler.NetBeansProfiler.attachToApp(NetBeansProfiler.java:814) 
     at 
oracle.jdevimpl.profiler.impl.ProfilerSessionImpl$1.run(ProfilerSessionImpl.java:80) 
     at 
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1423) 
     at 
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)"


Another feedback from the user:

"Sadly, I get the same error using latest 1.3.8 visualvm downloaded from visualvm.java.net when I try to perform the cpu profile.  It does let me see the thread and monitor data.   Perhaps I am doing something wrong?  I'll gather the details for the bug.

Exception in thread "Attach Listener" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
    at sun.instrument.InstrumentationImpl.loadClassAndCallAgentmain(InstrumentationImpl.java:411)
Caused by: java.lang.IllegalAccessError: tried to access method org.netbeans.lib.profiler.server.ProfilerServer.loadNativeLibrary(Ljava/lang/String;Z)V from class org.netbeans.lib.profiler.server.ProfilerActivate15
    at org.netbeans.lib.profiler.server.ProfilerActivate15.activate(ProfilerActivate15.java:135)
    at org.netbeans.lib.profiler.server.ProfilerActivate15.agentmain(ProfilerActivate15.java:64)
    ... 6 more
Agent failed to start!"
Comment 1 Tomas Hurka 2015-03-17 15:36:05 UTC
Fixed in profiler-main

changeset:   284800:5a569f0f4ad2
user:        Tomas Hurka <thurka@netbeans.org>
date:        Tue Mar 17 16:33:47 2015 +0100
summary:     bugfix #251066, make ProfilerServer.loadNativeLibrary() public. This way ProfilerActivate15 (loaded by broken weblogic system classloader) can access it.
Comment 2 Quality Engineering 2015-03-18 03:28:37 UTC
Integrated into 'main-silver', will be available in build *201503180001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/5a569f0f4ad2
User: Tomas Hurka <thurka@netbeans.org>
Log: bugfix #251066, make ProfilerServer.loadNativeLibrary() public. This way ProfilerActivate15 (loaded by broken weblogic system classloader) can access it.
Comment 3 Alexey Anjeleevich 2016-06-21 12:44:21 UTC
Tryed to profile weblogic 12.2.1 using VisualVM shipped with jdk1.8.0_92 and using NetBeans IDE 8.1 (Build 201510222201) and got the following error message box: "Agent JAR loaded but agent failed to initialize".

In weblogic console the following stack trace was printed:

Exception in thread "Attach Listener" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
        at sun.instrument.InstrumentationImpl.loadClassAndCallAgentmain(InstrumentationImpl.java:411)
Caused by: java.lang.IllegalAccessError: tried to access method org.netbeans.lib.profiler.server.ProfilerServer.loadNativeLibrary(Ljava/lang/String;Z)V from class org.netbeans.lib.
profiler.server.ProfilerActivate15
        at org.netbeans.lib.profiler.server.ProfilerActivate15.activate(ProfilerActivate15.java:97)
        at org.netbeans.lib.profiler.server.ProfilerActivate15.agentmain(ProfilerActivate15.java:26)
        ... 6 more
Agent failed to start!
Comment 4 Tomas Hurka 2016-06-21 15:06:17 UTC
Problem is not fixed in any version of VisualVM. Please restart your Weblogic (Weblogic can contain old agent from VisualVM) and use only NetBeans 8.1.