I have some additional information.  The main xml file includes 2 other
schema files, I discovered that when one of the schema files is included, it
causes the npe to occur.  I am including it here in this email.

This is the xml that gets included and causes the npe when I run the
sourcegenerator on the main xsd.

Thank you in advance for any help.

Peggy.

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
elementFormDefault="qualified">
        <xs:simpleType name="DateEmptyAllowed">
                <xs:union>
                        <xs:simpleType>
                                <xs:restriction base="xs:date">
                                </xs:restriction>
                        </xs:simpleType>
                        <xs:simpleType>
                                <xs:restriction base="xs:token">
                                        <xs:enumeration value=""/>
                                </xs:restriction>
                        </xs:simpleType>
                </xs:union>
        </xs:simpleType>
        <xs:simpleType name="PhoneEmptyAllowed">
                <xs:union>
                        <xs:simpleType>
                                <xs:restriction base="xs:string">
                                        <xs:pattern value="[0-9]{10}"/>
                                </xs:restriction>
                        </xs:simpleType>
                        <xs:simpleType>
                                <xs:restriction base="xs:token">
                                        <xs:enumeration value=""/>
                                </xs:restriction>
                        </xs:simpleType>
                </xs:union>
        </xs:simpleType>
        <xs:simpleType name="DecimalEmptyAllowed">
                <xs:union>
                        <xs:simpleType>
                                <xs:restriction base="xs:decimal">
                                </xs:restriction>
                        </xs:simpleType>
                        <xs:simpleType>
                                <xs:restriction base="xs:token">
                                        <xs:enumeration value=""/>
                                </xs:restriction>
                        </xs:simpleType>
                </xs:union>
        </xs:simpleType>
</xs:schema>

Part of the main xml file

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- edited by Larry Karpov (AutoTec, LLC) -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
elementFormDefault="qualified">
<xs:include schemaLocation="EmptyAllowed.xsd"/>
        <xs:element name="AddressLine">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="80"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="AddressLine1">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="40"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="AddressLine2">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="40"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="AddressType">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="32"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="Boat">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:enumeration value="Y"/>
                                <xs:enumeration value="N"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="BoatLicenseInfo" type="LicenseInformation">
        </xs:element>
        <xs:element name="BondExpirationDate">
                <xs:simpleType>
                        <xs:restriction base="DateEmptyAllowed">
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="BondNumber">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="16"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
</xs:schema>

-----Original Message-----
From: Davidson, Peggy (MAN-Corporate)
To: '[email protected]'
Sent: 8/5/2005 7:20 PM
Subject: RE: SimpleType NullPointerException

Hi, I need some help and did not see any clues to resolve my problem in
the mail list.  When using SourceGenerator (castor-0.9.7.jar,
xerces-2.4.0, jdk1.4.2_06) I am getting a npe on the SimpleType. Below
is the exception dump.  Here is a snippet of the xml. Any help would be
appreciated, if you need the full attachment please let me know.

Thank you in advance

Peggy

        <xs:element name="AddressLine">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="80"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="AddressLine1">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="40"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="AddressLine2">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="40"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="AddressType">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="32"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="Boat">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:enumeration value="Y"/>
                                <xs:enumeration value="N"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="BoatLicenseInfo" type="LicenseInformation">
        </xs:element>
        <xs:element name="BondExpirationDate">
                <xs:simpleType>
                        <xs:restriction base="DateEmptyAllowed">
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="BondNumber">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="16"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>

This is the main file
<xs:include schemaLocation="EmptyAllowed.xsd"/>
        <xs:element name="AddressLine">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="80"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="AddressLine1">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="40"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="AddressLine2">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="40"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="AddressType">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="32"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="Boat">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:enumeration value="Y"/>
                                <xs:enumeration value="N"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="BoatLicenseInfo" type="LicenseInformation">
        </xs:element>
        <xs:element name="BondExpirationDate">
                <xs:simpleType>
                        <xs:restriction base="DateEmptyAllowed">
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="BondNumber">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="16"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
</xs:schema>


C:\ProjectsWebTier\AuctionAccess\src\java>java -classpath
castor-0.9.7.jar;commo
ns-logging-1.0.4.jar;xerces-2.4.0.jar
org.exolab.castor.builder.SourceGenerator
setVerbose=true -i com\manheim\message\xsd\Dealer.xsd -package
com.manheim.messa
ge.schemas.dealer
Error: could not find the built in parent type for:
anonymous-simple-type
java.lang.NullPointerException
        at
org.exolab.castor.xml.schema.reader.SimpleTypeDefinition.createSimple
Type(SimpleTypeDefinition.java:141)
        at
org.exolab.castor.xml.schema.reader.SimpleTypeUnmarshaller.getSimpleT
ype(SimpleTypeUnmarshaller.java:162)
        at
org.exolab.castor.xml.schema.reader.ElementUnmarshaller.endElement(El
ementUnmarshaller.java:400)
        at
org.exolab.castor.xml.schema.reader.SchemaUnmarshaller.endElement(Sch
emaUnmarshaller.java:580)
        at
org.exolab.castor.xml.schema.reader.Sax2ComponentReader.endElement(Sa
x2ComponentReader.java:198)
        at
org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source
)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(
Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent
Dispatcher.dispatch(Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un
known Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
        at
org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenera
tor.java:430)
        at
org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenera
tor.java:485)
        at
org.exolab.castor.builder.SourceGenerator.main(SourceGenerator.java:8
65)

-------------------------------------------------
If you wish to unsubscribe from this list, please 
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to