[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] servletbridge activator ClassNotFound exception

Thanks Simon that lead me down the right path.

I was actually running against a "cracked" open bundle already, actually
I was installing my eclipse project root as the bundle instead of a
packaged jar.  That's when I realized my compiled classes were in my
output folder duh (i.e. /bin).  So I packaged up my two bundles as jars
and my activator works.  However now it is not finding the exported
packaged in the other bundle :(.  Apparently the eclipse tooling (PDE
and equinox launcher) resolves all this for you when launching equinox
stand-alone via the eclipse launch config.  However you lose all these
goodies when you launch it via the servlet bridge and start installing
bundles manually ;).

Here is my setup,

I have one bundle HelloWorld, that exposes one package
(com.railinc.example.hello) that contains one Interface (HelloWorld).
Here is its manifest:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: HelloWorld Plug-in
Bundle-SymbolicName: HelloWorld
Bundle-Version: 1.0.2
Bundle-Localization: plugin
Export-Package: com.railinc.example.hello
Bundle-ClassPath: .

My HelloWorld.jar has the following:

I then have another bundle HelloNoSpring that has an internal
implementation of the HelloWorld interface and an Activator.  Its
manifest looks like this:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: HelloNoSpring Plug-in
Bundle-SymbolicName: HelloNoSpring
Bundle-Version: 1.0.4
Bundle-Activator: com.railinc.example.activator.HelloNoSpringActivator
Bundle-Localization: plugin
Import-Package: com.railinc.example.hello,
Bundle-ClassPath: .

Its jar has the following:

* HelloWorldImpl implements the HelloWorld Interface 
* The Activator news up an instance of HelloWorldImpl and tries to
invoke it.

If I comment out the HelloWorld part my activator runs fine now.
However when I add the HelloWorld stuff in there it fails saying it
can't find my HelloWorld interface :(.

Another very interesting point!

If I add the HelloWorld bundle as a required bundle instead of an
imported package it works, but when I try to just do it as an imported
package, I get the CNFE :(.  Any ideas anyone?