FYI:
I had the same problems, the ';' which is causing compilation errors comes
from a wrong 'setInitString(String)' in some FieldInfo object I think,
(don't shoot me if I am wrong)
but I haven't had time to track down the Java code producing this error yet
more specifically: you can generate this by using the enumeration
restriction on an attribute together with the 'default' attribute set, for
example:
<xs:attribute name="digestAlgorithm" default="SHA1">
<xs:simpleType name="digestAlgorithmType">
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="MD2"/>
<xs:enumeration value="MD4"/>
<xs:enumeration value="MD5"/>
<xs:enumeration value="SHA1"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
generates code like this (I left out package names):
private DigestAlgorithmType _digestAlgorithm =
DigestAlgorithmType.valueOf("SHA1");;
and in some classes which take such a field in the constructor you will see
new fooClass(DigestAlgorithmType.valueOf("SHA1"););
so you can guess what is going wrong...
good luck
-----Original Message-----
From: Arnaud Blandin [mailto:[EMAIL PROTECTED]]
Sent: woensdag 10 april 2002 20:46
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] Retrieving earlier version from CVS?
Hi Wein,
Can you send us your whole schema (with the imported schema) it will
help us to track down the bugs.
Thanks,
Arnaud
> -----Original Message-----
> From: Wei Chiang [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 10, 2002 11:01 AM
> To: [EMAIL PROTECTED]
> Subject: [castor-dev] Retrieving earlier version from CVS?
>
> Hi,
>
> I down loaded the source code from the CVS repository about 8 hours
ago.
> One of the xsd files causes the SourceGenerator to crash, although it
was
> OK
> with the earlier version. Also, some of the generated code has an
> erroneous
> ";" inside a pair of "()".
>
> I no longer have the version which works. The official release does
not
> work
> with my schema, since it does not generate inheritance properly. Is
there
> a
> CVS tag that refers to an earlier version of castor? This way I can
> continue
> developing the code while the problem is being looked into.
>
> The output from the SourceGenerator and the related schema are
included
> below.
> The scheme that relates to the erroneous ";" is included at the end.
>
> I'll be grateful if someone can point out the problem areas in the xsd
> files, even though they are OK with the previous versions of castor.
>
> Thank you,
> Wei
>
========================================================================
==
> ==
> ======
>
> Exception in thread "main" java.lang.NullPointerException
> at org.exolab.castor.builder.ClassInfo.getElementField(Unknown
> Source)
> at org.exolab.castor.builder.SourceFactory.handleField(Unknown
> Source)
> at
> org.exolab.castor.builder.SourceFactory.processContentModel(Unknown
> Source)
> at
> org.exolab.castor.builder.SourceFactory.processContentModel(Unknown
> Source)
> at
> org.exolab.castor.builder.SourceFactory.processComplexType(Unknown
Source)
> at
> org.exolab.castor.builder.SourceFactory.createSourceCode(Unknown
> Source)
> at
> org.exolab.castor.builder.SourceGenerator.processComplexType(Unknown
> Source)
> at
org.exolab.castor.builder.SourceGenerator.createClasses(Unknown
> Source)
> at
> org.exolab.castor.builder.SourceGenerator.generateSource(Unknown
> Source)
> at
> org.exolab.castor.builder.SourceGenerator.generateSource(Unknown
> Source)
> at
> org.exolab.castor.builder.SourceGenerator.generateSource(Unknown
> Source)
> at org.exolab.castor.builder.SourceGenerator.main(Unknown
Source)
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema targetNamespace="http://www.coba.org/geometry"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:geo="http://www.coba.org/geometry"
> xmlns:cmn="http://www.coba.org/common" elementFormDefault="qualified"
> attributeFormDefault="unqualified">
> <xs:import namespace="http://www.coba.org/common"
> schemaLocation="./Common.xsd"/>
> <xs:simpleType name="dimension_count">
> <xs:restriction base="xs:integer">
> <xs:minInclusive value="1"/>
> </xs:restriction>
> </xs:simpleType>
> <xs:complexType name="length_measure">
> <xs:sequence>
> <xs:element name="length" type="xs:decimal"
> minOccurs="0"
> maxOccurs="unbounded"/>
> </xs:sequence>
> </xs:complexType>
> <xs:complexType name="geometric_representation_item">
> <xs:complexContent>
> <xs:extension base="cmn:representation_item">
> <xs:attribute name="dimension"
> type="geo:dimension_count"/>
> </xs:extension>
> </xs:complexContent>
> </xs:complexType>
> <xs:complexType name="point">
> <xs:complexContent>
> <xs:extension
base="geo:geometric_representation_item"/>
> </xs:complexContent>
> </xs:complexType>
> <xs:complexType name="cartesian_point">
> <xs:complexContent>
> <xs:extension base="geo:point">
> <xs:sequence>
> <xs:element name="Coordinates"
> type="geo:length_measure"/>
> </xs:sequence>
> </xs:extension>
> </xs:complexContent>
> </xs:complexType>
> <xs:complexType name="placement">
> <xs:complexContent>
> <xs:extension
base="geo:geometric_representation_item">
> <xs:sequence>
> <xs:element
name="PlacementLocation"
> type="geo:cartesian_point"/>
> </xs:sequence>
> </xs:extension>
> </xs:complexContent>
> </xs:complexType>
> </xs:schema>
>
>
========================================================================
==
> ==
> ======
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!-- edited with XML Spy v4.0.1 U (http://www.xmlspy.com) by Wei
Chiang
> (private) -->
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
> <xs:annotation>
> <xs:documentation>XML Schema simpleType Definition of
COBA
> construct
> types.</xs:documentation>
> </xs:annotation>
> <xs:simpleType name="categoriesOfOGEL">
> <xs:annotation>
> <xs:documentation>The kind of OGELs that are
> supported.</xs:documentation>
> </xs:annotation>
> <xs:restriction base="xs:string">
> <xs:enumeration value="ROOM"/>
> <xs:enumeration value="BUILDING"/>
> <xs:enumeration value="ESTATE"/>
> <xs:enumeration value="SPACE"/>
> </xs:restriction>
>
> </xs:simpleType>
>
> </xs:schema>
>
>
> public Building() {
> super();
> >>>>>
>
setCode(org.coba.simpleApp.generated.types.CategoriesOfOGEL.valueOf("BUI
LD
> IN
> G"););
>
> _items = new Vector();
> } //-- org.coba.simpleApp.generated.Building()
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
> unsubscribe castor-dev
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev