NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Memory Profiler plus Apache Commons IO Bundle?

 
Post new topic   Reply to topic    NetBeans Forums -> Profiler Users
View previous topic :: View next topic  
Author Message
Cush1978



Joined: 15 Sep 2008
Posts: 340

PostPosted: Mon Mar 18, 2013 7:19 pm    Post subject: Memory Profiler plus Apache Commons IO Bundle? Reply with quote

I'm copying this post from the NetBeans Platform forum since it probably belongs here:
----------
I'm having a heck of a time profiling my project. I'm using NetBeans 7.2 with all the available updates which I guess makes it 7.2.1. We haven't migrated to 7.3 yet.

When my application starts, it uses the Apache Commons IO Bundle library to load files/projects my application previously had open. That causes a stack trace related to profiling:

Code:
java.lang.ClassNotFoundException: org.netbeans.lib.profiler.server.ProfilerRuntimeObjAlloc not found by org.apache.commons.io [68]
   at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1465)
   at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)
   at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)
Caused: java.lang.ClassNotFoundException: *** Package 'org.netbeans.lib.profiler.server' is not imported by bundle org.apache.commons.io [68], nor is there any bundle that exports package 'org.netbeans.lib.profiler.server'. However, the class 'org.netbeans.lib.profiler.server.ProfilerRuntimeObjAlloc' is available from the system class loader. There are two fixes: 1) Add package 'org.netbeans.lib.profiler.server' to the 'org.osgi.framework.system.packages.extra' property and modify bundle org.apache.commons.io [68] to import this package; this causes the system bundle to export class path packages. 2) Add package 'org.netbeans.lib.profiler.server' to the 'org.osgi.framework.bootdelegation' property; a library or VM bug can cause classes to be loaded by the wrong class loader. The first approach is preferable for preserving modularity. ***
   at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1857)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Caused: java.lang.NoClassDefFoundError: org/netbeans/lib/profiler/server/ProfilerRuntimeObjAlloc
   at org.apache.commons.io.IOUtils.<clinit>(IOUtils.java:113)
// From here, it goes into my call to the Commons IO Library


My application has all the available library clusters enabled save Enterprise, Groovy, and JavaFX. From the stack trace, it appears the Commons IO Bundle is missing some dependency it should have.

The application runs fine when I'm not profiling.

I've managed to capture this in a small platform application:

- If you launch the application test normally and choose the menu item under "Profiler Test", everything works fine.

- If you try to do a memory profile on the application and choose the menu item under "Profiler Test", the stack trace occurs.

Does this need to be filed as a bug? Is there a workaround I can implement to get this right in 7.2?

Thanks.



profiler-io.zip
 Description:

Download
 Filename:  profiler-io.zip
 Filesize:  23.81 KB
 Downloaded:  428 Time(s)

Back to top
Cush1978



Joined: 15 Sep 2008
Posts: 340

PostPosted: Mon May 06, 2013 6:34 pm    Post subject: Reply with quote

Well, I just factored the Apache Commons IO Bundle out of our application. Now I'm back to square one, but the issue is Commons Lang now. Exactly same error, different library:

Code:
SEVERE [global]
java.lang.ClassNotFoundException: org.netbeans.lib.profiler.server.ProfilerRuntimeObjAlloc not found by org.apache.commons.lang [164]
...


Does anyone else profile memory with Apache libraries?
Back to top
Tomas Hurka
Posted via mailing list.





PostPosted: Tue May 07, 2013 7:37 am    Post subject: Memory Profiler plus Apache Commons IO Bundle? Reply with quote

Hi Michael,

On 6 May 2013, at 20:34, Cush1978 wrote:

Quote:
Well, I just factored the Apache Commons IO Bundle out of our application. Now I'm back to square one, but the issue is Commons Lang now. Exactly same error, different library:


Code:
SEVERE [global]
java.lang.ClassNotFoundException: org.netbeans.lib.profiler.server.ProfilerRuntimeObjAlloc not found by org.apache.commons.lang [164]
...

Does anyone else profile memory with Apache libraries?
I don't think that this is caused by Apache libraries. The problem seems to be in OSGi settings. See my reply in Issue 229183 <https://netbeans.org/bugzilla/show_bug.cgi?id=229183>

Bye,
--
Tomas Hurka <mailto:address-removed>
NetBeans Profiler http://profiler.netbeans.org
VisualVM http://visualvm.java.net
Software Developer
Oracle, Praha Czech Republic
Back to top
Cush1978



Joined: 15 Sep 2008
Posts: 340

PostPosted: Tue May 07, 2013 6:09 pm    Post subject: Reply with quote

I replied on my bug report, but I'll also update here.

How do I manipulate the org.osgi.framework.bootdelegation property?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Profiler Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo