ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <h...@visi.com>
Subject Re: Using JAXB with Ant 1.5.1
Date Fri, 20 Dec 2002 16:02:44 GMT
Hello Steve,

I suggest that you change to use Dominique Devienne's JAXB task.  It
works great under Ant-1.5.1.  I've been using it for a little while
now.

Here is the post where he announced it:
http://marc.theaimsgroup.com/?l=ant-user&m=103730621918507&w=2

Here is where it is posted:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14640

NOTE:
What I have found is that you need to remove xerces and the
xmlparserapis jars from ANT_HOME/lib and just point to the
jaxb-xjc.jar in the "xjcjar" attribute of the <jaxb> task.

Jake

Friday, December 20, 2002, 8:20:06 AM, you wrote:

SS> The JAXB xjc task used to generate classes from an XML Schema works fine
SS> with 1.5, but errors with 1.5.1.  The build.xml and the output are at the
SS> end of this email.  The jar files referred to from the build.xml are from
SS> the JAXB 1.0 beta.  Any simple remedy for this?  Should I pop it into
SS> bugzilla?  The message "Unexpected </xs:restriction> appears at line 17
SS> column 22" is unrelated to anything actually in "antbugConfig.xsd" and I
SS> get the same message for different schemas.

SS> Steve Slatcher


SS> <?xml version="1.0"?>
SS> <project name="antbug" default="jaxb" basedir=".">
SS> <target name="init">
SS>     <property name="src.dir" value="src"/>
SS>     <property name="ext-lib.dir" value="${lib.dir}/ext"/>
SS>     <path id="jaxb.jars">
SS>         <fileset dir="lib/ext/jaxb" includes="*.jar"/>
SS>     </path>
SS> </target>
SS> <target name="jaxb" depends="init">
SS>     <taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask">
SS>         <classpath refid="jaxb.jars"/>
SS>     </taskdef>
SS>     <xjc
SS>      schema="antbugConfig.xsd"
SS>      target="${src.dir}"
SS>      package="com.scientia.antbug.jaxb.config"/>
SS> </target>
SS> <target name="clean" depends="init">
SS>     <delete dir="${src.dir}/com/scientia/antbug/jaxb/config"/>
SS> </target>
SS> </project>


SS> Apache Ant version 1.5.1 compiled on October 2 2002
C:\cvs\ant_bug>>ant
SS> Buildfile: build.xml

SS> init:

SS> jaxb:
SS>       [xjc] Compiling file:/C:/cvs/ant_bug/antbugConfig.xsd
SS>       [xjc] org.xml.sax.SAXParseException: Unexpected </xs:restriction>
SS> appears at line 17 column 22
SS>       [xjc]     at
SS> com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.unexpectedXXX(NGCCRuntimeEx.java
SS> :323)
SS>       [xjc]     at
SS> com.sun.xml.xsom.impl.parser.state.NGCCHandler.unexpectedLeaveElement(NGCCH
SS> andler.java:81)
SS>       [xjc]     at
SS> com.sun.xml.xsom.impl.parser.state.SimpleType_Restriction.leaveElement(Simp
SS> leType_Restriction.java:159)
SS>       [xjc]     at
SS> com.sun.xml.xsom.impl.parser.state.NGCCRuntime.endElement(NGCCRuntime.java:
SS> 250)
SS>       [xjc]     at
SS> org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:595)
SS>       [xjc]     at
SS> org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:595)
SS>       [xjc]     at
SS> org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:595)
SS>       [xjc]     at
SS> org.iso_relax.verifier.impl.VerifierFilterImpl.endElement(Unknown Source)
SS>       [xjc]     at
SS> org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
SS>       [xjc]     at
SS> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
SS> Source)
SS>       [xjc]     at
SS> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispat
SS> cher.dispatch(Unknown Source)
SS>       [xjc]     at
SS> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
SS> Source)
SS>       [xjc]     at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
SS> Source)
SS>       [xjc]     at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
SS> Source)
SS>       [xjc]     at org.apache.xerces.parsers.XMLParser.parse(Unknown
SS> Source)
SS>       [xjc]     at
SS> org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
SS>       [xjc]     at
SS> org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:371)
SS>       [xjc]     at
SS> org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:371)
SS>       [xjc]     at
SS> org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:371)
SS>       [xjc]     at
SS> com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.parseEntity(NGCCRuntimeEx.java:1
SS> 51)
SS>       [xjc]     at
SS> com.sun.xml.xsom.impl.parser.XSOMParser.parse(XSOMParser.java:116)
SS>       [xjc]     at
SS> com.sun.xml.xsom.impl.parser.XSOMParser.parse(XSOMParser.java:113)
SS>       [xjc]     at
SS> com.sun.xml.xsom.impl.parser.XSOMParser.parse(XSOMParser.java:110)
SS>       [xjc]     at
SS> com.sun.xml.xsom.impl.parser.XSOMParser.<init>(XSOMParser.java:87)
SS>       [xjc]     at
SS> com.sun.tools.xjc.Driver.loadXMLSchemaGrammar(Driver.java:476)
SS>       [xjc]     at com.sun.tools.xjc.Driver.loadGrammar(Driver.java:404)
SS>       [xjc]     at com.sun.tools.xjc.XJCTask.execute(XJCTask.java:149)
SS>       [xjc]     at
SS> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:166)
SS>       [xjc]     at org.apache.tools.ant.Task.perform(Task.java:319)
SS>       [xjc]     at org.apache.tools.ant.Target.execute(Target.java:309)
SS>       [xjc]     at
SS> org.apache.tools.ant.Target.performTasks(Target.java:336)
SS>       [xjc]     at
SS> org.apache.tools.ant.Project.executeTarget(Project.java:1306)
SS>       [xjc]     at
SS> org.apache.tools.ant.Project.executeTargets(Project.java:1250)
SS>       [xjc]     at org.apache.tools.ant.Main.runBuild(Main.java:610)
SS>       [xjc]     at org.apache.tools.ant.Main.start(Main.java:196)
SS>       [xjc]     at org.apache.tools.ant.Main.main(Main.java:235)

SS> BUILD FAILED
SS> java.lang.InternalError
SS>         at
SS> com.sun.xml.xsom.impl.parser.XSOMParser.<init>(XSOMParser.java:99)
SS>         at com.sun.tools.xjc.Driver.loadXMLSchemaGrammar(Driver.java:476)
SS>         at com.sun.tools.xjc.Driver.loadGrammar(Driver.java:404)
SS>         at com.sun.tools.xjc.XJCTask.execute(XJCTask.java:149)
SS>         at
SS> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:166)
SS>         at org.apache.tools.ant.Task.perform(Task.java:319)
SS>         at org.apache.tools.ant.Target.execute(Target.java:309)
SS>         at org.apache.tools.ant.Target.performTasks(Target.java:336)
SS>         at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
SS>         at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
SS>         at org.apache.tools.ant.Main.runBuild(Main.java:610)
SS>         at org.apache.tools.ant.Main.start(Main.java:196)
SS>         at org.apache.tools.ant.Main.main(Main.java:235)

SS> Total time: 6 seconds
SS> java.lang.InternalError
SS>         at
SS> com.sun.xml.xsom.impl.parser.XSOMParser.<init>(XSOMParser.java:99)
SS>         at com.sun.tools.xjc.Driver.loadXMLSchemaGrammar(Driver.java:476)
SS>         at com.sun.tools.xjc.Driver.loadGrammar(Driver.java:404)
SS>         at com.sun.tools.xjc.XJCTask.execute(XJCTask.java:149)
SS>         at
SS> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:166)
SS>         at org.apache.tools.ant.Task.perform(Task.java:319)
SS>         at org.apache.tools.ant.Target.execute(Target.java:309)
SS>         at org.apache.tools.ant.Target.performTasks(Target.java:336)
SS>         at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
SS>         at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
SS>         at org.apache.tools.ant.Main.runBuild(Main.java:610)
SS>         at org.apache.tools.ant.Main.start(Main.java:196)
SS>         at org.apache.tools.ant.Main.main(Main.java:235)


SS> --
SS> To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
SS> For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>



-- 
Best regards,
 Jacob                            mailto:hoju@visi.com


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message