Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Bundle cant find it's own packages
Bundle cant find it's own packages [message #503548] Mon, 14 December 2009 16:39 Go to next message
Elliot  is currently offline Elliot Friend
Messages: 1
Registered: December 2009
Junior Member
I've got an application that runs in OSGi. I use OSGi to service the plugin system for my application. The application runs fine, but the bundles (plugins) for it are failing to load. They seem to be unable to find their own classes. There are several problems of this type, but here's a trace from a bundle I use to export packages from the mysql connector jar. In the bundle activator, I call

Class.forName("com.mysql.jdbc.Driver");


To register the driver. This has worked for me before, but suddenly started giving me the following error when I start the bundle:

Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:494)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:398)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:105)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:254)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:399)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:169)
	at req.activator.Activator.start(Activator.java:10)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:783)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:774)
	... 14 more



Yes, this package is in the bundle. I am at a loss as to why OSGi is unable to find it. Has anyone else had similar problems?

Here's a snapshot of the project layout:

http://img696.imageshack.us/img696/9315/57713290.jpg

Thanks,
Elliot
Re: Bundle cant find it's own packages [message #503573 is a reply to message #503548] Mon, 14 December 2009 17:58 Go to previous message
Mickael Istria is currently offline Mickael IstriaFriend
Messages: 771
Registered: July 2009
Location: Grenoble, France
Senior Member
Hello,

Is MySAL added as an OSGi an OSGi bundle dependency or included into your bundle as a nested jar?
In the second case, did you add it into your MANIFEST.MF as Bundle-Classpath entry (in the runtime tab of Eclipse bundle editor) and also in your build.properties?

HTH

--
Mickael Istria - BonitaSoft S.A.
http://www.bonitasoft.com/products/downloads.php
Previous Topic:Multi-locale support in extension registry - Why not enabled by default?
Next Topic:Installing feature jars instead of feature folders
Goto Forum:
  


Current Time: Sun Dec 21 22:22:51 GMT 2014

Powered by FUDForum. Page generated in 0.01543 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software