I should also mention that I get different errors with this problem
bundle depending on how I bring the system up - and this could indicate
that it is a Clojure issue.

If I start the Felix console and install and start the bundles "by
hand", I get the error that I showed before.  But if I start the Felix
console and the bundles are cached, then Felix automatically starts them
and I get an error like the following:

java.io.FileNotFoundException: Could not locate com/example/MyClass__init.class 
or com/example/myclass.clj on classpath


(the .clj file is a Clojure source file).  Now that I think about it
this could be due to the order in which the bundles are started. 
Perhaps one of these bundles does not properly handle a missing
dependency.  And the Clojure bundle is a bit of a black box to me at
this point.

Tim

On 08/18/2014 07:25 PM, Tim McIver wrote:
> Neil,
>
> Running that command shows that the correct package is being imported
> and resolved to the correct bundle.
>
> I should probably also mention that both the class that is being
> instantiated as well as the class from which it is derived are compiled
> from Clojure code.  This /shouldn't/ matter as there are .class files
> for both of these classes that are normal Java byte code.  But one of
> the bundles that I'm using is a Clojure OSGi bundle.  Clojure is
> problematic in OSGi as it has its own classloader but this bundle (not
> created by me) /should/ handle this correctly, but I don't know for sure.
>
> Tim
>
> On 08/18/2014 05:29 PM, Neil Bartlett wrote:
>> Does the “problem bundle” import the package? You can check this with the 
>> following command:
>>
>>      inspect req osgi.wiring.package <bundle-id>
>>
>>
>> Regards,
>> Neil
>>
>>
>> On 18 August 2014 at 22:09:17, Tim McIver ([email protected]) wrote:
>>
>> Hello,  
>>
>> I'm getting a NoClassDefFoundError when trying to start a bundle that  
>> resolves without error. This happens when trying to instantiate a class  
>> (in the bundle activator) whose .class file resides in the bundle  
>> itself. But the class being instantiated is derived from a class found  
>> in another bundle, already resolved and started. To confirm that I've  
>> got things wired up in the way that I think I do, I ran the following  
>> command at the Felix console:  
>>
>> g! which <problem-bundle-id> 
>> <fully-qualified-name-of-class-that-gives-noclassdeffounderror>  
>>
>>
>> and the response is good (I think):  
>>
>> Loaded from: <com.example.impl> [50]  
>>
>>
>> where 50 is indeed the ID of the bundle where I'm exporting package  
>> com.example.impl. Any idea what could be causing this?  
>>
>> Thanks,  
>> Tim  
>>
>> ---------------------------------------------------------------------  
>> To unsubscribe, e-mail: [email protected]  
>> For additional commands, e-mail: [email protected]  
>>
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to