Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Debugging class loading issues
Debugging class loading issues [message #1015462] Thu, 28 February 2013 11:09 Go to next message
Franck Mising name is currently offline Franck Mising name
Messages: 91
Registered: July 2009
Location: France
Member
I am a beginner with OSGI, and despite reading dozens of articles & posts on the subject I am still struggling to come up with a consistent approach to troubleshooting classloading issues is Virgo.

Basically I have a WAB bundle W in a plan that deploys fine, then fails at runtime with a ClassNotFoundException.
W depends on bundle A which depends on B

clhas / clexport show that the class is available, and clload reports that both W and B can successfully load the class.
The exception is:
[2013-02-28 16:49:32.494] ERROR http-bio-8080-exec-7         o.a.c.c.C.[.[localhost].[/mc].[My Web Application]         Servlet.service() for servlet [My Web Application] in context with path [/mc] threw exception [Servlet execution threw an exception] with root cause java.lang.ClassNotFoundException: org.apache.http.conn.ClientConnectionManager

	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)

	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)

	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)

	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)

	at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:135)

	at java.lang.ClassLoader.loadClass(ClassLoader.java:356)


I am at a complete loss as to where to go from there... presumably some bundle should be importing org.apache.http.conn but how do I find out which??

Also, I have tried to enable classloading debugging in equinox by adding this line to configuration/config.ini:
osgi.debug=file\:equinox-debug.properties


... where the properties file starts with

# Turn on general debugging for org.eclipse.osgi
org.eclipse.osgi/debug=true
# Prints out class loading debug information
org.eclipse.osgi/debug/loader=true


Any pointers would be greatly appreciated,
Thanks!
Re: Debugging class loading issues [message #1015474 is a reply to message #1015462] Thu, 28 February 2013 11:35 Go to previous messageGo to next message
Franck Mising name is currently offline Franck Mising name
Messages: 91
Registered: July 2009
Location: France
Member
I missed a FileNotFound in the log, turning on debugging works fine with

osgi.debug=configuration/equinox-debug.properties
Re: Debugging class loading issues [message #1015480 is a reply to message #1015474] Thu, 28 February 2013 11:55 Go to previous messageGo to next message
Franck Mising name is currently offline Franck Mising name
Messages: 91
Registered: July 2009
Location: France
Member
... and debugging did the trick, it explicitly shows which classloader failed to load the class:

BundleClassLoader[org.acme.xxx_0.0.0.SNAPSHOT].loadClass(org.apache.http.client.HttpClient) failed.

Slightly painful, but much better than trying to guess...
Hope this can be useful to someone.
Re: Debugging class loading issues [message #1016411 is a reply to message #1015480] Wed, 06 March 2013 06:37 Go to previous message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
Thanks for the info and glad you got going.
Previous Topic:LogService per Bundle
Next Topic:Netbeans plugin for Virgo Tomcat Server
Goto Forum:
  


Current Time: Wed Jul 30 07:14:48 EDT 2014

Powered by FUDForum. Page generated in 0.08249 seconds