Hi Sean,
It might be easier to run the source generator without ant to help track
down the issue/bug. Just run the source generator from the command line
as such:
java org.exolab.castor.builder.SourceGenerator -i my.xsd
Hope that helps,
--Keith
Sean LeBlanc wrote:
Hello, I'm trying to generate classes from a schema file. However, I'm
getting a NullPointerException (included below). I tried turning on
debugging in the castor.properties file, but the information being printed
out is not helping me find what line is actually causing the problem. Is
there a better way to trace this?
Another problem I seem to be having involves the Ant task: I had to finally
give up and unbundle the jar and re-bundle it to set the debug property to
true. I was trying to set classpathref to a class path def that pointed to
where I had the jar extracted to, and it still wasn't finding the class.
I'm sure I must be overlooking something dumb. Here is the relevant error
and config:
C:\MenuTemplate\build.xml:16: taskdef A class needed by class
org.exolab.castor.tools.ant.taskdefs.CastorSourceGenTask cannot be found:
org/exolab/castor/builder/SourceGenerator
<target name="castor-gen-src"
description="Generate Java source files from XSD.">
<path id="castor.class.path">
<!-- I've tried including **/*.class here but it still doesn't work. -->
<fileset dir="c:/tools/castor"/>
</path>
<taskdef name="castor-srcgen"
classname="org.exolab.castor.tools.ant.taskdefs.CastorSourceGenTask"
classpathref="castor.class.path"/>
[castor-srcgen] Error: could not find the built in parent type for:
anonymous-simple-type
BUILD FAILED
C:\MenuTemplate\build.xml:24: java.lang.NullPointerException
at org.apache.tools.ant.Task.perform(Task.java:373)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Caused by: java.lang.NullPointerException
at
org.exolab.castor.xml.schema.reader.SimpleTypeDefinition.createSimpleType(SimpleTypeDefinition.java:141)
at
org.exolab.castor.xml.schema.reader.SimpleTypeUnmarshaller.getSimpleType(SimpleTypeUnmarshaller.java:162)
at
org.exolab.castor.xml.schema.reader.AttributeUnmarshaller.endElement(AttributeUnmarshaller.java:277)
at
org.exolab.castor.xml.schema.reader.ComplexTypeUnmarshaller.endElement(ComplexTypeUnmarshaller.java:421)
at
org.exolab.castor.xml.schema.reader.ElementUnmarshaller.endElement(ElementUnmarshaller.java:370)
at
org.exolab.castor.xml.schema.reader.SchemaUnmarshaller.endElement(SchemaUnmarshaller.java:580)
at
org.exolab.castor.xml.schema.reader.Sax2ComponentReader.endElement(Sax2ComponentReader.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$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.tools.ant.taskdefs.CastorSourceGenTask$CastorSourceGenerator.generateSource(CastorSourceGenTask.java:367)
at
org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.java:485)
at
org.exolab.castor.tools.ant.taskdefs.CastorSourceGenTask.processFile(CastorSourceGenTask.java:274)
at
org.exolab.castor.tools.ant.taskdefs.CastorSourceGenTask.execute(CastorSourceGenTask.java:297)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:
[EMAIL PROTECTED]
-------------------------------------------------