[relaxng-user] date datatype, w3c, java, aargh
George Cristian Bina
george at oxygenxml.com
Tue Jan 18 10:35:44 ICT 2005
Hi,
Here there are more details about the problem. The exception trace is:
java.lang.IllegalArgumentException: HOUR_OF_DAY
at java.util.GregorianCalendar.computeTime(Unknown Source)
at java.util.Calendar.updateTime(Unknown Source)
at java.util.Calendar.getTimeInMillis(Unknown Source)
at java.util.Calendar.getTime(Unknown Source)
at
com.thaiopensource.datatype.xsd.DateTimeDatatype.createDate(DateTimeDatatype.java:260)
at
com.thaiopensource.datatype.xsd.DateTimeDatatype.getValue(DateTimeDatatype.java:195)
at
com.thaiopensource.datatype.xsd.DateTimeDatatype.allowsValue(DateTimeDatatype.java:70)
at
com.thaiopensource.datatype.xsd.DateTimeDatatype.isValid(DateTimeDatatype.java:40)
at
com.thaiopensource.relaxng.impl.DataDerivFunction.caseData(DataDerivFunction.java:82)
at
com.thaiopensource.relaxng.impl.DataPattern.apply(DataPattern.java:25)
at
com.thaiopensource.relaxng.impl.Pattern.applyForPattern(Pattern.java:97)
at
com.thaiopensource.relaxng.impl.DataDerivType.dataDeriv(DataDerivType.java:9)
at
com.thaiopensource.relaxng.impl.DataDataDerivType.dataDeriv(DataDataDerivType.java:23)
at
com.thaiopensource.relaxng.impl.PatternMemo.dataDeriv(PatternMemo.java:182)
at
com.thaiopensource.relaxng.impl.DataDerivFunction.memoApply(DataDerivFunction.java:133)
at
com.thaiopensource.relaxng.impl.DataDerivFunction.caseAfter(DataDerivFunction.java:97)
at
com.thaiopensource.relaxng.impl.AfterPattern.apply(AfterPattern.java:17)
at
com.thaiopensource.relaxng.impl.Pattern.applyForPattern(Pattern.java:97)
at
com.thaiopensource.relaxng.impl.DataDerivType.dataDeriv(DataDerivType.java:9)
at
com.thaiopensource.relaxng.impl.DataDataDerivType.dataDeriv(DataDataDerivType.java:23)
at
com.thaiopensource.relaxng.impl.PatternMemo.dataDeriv(PatternMemo.java:182)
The line numbers may be a little different as I added a couple of debug
lines in the code to figure out what happens.
Commenting the following lines in the DateTimeDatatype.createDate method:
// Using a time zone of "GMT+XX:YY" doesn't work with JDK 1.1, so we
have to do it like this.
cal.set(Calendar.ZONE_OFFSET, tzOffset);
cal.set(Calendar.DST_OFFSET, 0);
makes the date datatype work with Java 1.5 but I do not know if this is
the right fix for this problem.
Hope that helps,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Sebastian Rahtz wrote:
> George Cristian Bina wrote:
>
>>
>> We run into this problem last Friday and I traced it down.
>> The implementation the the GregorianCalendar class was changed in Java
>> 1.5. Deep down Jing gets an IllegalArgumentException with the message
>> HOUR_OF_DAY (or something like that) in the GregorianCalendar class
>> and that causes the date datatype not to work.
>> The best thing is to stay with Java 1.4 for now. As soon as I will get
>> in the office I can send more details about the exact part of the code
>> that has this problem if that helps.
>>
> thanks very much! I am glad to know it really is a broken bit of Java,
> thats makes life easier.
>
More information about the relaxng-user
mailing list