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 125645

Summary: Remote profiling Glassfish v2U1 abruptly ends with NPE
Product: profiler Reporter: J Bachorik <yardus>
Component: BaseAssignee: J Bachorik <yardus>
Status: VERIFIED FIXED    
Severity: blocker    
Priority: P2    
Version: 6.x   
Hardware: PC   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description J Bachorik 2008-01-21 09:22:54 UTC
When trying to profile glassfish v2U1 remotely the process dies with the following exception:
SEVERE: CORE5071: An error occured during initialization
java.lang.NullPointerException
        at org.netbeans.lib.profiler.server.ClassBytesLoader.getClassFileBytes(C
lassBytesLoader.java:72)
        at org.netbeans.lib.profiler.server.ProfilerInterface.classLoadHook(Prof
ilerInterface.java:860)
        at java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
        at java.lang.Class.getConstructor0(Class.java:2699)
        at java.lang.Class.getConstructor(Class.java:1657)
        at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:587)
        at com.sun.enterprise.admin.util.proxy.ProxyFactory.createProxy(ProxyFac
tory.java:65)
        at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.<init>(Sun
oneInterceptor.java:166)
        at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.createInst
ance(SunoneInterceptor.java:185)
        at com.sun.enterprise.admin.server.core.AdminService.init(AdminService.j
ava:310)
        at com.sun.enterprise.admin.server.core.AdminServiceLifeCycle.onInitiali
zation(AdminServiceLifeCycle.java:116)
        at com.sun.enterprise.server.ApplicationServer.onInitialization(Applicat
ionServer.java:262)
        at com.sun.enterprise.server.ondemand.OnDemandServer.onInitialization(On
DemandServer.java:101)
        at com.sun.enterprise.server.PEMain.run(PEMain.java:401)
        at com.sun.enterprise.server.PEMain.main(PEMain.java:338)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.enterprise.server.PELaunch.main(PELaunch.java:414)
Comment 1 J Bachorik 2008-01-21 09:32:09 UTC
This is caused by a synthetic class being loaded by the system classloader. The profiler tries to load the bytecode from
the file defining the class but there is none.
Added a simple check for this cases.

Checking in ClassBytesLoader.java;
/cvs/profiler/libs/jfluid/src/org/netbeans/lib/profiler/server/ClassBytesLoader.java,v  <--  ClassBytesLoader.java
new revision: 1.2; previous revision: 1.1
done
Comment 2 J Bachorik 2008-01-21 13:56:54 UTC
changing milestone
Comment 3 J Bachorik 2008-03-12 11:07:37 UTC
*** Issue 122631 has been marked as a duplicate of this issue. ***
Comment 4 J Bachorik 2008-03-12 11:08:38 UTC
*** Issue 129874 has been marked as a duplicate of this issue. ***
Comment 5 J Bachorik 2008-04-17 10:10:07 UTC
*** Issue 133062 has been marked as a duplicate of this issue. ***
Comment 6 elkouti 2008-11-20 18:28:35 UTC
I'm using the 6.1 version of the profiler and the issue seems to be there, I'm trying to profile tomcat 5x remotely : 


Exception in thread "Thread-6" java.lang.NullPointerException
        at org.netbeans.lib.profiler.server.ClassBytesLoader.getClassFileBytes(ClassBytesLoader.java:72)
        at org.netbeans.lib.profiler.server.ProfilerInterface.classLoadHook(ProfilerInterface.java:860)
        at java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2328)
        at java.lang.Class.getConstructor0(Class.java:2640)
        at java.lang.Class.getConstructor(Class.java:1629)
        at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:587)
        at sun.reflect.annotation.AnnotationParser.annotationForMap(AnnotationParser.java:239)
        at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:229)
        at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69)
        at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52)
        at java.lang.Class.initAnnotationsIfNecessary(Class.java:2998)
        at java.lang.Class.getAnnotation(Class.java:2958)
        at sun.reflect.annotation.AnnotationType.<init>(AnnotationType.java:104)
        at sun.reflect.annotation.AnnotationType.getInstance(AnnotationType.java:64)
        at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:202)
        at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69)
        at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52)
        at java.lang.Class.initAnnotationsIfNecessary(Class.java:2998)
        at java.lang.Class.getAnnotation(Class.java:2958)
        at sun.reflect.annotation.AnnotationType.<init>(AnnotationType.java:104)
        at sun.reflect.annotation.AnnotationType.getInstance(AnnotationType.java:64)
        at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:202)
...


Best regards,
Anis 
Comment 7 Tomas Hurka 2008-12-09 14:49:53 UTC
From the stacktrace it looks like you are running old version of the code. Note that for remote profiling the fix is in 6.1 remote pack. So it does not matter if 
you are using NetBeans 6.1, you have to have correct remote pack.
Comment 8 Rashid Urusov 2008-12-19 14:13:23 UTC
 VERIFIED in build 200812180001