tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bjorn Danielsson <bjorn-apa...@lists.cuspycode.com>
Subject Re: Bug: endorsed JAXB is broken
Date Fri, 04 May 2012 09:03:39 GMT
Thanks Romain!

I can confirm that my webapp now works with this night's snapshot.

-- 
Björn Danielsson
Cuspy Code AB


Romain Manni-Bucau <rmannibucau@gmail.com> wrote:
> should be fine on trunk now
>
> - Romain
>
>
> 2012/5/3 Bjorn Danielsson <bjorn-apache@lists.cuspycode.com>
>
>> Aha, so the class signature works. I use the String signature:
>>
>> JAXBContext ctx = JAXBContext.newInstance("com.example.jaxb.mypkg");
>>
>> Actually I just noticed that you don't need any data classes to
>> demonstrate the problem. Just call JAXBContext.newInstance("foo").
>> A working JAXB should give this error:
>>
>> JAXBException: "foo" doesnt contain ObjectFactory.class or jaxb.index
>>
>> instead of NoSuchMethodError.
>>
>> --
>> Björn Danielsson
>> Cuspy Code AB
>>
>>
>> Romain Manni-Bucau <rmannibucau@gmail.com> wrote:
>> > just tried a just build trunk and this code works:
>> >
>> > final JAXBContext ctx = JAXBContext.newInstance(XmlThing.class);
>> >         final StringWriter writer = new StringWriter();
>> >         ctx.createMarshaller().marshal(new XmlThing("foo"), writer);
>> >
>> > anything to reproduce your issue?
>> >
>> > - Romain
>> >
>> >
>> > 2012/5/3 Bjorn Danielsson <bjorn-apache@lists.cuspycode.com>
>> >
>> >> Hi,
>> >>
>> >> I get the following error when I try to use JAXB in my webapp:
>> >>
>> >> java.lang.NoSuchMethodError:
>> >>
>> javax.xml.bind.ContextFinder.find(Ljava/lang/String;Ljava/lang/ClassLoader;Ljava/util/Map;)Ljavax/xml/bind/JAXBContext;
>> >>
>> >> I noticed that TomEE uses an endorsed version 2.2 of JAXB,
>> >> with the ContextFinder class excluded, as mentioned here:
>> >>
>> >> https://issues.apache.org/jira/browse/TOMEE-145
>> >>
>> >> But the JVM version of JAXB does not have any ContextFinder.find()
>> >> method with the signature in my error message, so something is
>> >> obviously broken. I also checked the latest release (2.2.5) of
>> >> JAXB-RI, and there is no such signature there either.
>> >>
>> >> When I replaced the endorsed jaxb-api.jar and jaxb-impl.jar with
>> >> the corresponding jars from JAXB-RI 2.2.5 the error went away,
>> >> and as far as I can see that did not break anything else.
>> >>
>> >> Version info:
>> >>
>> >> apache-tomee-plus-1.0.0-beta-3-SNAPSHOT (from May 3)
>> >> jdk1.6.0_27 (which I think contains JAXB-RI version 2.1.10)
>> >>
>> >> --
>> >> Björn Danielsson
>> >> Cuspy Code AB
>> >>
>>

Mime
View raw message