Yes I have looked into the naming collisions, but I'm new to castor and
it is fairly complex so don't take my word for it. I will file a
bugreport, trying to narrow it down a bit. This will also include the
bindings file.
Regards,
Peter
On 06/04/2012 12:40 PM, Werner Guttmann wrote:
Hi Peter,
I'd need to look into this in more detail. Can I ask you to create a
Jira issue and attach an absolute minimalistic XML schema set that
allows me to replay your problem. Please refrain from attaching all XML
schemas, as I am not in a position to cross-check things when there's
literally hundreds of entities generated.
Kind Regards
Werner
PS Can I take it that you have read up on naming collisions with
Castor's code generator ?
On 28.05.2012 13:34, Peter Follo wrote:
I'm trying to generate code for CityGML version 1.0 with the following
command:
$ java org.exolab.castor.builder.SourceGeneratorMain -verbose -dest src
-binding-file binding.xml -generateImportedSchemas -is
http://schemas.opengis.net/citygml/profiles/base/1.0/CityGML.xsd
and it fails with the following warning and a null pointer exception:
$ - Imported XML Schemas will be processed automatically.
$ May 28, 2012 1:02:30 PM
org.exolab.castor.xml.schema.SimpleTypesFactory createUserSimpleType
$ WARNING: Error: could not find the built in parent type for:
MeasureOrNullListType
I have tried this with version 1.2, 1.3 and a subversion checkout from
20120528 with the same output. I have narrowed it down to the included
xml schema http://schemas.opengis.net/gml/3.1.1/base/valueObjects.xsd
which gives the following stack trace:
$ -- Imported XML Schemas will be processed automatically.
$ May 28, 2012 1:09:10 PM
org.exolab.castor.xml.schema.SimpleTypesFactory createUserSimpleType
$ WARNING: Error: could not find the built in parent type for:
MeasureOrNullListType
$ java.lang.NullPointerException
$ at
org.exolab.castor.xml.schema.reader.SimpleTypeDefinition.createSimpleType(SimpleTypeDefinition.java:141)
$ at
org.exolab.castor.xml.schema.reader.SimpleContentRestrictionUnmarshaller.finish(SimpleContentRestrictionUnmarshaller.java:415)
$ at
org.exolab.castor.xml.schema.reader.SimpleContentUnmarshaller.endElement(SimpleContentUnmarshaller.java:224)
$ at
org.exolab.castor.xml.schema.reader.ComplexTypeUnmarshaller.endElement(ComplexTypeUnmarshaller.java:466)
$ at
org.exolab.castor.xml.schema.reader.SchemaUnmarshaller.endElement(SchemaUnmarshaller.java:666)
$ at
org.exolab.castor.xml.schema.reader.Sax2ComponentReader.endElement(Sax2ComponentReader.java:202)
$ at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:598)
$ at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1741)
$ at
$
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2898)
$ at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607)
$ at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488)
$ at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835)
$ at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
$ at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
$ at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210)
$ at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568)
$ at
org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.java:676)
$ at
org.exolab.castor.builder.SourceGeneratorMain.main(SourceGeneratorMain.java:334)
The type MeasureOrNullListType is defined in
http://schemas.opengis.net/gml/3.1.1/base/basicTypes.xsd which is
included in the schema above. Generating sources from basicTypes.xsd
gives the following output without errors but with some warnings:
$ -- Imported XML Schemas will be processed automatically.
$ Creating classes for: MeasureListType
$ Creating classes for: MeasureOrNullListType
$ Creating classes for: CodeOrNullListType
$ Creating classes for: CodeListType
$ May 28, 2012 1:13:33 PM org.exolab.castor.builder.TypeConversion
convertType
$ WARNING: Warning: The W3C datatype 'NameList' is not currently
supported by Castor Source Generator.
$ May 28, 2012 1:13:33 PM org.exolab.castor.builder.TypeConversion
convertType
$ WARNING: Warning: The W3C datatype 'Name' is not currently supported
by Castor Source Generator.
$ Creating classes for: CoordinatesType
$ Creating classes for: CodeType
$ Creating classes for: MeasureType
$ added manifest
$ adding: src/se/foi/CityGML10/CodeListType.class(in = 1361) (out=
737)(deflated 45%)
$ adding: src/se/foi/CityGML10/CodeOrNullListType.class(in = 1297) (out=
728)(deflated 43%)
$ adding: src/se/foi/CityGML10/CodeType.class(in = 1277) (out=
719)(deflated 43%)
$ adding: src/se/foi/CityGML10/CoordinatesType.class(in = 1686) (out=
881)(deflated 47%)
$ adding: src/se/foi/CityGML10/MeasureListType.class(in = 1516) (out=
839)(deflated 44%)
$ adding: src/se/foi/CityGML10/MeasureOrNullListType.class(in = 1285)
(out= 728)(deflated 43%)
$ adding: src/se/foi/CityGML10/MeasureType.class(in = 1508) (out=
832)(deflated 44%)
I can't figure out how to deal with this, should I add some
customizations in the binding file? Is it a bug (in castor?/in the
schemas?), and if so is it a known one with a workaround? Ideas anyone?
Just for the record, I have successfully generated sources, compiled
them to a library and performed marshalling and un-marshaling with
Oracle's JAXB and Apache's Xmlbeans so I guess the problem is not only
in the layout of the xml schema(s).
Regards.
Peter
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email