> I was successful in upgrading our system from JAXB 1 to JAXB 2 except
a
> minor problem. I was able to compile schemas using JAXB 1 and was able
> to parse documents successfully. Same schemas are not getting compiled
> properly with JAXB2; JAXB2 is complaining about duplicate elements as
> indicated below.
> Hmm. I suspect the following might work for you:
>
http://weblogs.java.net/blog/kohsuke/archive/2006/03/simple_and_bett.htm
l
I tried this with jaxb-ri-20060426 (2.0 RI Final Release); but couldn't
get <xjc:simple/> to work. It is mentioned in the above post that this
extension will be part of 2.0 RI final release. By looking at the error,
it doesn't appear that this extension is included in Final Release, is
it?
I am getting the following error:
[java] Exception in thread "main" java.lang.NullPointerException
[java] at
com.sun.tools.xjc.reader.xmlschema.BGMBuilder._getBindInfoReadOnly(BGMBu
ilder.java:383)
[java] at
com.sun.tools.xjc.reader.xmlschema.BGMBuilder.getBindInfo(BGMBuilder.jav
a:367)
[java] at
com.sun.tools.xjc.reader.xmlschema.bindinfo.BIProperty.getCustomizations
(BIProperty.java:469)
[java] at
com.sun.tools.xjc.reader.xmlschema.bindinfo.BIProperty.createReferencePr
operty(BIProperty.java:368)
[java] at
com.sun.tools.xjc.reader.xmlschema.bindinfo.BIProperty.createElementOrRe
ferenceProperty(BIProperty.ja
va:405)
[java] at
com.sun.tools.xjc.reader.xmlschema.ExpressionParticleBinder.buildPropert
y(ExpressionParticleBinder.ja
va:78)
[java] at
com.sun.tools.xjc.reader.xmlschema.ExpressionParticleBinder.build(Expres
sionParticleBinder.java:33)
[java] at
com.sun.tools.xjc.reader.xmlschema.ParticleBinder.build(ParticleBinder.j
ava:61)
[java] at
com.sun.tools.xjc.reader.xmlschema.ct.FreshComplexTypeBuilder$1.particle
(FreshComplexTypeBuilder.java
:70)
[java] at
com.sun.xml.xsom.impl.ParticleImpl.visit(ParticleImpl.java:90)
[java] at
com.sun.tools.xjc.reader.xmlschema.ct.FreshComplexTypeBuilder.build(Fres
hComplexTypeBuilder.java:51)
[java] at
com.sun.tools.xjc.reader.xmlschema.ct.ComplexTypeFieldBuilder.build(Comp
lexTypeFieldBuilder.java:64)
[java] at
com.sun.tools.xjc.reader.xmlschema.BindRed.complexType(BindRed.java:37)
[java] at
com.sun.xml.xsom.impl.ComplexTypeImpl.visit(ComplexTypeImpl.java:236)
[java] at
com.sun.tools.xjc.reader.xmlschema.ClassSelector$Binding.build(ClassSele
ctor.java:181)
[java] at
com.sun.tools.xjc.reader.xmlschema.ClassSelector.executeTasks(ClassSelec
tor.java:348)
[java] at
com.sun.tools.xjc.reader.xmlschema.BGMBuilder._build(BGMBuilder.java:139
)
[java] at
com.sun.tools.xjc.reader.xmlschema.BGMBuilder.build(BGMBuilder.java:77)
[java] at
com.sun.tools.xjc.ModelLoader.annotateXMLSchema(ModelLoader.java:388)
[java] at
com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:145)
[java] at
com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:91)
[java] at com.sun.tools.xjc.Driver.run(Driver.java:287)
[java] at com.sun.tools.xjc.Driver.run(Driver.java:173)
[java] at com.sun.tools.xjc.Driver._main(Driver.java:98)
[java] at com.sun.tools.xjc.Driver.access$000(Driver.java:56)
[java] at com.sun.tools.xjc.Driver$1.run(Driver.java:78)
> Otherwise check out
>
http://weblogs.java.net/blog/kohsuke/archive/2005/05/compiling_mathm_1.h
tml
> for how to fix this issue.
--
Kohsuke Kawaguchi
Sun Microsystems kohsuke.kawaguchi_at_sun.com