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

On Sunday 30 September 2007 15:40, Mayank Thakore wrote:
> Hi,
>
> 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.


Cheers
-- 
Niclas Hedhman, Software Developer

I  live here; http://tinyurl.com/2qq9er
I  work here; http://tinyurl.com/2ymelc
I relax here; http://tinyurl.com/2cgsug