[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'd suggest you try using the PDE manifest clean up wizard as well. It should detect all the right imports and uses required by the code in your bundle.

In the future look also for some help from the PDE API tools.  These will be able to report on what exactly your bundles consume from and provide to the outside world.  see (though that plan is somewhat out of date)
        http://wiki.eclipse.org/PDE_UI_Incubator_ApiTools

Side note/hint:  When you get a NoClassDefFoundError it generally means that there was a problem while defining/verifying another class.  That is, you get ClassNotFoundException if A cannot be found but a NoClassDefFoundError if A is found and cannot be defined/verified.  

Jeff



Mayank Thakore <thakore.mayank@xxxxxxxxx>
Sent by: equinox-dev-bounces@xxxxxxxxxxx

09/30/2007 09:36 AM

Please respond to
Equinox development mailing list <equinox-dev@xxxxxxxxxxx>

To
Equinox development mailing list <equinox-dev@xxxxxxxxxxx>
cc
Subject
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:
>  
>> 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
>  
_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev