Just tried it, here is the stack trace:
C:\Projects\test>ant
RUNNING MODIFIED ANT BATCH FILE!
Buildfile: build.xml
schema-compile:
[xjc] Compiling file:/C:/Projects/test/xsd/test.xsd
[xjc] [WARNING] warning: <anyAttribute> ignored
[xjc] line 47 of
[xjc] [WARNING] warning: <anyAttribute> ignored
[xjc] line 55 of
[xjc] [WARNING] warning: <anyAttribute> ignored
[xjc] line 63 of
[xjc] [WARNING] warning: "final" attribute of <complexType> is not
support
ed
[xjc] line 98 of
[xjc] [WARNING] warning: <anyAttribute> ignored
[xjc] line 116 of
[xjc] [WARNING] warning: <anyAttribute> ignored
[xjc] line 26 of test.xsd
BUILD FAILED
java.lang.NullPointerException
at
com.sun.tools.xjc.reader.xmlschema.BGMBuilder._getBindInfoReadOnly(BG
MBuilder.java:392)
at
com.sun.tools.xjc.reader.xmlschema.BGMBuilder.getOrCreateBindInfo(BGM
Builder.java:349)
at
com.sun.tools.xjc.reader.xmlschema.bindinfo.BIGlobalBinding.dispatchG
lobalConversions(BIGlobalBinding.java:193)
at
com.sun.tools.xjc.reader.xmlschema.BGMBuilder.promoteGlobalBindings(B
GMBuilder.java:172)
at
com.sun.tools.xjc.reader.xmlschema.BGMBuilder.<init>(BGMBuilder.java:
326)
at
com.sun.tools.xjc.reader.xmlschema.BGMBuilder.build(BGMBuilder.java:8
0)
at
com.sun.tools.xjc.GrammarLoader.annotateXMLSchema(GrammarLoader.java:
424)
at com.sun.tools.xjc.GrammarLoader.load(GrammarLoader.java:130)
at com.sun.tools.xjc.GrammarLoader.load(GrammarLoader.java:79)
at com.sun.tools.xjc.XJCTask._doXJC(XJCTask.java:331)
at com.sun.tools.xjc.XJCTask.doXJC(XJCTask.java:283)
at com.sun.tools.xjc.XJCTask.execute(XJCTask.java:227)
at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:193)
at org.apache.tools.ant.Task.perform(Task.java:341)
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:1339)
at
org.apache.tools.ant.Project.executeTargets(Project.java:1255)
at org.apache.tools.ant.Main.runBuild(Main.java:609)
at org.apache.tools.ant.Main.start(Main.java:196)
at org.apache.tools.ant.Main.main(Main.java:235)
Total time: 12 seconds
java.lang.NullPointerException
at
com.sun.tools.xjc.reader.xmlschema.BGMBuilder._getBindInfoReadOnly(BG
MBuilder.java:392)
at
com.sun.tools.xjc.reader.xmlschema.BGMBuilder.getOrCreateBindInfo(BGM
Builder.java:349)
at
com.sun.tools.xjc.reader.xmlschema.bindinfo.BIGlobalBinding.dispatchG
lobalConversions(BIGlobalBinding.java:193)
at
com.sun.tools.xjc.reader.xmlschema.BGMBuilder.promoteGlobalBindings(B
GMBuilder.java:172)
at
com.sun.tools.xjc.reader.xmlschema.BGMBuilder.<init>(BGMBuilder.java:
326)
at
com.sun.tools.xjc.reader.xmlschema.BGMBuilder.build(BGMBuilder.java:8
0)
at
com.sun.tools.xjc.GrammarLoader.annotateXMLSchema(GrammarLoader.java:
424)
at com.sun.tools.xjc.GrammarLoader.load(GrammarLoader.java:130)
at com.sun.tools.xjc.GrammarLoader.load(GrammarLoader.java:79)
at com.sun.tools.xjc.XJCTask._doXJC(XJCTask.java:331)
at com.sun.tools.xjc.XJCTask.doXJC(XJCTask.java:283)
at com.sun.tools.xjc.XJCTask.execute(XJCTask.java:227)
at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:193)
at org.apache.tools.ant.Task.perform(Task.java:341)
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:1339)
at
org.apache.tools.ant.Project.executeTargets(Project.java:1255)
at org.apache.tools.ant.Main.runBuild(Main.java:609)
at org.apache.tools.ant.Main.start(Main.java:196)
at org.apache.tools.ant.Main.main(Main.java:235)
ERRORLEVEL=1
C:\Projects\test>
-----Original Message-----
From: Kohsuke Kawaguchi [mailto:Kohsuke.Kawaguchi_at_Sun.COM]
Sent: Monday, December 15, 2003 2:29 PM
To: users_at_jaxb.dev.java.net
Subject: Re: <PING> Specified globalBinding customization not used error
when compiling XJC
Not reporting an error is a bug of the RI, but you just need to have
<globalBindings> in the right place. Try this:
<?xml version="1.0"?>
<jxb:bindings version="1.0" xmlns:jxb="
http://java.sun.com/xml/ns/jaxb"
xmlns:soap="
http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xs="
http://www.w3.org/2001/XMLSchema">
<jxb:bindings
schemaLocation="
http://schemas.xmlsoap.org/soap/envelope/"
node="/xs:schema">
<jxb:schemaBindings>
<jxb:package name="com.mytest.schema.soap"/>
<jxb:nameXmlTransform>
<jxb:elementName suffix="Element"/>
</jxb:nameXmlTransform>
</jxb:schemaBindings>
<jxb:globalBindings>
<jxb:javaType name="javax.xml.soap.SOAPEnvelope"
xmlType="soap:Envelope" parseMethod="java.lang.String.endsWith"
printMethod="java.lang.String.concat"/>
<jxb:javaType name="java.lang.String" xmlType="xs:anyURI"
parseMethod="java.lang.String.endsWith"
printMethod="java.lang.String.concat"/>
</jxb:globalBindings>
</jxb:bindings>
<!-- UPDATE WITH YOUR PATH -->
<jxb:bindings schemaLocation="file:/C:/Projects/test/xsd/test.xsd"
node="/xs:schema">
<jxb:schemaBindings>
<jxb:package name="com.mytest.schema.test"/>
<jxb:nameXmlTransform>
<jxb:elementName suffix="Element"/>
</jxb:nameXmlTransform>
</jxb:schemaBindings>
</jxb:bindings>
</jxb:bindings>
regards,
--
Kohsuke Kawaguchi
Sun Microsystems kohsuke.kawaguchi_at_sun.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net