Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Ant Problem - XJCTask Extension Attribute

843834Jun 14 2003 — edited Nov 11 2005
Hi

I am using JAXB to compile an xsd file that uses substitution groups. The problem "goes away" when compiling from the command line using the jxc -extension option.

Using XJCTask with the extension attribute - see the following snippit:
<taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask">
<classpath refid="classpath"/>
</taskdef>

<target name="xjc" description="Compiles the FpML schema." >
<echo message="Compiling the FpML schema into Java."/>

<!-- set extension to ignore substitution groups -->
<xjc extension="true"/>

<mkdir dir="classes"/>
<xjc target="classes">
<schema dir="xml" includes="*.xsd"/>
<binding dir="." includes="fpml.xjb"/>
<produces dir="." includes="classes/org/fpml/*.java"/>
</xjc>
</target>

Gives an error:
C:\jwsdp-1.2\jaxb\samples\FpML>ant xjc
Buildfile: build.xml

xjc:
[echo] Compiling the FpML schema into Java.

BUILD FAILED
file:C:/jwsdp-1.2/jaxb/samples/FpML/build.xml:101: grammar is not specified

Thanks for any help.

Tom Burns
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 9 2005
Added on Jun 14 2003
3 comments
483 views