ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Slatcher" <steve_slatc...@scientia.com>
Subject Using JAXB with Ant 1.5.1
Date Fri, 20 Dec 2002 14:20:06 GMT
The JAXB xjc task used to generate classes from an XML Schema works fine
with 1.5, but errors with 1.5.1.  The build.xml and the output are at the
end of this email.  The jar files referred to from the build.xml are from
the JAXB 1.0 beta.  Any simple remedy for this?  Should I pop it into
bugzilla?  The message "Unexpected </xs:restriction> appears at line 17
column 22" is unrelated to anything actually in "antbugConfig.xsd" and I
get the same message for different schemas.

Steve Slatcher


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


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

init:

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

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

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


--
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