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:

"1970-01-01T00:00:00Z"

JAXB 2.2.x DatatypeConverter.printDateTime() outputs:

"1970-01-01T00:00:00+01:00"


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()
                .newXMLGregorianCalendar(
                    new GregorianCalendar(1970,0,1));
            } catch (DatatypeConfigurationException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();

            }







service.doSomething( cal )

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

1970-01-01T00:00:00Z

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
[https://community.jboss.org/message/754884#754884]

Start a new discussion in JBoss Web Services at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044]

_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to