[jboss-user] [JBoss Web Services] - jaxb version used by JBoss AS 7.0Final (date issue/timezone issue)

Peter Fry do-not-reply at jboss.com
Tue Aug 21 12:14:23 EDT 2012

Peter Fry [https://community.jboss.org/people/peterfry] created the discussion

"jaxb version used by JBoss AS 7.0Final (date issue/timezone issue)"

To view the discussion, visit: https://community.jboss.org/message/754884#754884

I seem to be re-encountering an issue in JBoss AS 7.0 that we first encountered in JBoss 5.

A previous developer described the problem thus:

JAXB 2.1.x DatatypeConverter implementation does not correctly apply timezone offset when printing xs:dateTime string representation of a java.util.Date. The complementary method in DatatypeConverter that parses the string representation into a java.util.Date does apply the current timezone offset. The issue has manifested itself now because we are in BST (GMT + 1).

JAXB 2.1.x DatatypeConverter.printDateTime() outputs:


JAXB 2.2.x DatatypeConverter.printDateTime() outputs:


Solution is to ensure that JAXB 2.2.1 version of jaxb-api.jar is present in JBoss server's endorsed library folder for both the web service client jboss instance and the web service 
server instance.

I have replicated the issue with the following client code

            XMLGregorianCalendar cal = null;
            try {
              cal = DatatypeFactory.newInstance()
                    new GregorianCalendar(1970,0,1));
            } catch (DatatypeConfigurationException e) {
              // TODO Auto-generated catch block


service.doSomething( cal )

In the webservice implementation the string received in the SOAP payload is:


Which corresponds to the JAXB 2.1 behaviour .

What I can't fathom is that the modules repository for the JBoss 7.0 only has the JAXB 2.2 implementation.

With JBoss 5.0 we had to put JAXB 2.2 in the endorsed directory (specified via the system property java.endorsed.dirs) .

Do we have to do a similar thing with JBoss 7.0? Why do we have to do this even though the version in the modules repository is JAXB 2.2?

Reply to this message by going to Community

Start a new discussion in JBoss Web Services at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120821/5cfaf7ed/attachment.html 

More information about the jboss-user mailing list