History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: CASTOR-2110
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Werner Guttmann
Reporter: Bastian Doetsch
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
castor

Compilation errors in generated Source when using XSD-Types like

Created: 09/Aug/07 09:54 AM   Updated: 14/Mar/08 06:41 AM
Component/s: XML code generator
Affects Version/s: 1.1.2.1
Fix Version/s: 1.2

Time Tracking:
Not Specified

File Attachments: 1. Java Source File LalaDescriptor.java (8 kb)
2. Text File patch.c2110.20070910.txt (0.5 kb)

Environment:
HP-UX xxxxxx B.11.23 U 9000/800

java version "1.5.0.03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0.03-_13_feb_2006_16_39)
Java HotSpot(TM) Server VM (build 1.5.0.03 jinteg:02.13.06-15:51 PA2.0 (aCC_AP), mixed mode)


 Description  « Hide
If using an XSD like the following, the generator of produces Descriptor classes that don't compile.
Message:

Cannot cast from Object to long LalaDescriptor.java line 87

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="Lala">
<xsd:sequence>
<xsd:element name="e1" type="unsignedInt_6"/>
</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="Lala2">
<xsd:complexContent>
<xsd:extension base="Lala">
<xsd:sequence>
<xsd:element name="lala" type="Lala" maxOccurs="99"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>

<xsd:simpleType name="unsignedInt_6">
<!-- einfacher Typ: N (unsignedInt) Laenge: 06 -->
<xsd:restriction base="xsd:unsignedInt">
<xsd:minInclusive value="0"/>
<xsd:maxInclusive value="999999"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Bastian Doetsch - 10/Aug/07 02:48 AM
Addendum: It works with Castor 1.0.5

Werner Guttmann - 09/Sep/07 10:32 AM
Hmm, what does the corresponding class look like when generated with Castor 1.0.5 ?

Werner Guttmann - 09/Sep/07 10:38 AM
I think the problem is related to the fact that XSUnsignedInt.isPrimitive() returns false - which I think is odd at least.

Werner Guttmann - 09/Sep/07 10:51 AM
Changing XSUnsignedInt.isPrimitive() to return 'true' seems to resolve this issue. I still have to make sure that this change is semantically correct, though.

Werner Guttmann - 10/Sep/07 02:44 AM
Final patch for review.

Bastian Doetsch - 10/Sep/07 02:53 AM
Thanks for your work. If I get a patched JAR, I'll test the patch this week . Feel free to contact me personally by E-Mail.

Best regards,
Bastian Doetsch


Werner Guttmann - 10/Sep/07 02:59 AM
How about using a snapshot release of 1.1.3 (assuming that I make one available tonight or tomorrow) ?

Bastian Doetsch - 10/Sep/07 03:05 AM
Sounds good. I'll check the download page tomorrow.

Werner Guttmann - 10/Sep/07 03:18 AM

Bastian Doetsch - 14/Sep/07 04:47 AM
Hm. Couldn't find a new snapshot so far. The last snapshot I see is from 2007-08-30. So could you please provide the exact URL for downloading?

Werner Guttmann - 14/Sep/07 05:04 AM
Sorry, still need to ship one. We are currently resolving a lot of issues .., hence the delay.