OK, I've added those two manifest keys to my bundle jar.  Unfortunately
I'm still getting a NoClassDefFoundError but at least now it is coming
from clojure.osgi.  The book "OSGi in Action" states that a
NoClassDefFoundError

". . . means the initial class that started the current load cycle/was/
found, but the class loader wasn't able to finish loading it because a
class it depends on was missing."

So with this in mind I added all of the namespaces that are required in
the Clojure file that gen-classes the class I'm trying to instantiate in
my Clojure bundle activator to the list of namespaces in Clojure-Require
(did you get all that?).  This did not help.  I suppose this shouldn't
be surprising since the namespace I initially already required all these
other namespaces.

I can see the class file that is having the problem in my bundle jar but
without knowing exactly what it depends on I'm not sure how to figure
out which of its dependencies cannot be found.

I've also wondered about Java imports: the Clojure file that generates a
class (gen-class) has some Java imports.  Does clojure.osgi need to know
about these?  Do I need a corresponding manifest key for Clojure-Import
(in analogy to Clojure-Require)?

Mark, I appreciate any help you can give me on this.  If this discussion
is too off-topic for this list, perhaps we can talk about this via
personal email, if you are willing.

Thanks,
Tim

On 08/20/2014 12:09 AM, Mark Derricutt wrote:
> On 20 Aug 2014, at 3:05, Tim McIver wrote:
>
>> No problem and I'm sorry to hear about your illness.
>
> I wish not the stomach flu on anyone - really wipes you out!
>
>> NoClassDefFoundError.  It looks like one
>> of my problems is that I do not have the <Clojure-Require> or
>> <Clojure-Activator> pom tags.  In fact, I haven't been using Maven at
>> all; we're using lein and I've created a lein
>
> You don't need to use Maven at all, the `Clojure-Require` and
> `Clojure-Activator` elements just get added to the Manifest.MF file
> and are processed/looked for using clojure-osgi ( so you'll still need
> my artifact to deploy to your OSGi container ).
>
>> plugin that calls bnd to
>> add the bundle metadata.  I suppose, in the
>
> In your plugin you'd just add a way of adding the above two
> configuration properties.
>
>> In my problem bundle the activator is being called through the normal
>
> The trick here is that you're not using an actual "Bundle-Activator",
> but a "Clojure-Activator" which takes care of class loaders/namespaces
> etc. etc.
>
>> At some point I also tried to create my own Clojure OSGi bundle with the
>> naive assumption that I could treat the Clojure
>
> It'd probably be easier to just use the one I have, which was written
> originally by greater minds than mine, I've just adopted the abandoned
> project and updated it to 1.6 and published it to Maven Central.
>
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>

Reply via email to