Based on your example schema it looks like you are having a default namespace crisis.
You'll need to prefix "IDType" with "ns1", as such "ns1:IDType". Or you can change the default namespace to "http://multschema1.com" and declare a prefix for the XML Schema namespace as such: <xsd:schema targetNamespace="http://www.multschema1.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.multschema1.com/"> <xsd:simpleType name="IDType"> <xsd:restriction base="xsd:string"/> </xsd:simpleType> </xsd:schema> The fact that it worked before in version 0.9.3.9, is probably a bug in that version. --Keith Tahura Chaudhry wrote: > > I've been using castor for the last few months to generate Java source from > schema files. I recently updated to the latest release version Castor > 0.9.3.19 . Surprisingly the source generator failed to generate the source > files for the schemas. I have not modified the schema files and suspect that > this may be due to recent code fixes or enhancements to Castor. I have > attached below the two sample schemas the error messages as outputted by the > source generator. Can someone please tell me why this may be happening and > if there is a workaround. Thanks. > > ------------------- > SCHEMA FILE 1:: > <schema targetNamespace="http://www.multschema1.com/" > xmlns="http://www.w3.org/2001/XMLSchema" > xmlns:ns1="http://www.multschema1.com/"> > <simpleType name="IDType"> > <restriction base="string" /> > </simpleType> > </schema> > > SCHEMA FILE 2:: > <schema targetNamespace="http://www.multschema2.com/" > xmlns="http://www.w3.org/2001/XMLSchema" > xmlns:ns1="http://www.multschema1.com/" > xmlns:ns2="http://www.multschema2.com/"> > <import namespace="http://www.multschema1.com/" > schemaLocation="multSchema1.xsd" /> > <element name="someElement" type="ns2:someElementType"/> > <complexType name="someElementType"> > <attribute name="ID" type="ns1:IDType" use="required" /> > </complexType> > </schema> > > ERROR :: > -- Suppressing non fatal warnings. > > Warning: Do not forget to generate source code for the following imported > schema: d:/schemas/others/multSchema1.xsd > Exception in thread "main" java.lang.IllegalArgumentException: > getSimpleType: the simple type 'IDType' is not a built-in t > ype as defined in XML Schema specification. > at > org.exolab.castor.xml.schema.Schema.getSimpleType(Schema.java:838) > at > org.exolab.castor.xml.schema.Schema.getSimpleType(Schema.java:859) > at > org.exolab.castor.xml.schema.SimpleTypeReference.resolveTypeReference(Simple > TypeReference.java:102) > at > org.exolab.castor.xml.schema.SimpleTypeReference.getType(SimpleTypeReference > .java:92) > at > org.exolab.castor.xml.schema.AttributeDecl.getSimpleType(AttributeDecl.java: > 223) > at > org.exolab.castor.builder.SourceFactory.processAttributes(SourceFactory.java > , Compiled Code) > at > org.exolab.castor.builder.SourceFactory.processComplexType(SourceFactory.jav > a:1355) > at > org.exolab.castor.builder.SourceFactory.createSourceCode(SourceFactory.java: > 444) > at > org.exolab.castor.builder.SourceGenerator.processComplexType(SourceGenerator > .java, Compiled Code) > at > org.exolab.castor.builder.SourceGenerator.createClasses(SourceGenerator.java > , Compiled Code) > at > org.exolab.castor.builder.SourceGenerator.createClasses(SourceGenerator.java > , Compiled Code) > at > org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.jav > a:366) > at > org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.jav > a:424) > at > org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.jav > a:453) > at > org.exolab.castor.builder.SourceGenerator.main(SourceGenerator.java:696) > > > > >----------------------------------------------------------------------------------------------------------------- > The information contained in this message is confidential and is intended > for the addressee(s) only. If you have received this message in error or > there are any problems please notify the originator immediately. The > unauthorised use, disclosure, copying or alteration of this message is > strictly forbidden. Baltimore Technologies plc will not be liable for > direct, special, indirect or consequential damages arising from alteration of the > contents of this message by a third party or as a result of any virus being > passed on. > > This footnote confirms that this email message has been swept for Content Security >threats, including > computer viruses. > > http://www.baltimore.com > > > This footnote confirms that this email message has been swept by > Baltimore MIMEsweeper for Content Security threats, including > computer viruses. > > ----------------------------------------------------------- > 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
