PLEASE PLEASE HELP - Castor porblem
From: Gandu (cpptutor2000_at_yahoo.com)
Date: 01/12/04
- Previous message: Tom Squillante: "J2EE Deploytool thinks WAR file is empty"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 11 Jan 2004 22:16:35 -0800
I am a newbie to Castor. I downloaded all the jar files, made changes
to the classpath etc, but I keep on getting exceptions being thrown.
The XML schema file is as follows:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="catalog">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="book" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="author" type="xsd:string"/>
<xsd:element name="title" type="xsd:string"/>
<xsd:element name="genre" type="xsd:string"/>
<xsd:element name="price" type="xsd:float"/>
<xsd:element name="publish_date" type="xsd:date"/>
<xsd:element name="description" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
If I type in:
C:\>java org.exolab.castor.builder.SourceGenerator -i
C:\\Temp\\Test.xsd
I get the error message:
Exception in thread "main" java.lang.IllegalArgumentException: The
prefix 'xml' is reserved (XML 1.0 Specification) and cannot be
declared.
at org.exolab.castor.xml.Namespaces.addNamespace(Namespaces.java:130)
at org.exolab.castor.xml.UnmarshalHandler.startPrefixMapping(UnmarshalHandler.java:1953)
at org.apache.xerces.parsers.AbstractSAXParser.startNamespaceMapping(Unknown
Source)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown
Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown
Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.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.xml.Unmarshaller.unmarshal(Unmarshaller.java:583)
at org.exolab.castor.mapping.Mapping.loadMappingInternal(Mapping.java:515)
at org.exolab.castor.mapping.Mapping.loadMapping(Mapping.java:441)
at org.exolab.castor.xml.schema.SimpleTypesFactory.loadTypesDefinitions(SimpleTypesFactory.java:414)
at org.exolab.castor.xml.schema.SimpleTypesFactory.getType(SimpleTypesFactory.java:380)
at org.exolab.castor.xml.schema.SimpleTypesFactory.getBuiltInType(SimpleTypesFactory.java:202)
at org.exolab.castor.xml.schema.Schema.getSimpleType(Schema.java:919)
at org.exolab.castor.xml.schema.Schema.getSimpleType(Schema.java:858)
at org.exolab.castor.xml.schema.TypeReference.resolveTypeReference(TypeReference.java:113)
at org.exolab.castor.xml.schema.TypeReference.getType(TypeReference.java:69)
at org.exolab.castor.xml.schema.ElementDecl.getType(ElementDecl.java:327)
at org.exolab.castor.xml.schema.ElementDecl.validate(ElementDecl.java:743)
at org.exolab.castor.xml.schema.Group.validate(Group.java:471)
at org.exolab.castor.xml.schema.ComplexType.validate(ComplexType.java:795)
at org.exolab.castor.xml.schema.ElementDecl.validate(ElementDecl.java:748)
at org.exolab.castor.xml.schema.Group.validate(Group.java:471)
at org.exolab.castor.xml.schema.ComplexType.validate(ComplexType.java:795)
at org.exolab.castor.xml.schema.ElementDecl.validate(ElementDecl.java:748)
at org.exolab.castor.xml.schema.Schema.validate(Schema.java:1466)
at org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.java:312)
at org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.java:394)
at org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.java:425)
at org.exolab.castor.builder.SourceGenerator.main(SourceGenerator.java:760)
Any help would be greatly appreciated. Thanks in advance for your
help.
- Previous message: Tom Squillante: "J2EE Deploytool thinks WAR file is empty"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|