users@glassfish.java.net

uppgrading jaxb in deployed version of glassfish

From: <glassfish_at_javadesktop.org>
Date: Mon, 12 Feb 2007 08:34:30 PST

I have a deployed instance of glassfish which hosts a few applications I cannot take it off line for more then a few seconds, so restarts are possible, but I don't want to try something much fancier then that.

I am trying to deploy a new web app which uses the google checkout API, the schema provided by google uses the attribute 'elementFormDefault="qualified"', which causes a Null pointer exception when creating a Context, that looks something like:
java.lang.NullPointerException
at com.sun.xml.bind.v2.model.impl.PropertyInfoImpl.calcXmlName(PropertyInfoImpl.java:287)
at com.sun.xml.bind.v2.model.impl.PropertyInfoImpl.calcXmlName(PropertyInfoImpl.java:260)
at com.sun.xml.bind.v2.model.impl.ElementPropertyInfoImpl.getTypes(ElementPropertyInfoImpl.java:100)

I have tried removing the elementFormDefault="qualified" from the schema and generating my own classes, however, my test fail because the objects no longer unmarshal from the XML provided by google.

This error is fixed in new versions of jaxb, and I have jars with the correct implementation, however, I can't seem to get the code working in my live version of glassfish. I have tried including the new jaxb jars in the war file and made sure to create the context with a specified classloader, thusly:
context = JAXBContext.newInstance(ObjectFactory.class.getPackage().getName(), this.getClass().getClassLoader());


poking around the jars in the lib directory of glassfish shows me that the jaxb implementation is provided by the jar javaee.jar, I am extremely hesitant to replace this jar with a new version, since I have idea what the effects will be on glassfish itself or the other running applications.

I am currently using java 5, I was thinking that upgrading to java 6 might help, but some post I have read suggest that java 6 has an older version of jaxb installed that used by glassfish. though maybe not the version I am using (build b48).


if anyone has any suggestions or ideas. I would love to have them. In the meantime I guess I will be dropping back to DOM :(

-Lucas
[Message sent by forum member 'lucasjordan' (lucasjordan)]

http://forums.java.net/jive/thread.jspa?messageID=203432