I haven't used it with Felix - but used JAX-B fine under Oscar a few years back.

I seem to remember I found the easiest way to make it work was to package a "schema JAR" bundle which contained my schema, the generated classes, and the JAXB libs as inner JARs.

We use mangen, so the manifest imports/exports were created automatically for me. The result came out like this:

   Import-Package: javax.xml.parsers, javax.xml.transform, javax.xml.tran
    sform.dom, javax.xml.transform.sax, javax.xml.transform.stream, org.h
    ibernate, org.hibernate.cfg, org.w3c.dom, org.xml.sax, org.xml.sax.ex
    t, org.xml.sax.helpers

   Export-Package: com.ascert.vdrive.schema.drvdesc, com.ascert.vdrive.sc
    hema.drvdesc.impl, com.ascert.vdrive.schema.model, com.ascert.vdrive.
    schema.model.impl, com.sun.msv.datatype, com.sun.msv.datatype.xsd, co
    m.sun.msv.grammar, com.sun.xml.bind.util, javax.xml.bind, javax.xml.n
    amespace, org.relaxng.datatype


(this is quite an old one, and I think we were using HyperJAXB in this case)


Because JAXB libs are inside the bundle, I don't think they ended up needed exporting - just the schema classes generated.



-- Rob

Tim Moloney wrote:
Felix Meschberger wrote:
Hi,

On 3/19/07, Tim Moloney <[EMAIL PROTECTED]> wrote:
to jaxb-impl's pom.xml file and verified that it appeared in the
manifest.  I still get the same runtime error message.

ok

Does this mean that reflection doesn't work in OSGi?

No, reflection works (and I also depend in it :-) ).

There might be other problems: For example, jaxb expecting the class
to implement a specific interface or the class not being public.

Re Interface: This is a tricky issue. If the jaxb-impl and your
provider bundle do not use the same interface class instance because
it has been loaded from different class loaders, jaxb-impl will not
accept your class.

I've not worked with class loaders before. How do I know which class loaders are being used? Where can I read more about them?

After all, this is just wild guessing. What I would do in this
situation is to look at the source code of the method, which threw the
exception and try to find out, what makes jaxb this unhappy.

Regards
Felix

I'm not sure that the source for JAXB is available but I'll look.

Thanks for the suggestions.  :)

Tim


--


Ascert - Taking systems to the Edge
[EMAIL PROTECTED]
+44 (0)20 7488 3470
www.ascert.com

Reply via email to