[jboss-jira] [JBoss JIRA] Commented: (JBXB-99) parseDate fails to parse the time zone specifier
Alexey Loubyansky (JIRA)
jira-events at lists.jboss.org
Tue Apr 3 05:31:58 EDT 2007
[ http://jira.jboss.com/jira/browse/JBXB-99?page=comments#action_12358177 ]
Alexey Loubyansky commented on JBXB-99:
---------------------------------------
I misunderstood... The timezone is not the problem. The problem is the format. "Date value does not follow the format '-'? yyyy '-' mm '-' dd: 6-06-01-05:00" It expects 4 digits for the year.
> parseDate fails to parse the time zone specifier
> -------------------------------------------------
>
> Key: JBXB-99
> URL: http://jira.jboss.com/jira/browse/JBXB-99
> Project: JBoss XML Binding (JBossXB)
> Issue Type: Bug
> Affects Versions: JBossXB-1.0.0.CR9
> Environment: com/sun/ts/tests/jaxrpc/ee/wsi/rpc/literal/marshalltest/Client.java#MarshallDateTimeTest
> com/sun/ts/tests/jaxrpc/ee/wsi/document/literal/marshalltest/Client.java#MarshallDateTimeTest
> Reporter: Thomas Diesler
> Priority: Critical
>
> /**
> * [-]yyyy-mm-dd
> *
> * @param value string date value
> * @return equivalent date as an instance of java.util.Calendar.
> */
> public static String marshalDate(Calendar value)
> {
> String result = String.valueOf(value.get(Calendar.YEAR));
> result += '-';
> result += marshalInt(value.get(Calendar.MONTH) + 1, 2);
> result += '-';
> result += marshalInt(value.get(Calendar.DAY_OF_MONTH), 2);
> result += marshalTimeZone(value);
> return result;
> }
> Given these CTS calendars
> public final static GregorianCalendar GregorianCalendar_data[] = {
> new GregorianCalendar(6,5,1,10,0,0),
> new GregorianCalendar(9,10,25,1,30,0),
> new GregorianCalendar(96,5,1,2,0,30),
> new GregorianCalendar(99,10,25,3,15,15),
> new GregorianCalendar(996,5,1,6,6,6),
> new GregorianCalendar(999,10,25,7,7,7),
> new GregorianCalendar(1996,5,1,8,8,8),
> new GregorianCalendar(1999,10,25,9,9,9),
> null
> };
> jbossxb generates a string that cannot be parsed on the server side
> 12:12:36,027 ERROR [SOAPFaultHelperJAXRPC] SOAP request exception
> org.jboss.xb.binding.JBossXBValueFormatException: Date value does not follow the format '-'? yyyy '-' mm '-' dd: 6-06-01-05:00
> at org.jboss.xb.binding.SimpleTypeBindings.parseDate(SimpleTypeBindings.java:2088)
> at org.jboss.xb.binding.SimpleTypeBindings.unmarshalDate(SimpleTypeBindings.java:1701)
> at org.jboss.ws.core.jaxrpc.binding.CalendarDeserializer.deserialize(CalendarDeserializer.java:61)
> at org.jboss.ws.core.jaxrpc.binding.CalendarDeserializer.deserialize(CalendarDeserializer.java:47)
> at org.jboss.ws.core.soap.XMLContent.unmarshallObjectContents(XMLContent.java:175)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list