I was already exporting my.domain.package.* from my bundle. jaxb-impl
contains ContextFactory so I added
<DynamicImport-Package>*</DynamicImport-Package>
to jaxb-impl's pom.xml file and verified that it appeared in the
manifest. I still get the same runtime error message.
Does this mean that reflection doesn't work in OSGi?
Tim
Felix Meschberger wrote:
Hi Tim,
This sounds very much as there is a classloading issue: It seems that a
com.sun class - is this one in the JDK rt.jar ? - is trying to load a
class
from a bundle. This however will never work.
If the com.sun class is in any of the jaxb bundles, it might help to
declare
a "global" dynamic import in the respective jaxb bundle manifest:
DynamicImport-Package: *
Problem is, that two things must be true for a bundle to see another
bundle's class: The class must be exported by the provider and must be
imported by the consumer.
Hope this helps
Regards
Felix
On 3/19/07, Tim Moloney <[EMAIL PROTECTED]> wrote:
Tim Moloney wrote:
> I'm trying to use JAXB within a bundle that I'm writing but I'm not
> having much luck.
>
> I can compile and start my bundle (after I load the jaxb-libs,
> jax-impl, relaxngDatatype, and xsdlib bundles I wrapped). However, I
> get a runtime error ("my.domain.package" doesnt contain
> ObjectFactory.class or jaxb.index) when I try to get a JAXB context.
>
> ObjectFactory is in my.domain.package (it's actually generated by
> hyperjaxb2) and I've exported my.domain.package.* from my bundle, but
> com.sun.xml.internal.bind.v2.ContextFactory.createContext() can't seem
> to find it.
>
> Any thoughts on what else I may need to do?
>
> Thanks,
> Tim
I forgot to mention that JAXB works outside Felix as expected.
Tim