users@jaxb.java.net

Re: JAXB 2 and App servers

From: William Simons <william.simons_at_childrens.harvard.edu>
Date: Tue, 20 Dec 2005 16:36:48 -0500

Hi Ed,

I was trying to trim down my application to send you a war file and ran
across some interesting behavior that might shed some light on the
situation. It appears that the environment that is behaving differently
than all the rest isn't Tomcat or Jetty but actually Junit within maven (I
haven't run Junit outside of maven to isolate it). I know that awhile back,
JAXB2 wasn't working properly within Junit because of a classloader
conflict. This was corrected but perhaps there are some lingering issues.

I'll continue to investigate but any insight that you have would be helpful.

I'll also come up with some simple example files that work in one
environment but not the other.


Thanks,
Bill


On 12/20/05 9:45 AM, "Ed Mooney" <Ed.Mooney_at_Sun.COM> wrote:

> Hi Bill,
>
> At this point, I can refer you only to what we found with JAXB 1.0. It
> seems your environment is consistent with what we suggest:
>
> http://java.sun.com/xml/jaxb/jaxbWithTomcat.html
>
> You might try passing in the classloader when instantiating JAXBContext:
>
> https://jaxb.dev.java.net/faq/index.html#classloader
>
> This is specific to Sun's app server, but for completeness:
>
> https://jaxb.dev.java.net/faq/sjsasjaxb.html
>
> If after this you're still having problems, I'd be happy to try your
> war, if you'd be willing to share it.
>
> Regards,
>
> -- Ed
>
> William Simons wrote:
>> I was wondering if there are any known issues with running JAXB 2 in an
>> application server like Tomcat or Jetty? I couldn't find any on the issue
>> tracker...
>>
>> I'm experiencing different behavior when I run my code as an application vs
>> when I run it as a servlet. I am calling the exact same static method that
>> unmarshals a file and I get different results. The file has some
>> type-substituted elements in it. When I run the code through the application
>> (Junit test) everything works fine. When I run it through my servlet, the
>> type-substituted elements are not unmarshalled and I get only the partial
>> file.
>>
>> Perhaps Tomcat and Jetty use some libraries that are different than what
>> JAXB 2 expects?
>>
>> My WAR file includes the libraries:
>> Activation
>> Commons-codec-1.3
>> Geronimo-spec-servlet-2.4-rc4 (I could probably remove this)
>> Jaxb-api
>> Jaxb-impl
>> Jaxb-xjc
>> jaxb1-impl
>> Je-1.7.1
>> jsr173_1.0_api
>> log4j-1.2.9
>> Sunxacml-1.2
>> And my jar file
>>
>> Thanks,
>> Bill
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
>> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>