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 125594 - NoClassDefFoundError when profiling a single root method on JBoss
Summary: NoClassDefFoundError when profiling a single root method on JBoss
Status: RESOLVED WONTFIX
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 6.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: issues@profiler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-18 20:26 UTC by _ gsporar
Modified: 2008-03-25 22:30 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
sample application (41.80 KB, application/octet-stream)
2008-01-18 20:28 UTC, _ gsporar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ gsporar 2008-01-18 20:26:35 UTC
Environment:

1. Ubuntu 7.10
2. JDK 6u3
3. NetBeans 6.0 
4. JBoss 4.2.2

There is a very simple little JSF/EJB3 application that JBoss provides on their web site: 

http://labs.jboss.com/file-access/default/members/jbossas/freezone/docs/Getting_Started_Guide/beta422/html/Sample_JSF_EJB3_Application.html

I created a free form web application for it, which I will attach to this IZ.

Since it is free form, I use the "attach" technique for profiling it.  The steps are:

1. From the Services tab in the IDE, start JBoss.  Do *not* start in "Profile" mode - just do a regular Start.
2. After JBoss starts, use Profile > Attach Profiler
3. In the "Attach to" field choose the free form project ("jsfejb3")
4. Choose CPU profiling
5. Choose Part of Application
6. Choose the constructor of the TodoBean class as the root method
7. Set the filter to "Profile Only Project Classes"
8. Use the wizard to set the Attach Mode to "Local dynamic attach to JBoss 4+"
9. Click the Attach button

There is about a 45 second delay (on my 2GHz machine) during which time the CPU is maxed out.  Then the "performing
instrumentation" dialog is displayed briefly.  (As an aside, this seems odd to me - why the 45 seconds of computing at
this point?  That seems like a long time to calculate the call graph for that constructor, especially since I only
requested "project classes" in the filter.  But I digress....  :-) )

After the instrumentation is finished, go to the browser and put in http://localhost:8080/jsfejb3/index.faces.  Then
click the "Create new Todo" link.  The browser displays a 500 error, with a stack trace that starts with:

java.lang.NoClassDefFoundError: org/netbeans/lib/profiler/server/ProfilerRuntimeCPUFullInstr
	TodoBean.<init>(TodoBean.java:19)
	sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	java.lang.Class.newInstance0(Class.java:355)
	java.lang.Class.newInstance(Class.java:308)
	com.sun.faces.config.ManagedBeanFactoryImpl.newInstance(ManagedBeanFactoryImpl.java:277)
	com.sun.faces.application.ApplicationAssociate.createAndMaybeStoreManagedBeans(ApplicationAssociate.java:546)
	com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:82)
	javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
Comment 1 _ gsporar 2008-01-18 20:28:57 UTC
Created attachment 55261 [details]
sample application
Comment 2 J Bachorik 2008-03-25 22:30:02 UTC
Unfortunately, this seems to be a problem in JBoss. The same result I get whenever I use the AttachAPI to instrument
JBoss AS. I tried BTrace to confirm that the problem is not in the profiler code - and it fails the same.
It seems that JBoss makes the classes loaded through AttachAPI somehow invisible to at least EL engine which is
responsible for instantiating the TodoBean class.
The only workaround is to use direct attach instead. This way the EL engine has access to all required classes.