[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] class not found in the same package

i put all the classes in one bundle and exported from there. then it worked.
i will try this tool. we will need it soon i think
thanks !

Niclas Hedhman wrote:
On Sunday 30 September 2007 15:40, Mayank Thakore wrote:

I am running standard, osgi framework bundles from inside eclipse 3.2.0.

I get a class not found exception java.lang.NoClassDefFoundError
However the package is already imported. There are two classes in the
package. One of them I am able to access but not the other ! (the
exporting bundle has the package inside a jar file in its classpath).

When I removed the import both classes are inaccessible. But if I
introduce the import only one of the classes becomes accessible. I have
ensured that only one bundle is exporting the package.

I'm stuck with this for a few hours now and don't know how to go around
looking for a solution. Any help is appreciated.

It happens occassionally that the wrong class is reported with a NoClassDefError. This is not a Equinox/OSGi bug, but an issue in the JVM.

In the class reported having a problem, start looking for classes that it references indirectly via - super class
- implements
- members
- method arguments and return types

And stuff those in turn are referencing in the same manner.

I also suggest that you run Peter Kriens' BND tool on your bundle, which will pin-point the problems for you. See http://www.aqute.biz/Code/Bnd
If you use Maven, then BND is built into the Maven Bundle Plugin, which is available from Apache Felix project.