users@jaxb.java.net

XJC throwing a ClassCastException when parsing schema

From: Adam Cohen-Rose <java.net_at_cohen-rose.org>
Date: Tue, 11 Nov 2003 16:24:25 -0000 (GMT)

Hi there,

We're having a problem compiling a schema using JAXB 1.0.2. Specifically,
the XJC compiler is throwing a ClassCastException for no apparent reason.

Anyone have any clues to point us in the right direction?

Thanks,

Adam & James



The stack trace is as follows:

Compiling the schema...
parsing a schema...
java.lang.ClassCastException:
com.sun.xml.xsom.impl.RestrictionSimpleTypeImpl
  at
com.sun.xml.xsom.impl.parser.state.complexType$4.getContentType(complexType.java:1773)
  at
com.sun.xml.xsom.impl.ComplexTypeImpl.getContentType(ComplexTypeImpl.java:121)
  at
com.sun.xml.xsom.impl.util.SchemaWriter.complexType(SchemaWriter.java:343)
  at com.sun.xml.xsom.impl.ComplexTypeImpl.visit(ComplexTypeImpl.java:159) at
com.sun.tools.xjc.reader.xmlschema.ClassSelector.addSchemaFragmentJavadoc(ClassSelector.java:235)
  at
com.sun.tools.xjc.reader.xmlschema.ClassSelector.build(ClassSelector.java:209)
  at
com.sun.tools.xjc.reader.xmlschema.ClassSelector.select(ClassSelector.java:157)
  at
com.sun.tools.xjc.reader.xmlschema.FieldBuilder.elementDeclFlat(FieldBuilder.java:531)
  at
com.sun.tools.xjc.reader.xmlschema.FieldBuilder.elementDecl(FieldBuilder.java:567)
  at com.sun.xml.xsom.impl.ElementDecl.apply(ElementDecl.java:105) at
com.sun.tools.xjc.reader.xmlschema.FieldBuilder.build(FieldBuilder.java:79)
  at
com.sun.tools.xjc.reader.xmlschema.DefaultParticleBinder$Builder.particle(DefaultParticleBinder.java:456)
  at
com.sun.tools.xjc.reader.xmlschema.BGMBuilder.applyRecursively(BGMBuilder.java:483)
  at
com.sun.tools.xjc.reader.xmlschema.DefaultParticleBinder$Builder.modelGroup(DefaultParticleBinder.java:508)
  at com.sun.xml.xsom.impl.ModelGroupImpl.apply(ModelGroupImpl.java:71) at
com.sun.tools.xjc.reader.xmlschema.DefaultParticleBinder$Builder.build(DefaultParticleBinder.java:421)
  at
com.sun.tools.xjc.reader.xmlschema.DefaultParticleBinder$Builder.particle(DefaultParticleBinder.java:479)
  at
com.sun.tools.xjc.reader.xmlschema.DefaultParticleBinder$Builder.build(DefaultParticleBinder.java:424)
  at
com.sun.tools.xjc.reader.xmlschema.DefaultParticleBinder.build(DefaultParticleBinder.java:74)
  at
com.sun.tools.xjc.reader.xmlschema.FieldBuilder.particle(FieldBuilder.java:435)
  at
com.sun.tools.xjc.reader.xmlschema.FieldBuilder.access$100(FieldBuilder.java:70)
  at
com.sun.tools.xjc.reader.xmlschema.FieldBuilder$3.particle(FieldBuilder.java:286)
  at com.sun.xml.xsom.impl.ParticleImpl.apply(ParticleImpl.java:55) at
com.sun.tools.xjc.reader.xmlschema.FieldBuilder.complexType(FieldBuilder.java:270)
  at com.sun.xml.xsom.impl.ComplexTypeImpl.apply(ComplexTypeImpl.java:162) at
com.sun.tools.xjc.reader.xmlschema.FieldBuilder.build(FieldBuilder.java:79)
  at
com.sun.tools.xjc.reader.xmlschema.ClassSelector.build(ClassSelector.java:214)
  at
com.sun.tools.xjc.reader.xmlschema.ClassSelector.select(ClassSelector.java:157)
  at
com.sun.tools.xjc.reader.xmlschema.FieldBuilder.elementDeclFlat(FieldBuilder.java:531)
  at
com.sun.tools.xjc.reader.xmlschema.FieldBuilder.elementDecl(FieldBuilder.java:567)
  at com.sun.xml.xsom.impl.ElementDecl.apply(ElementDecl.java:105) at
com.sun.tools.xjc.reader.xmlschema.FieldBuilder.build(FieldBuilder.java:79)
  at
com.sun.tools.xjc.reader.xmlschema.DefaultParticleBinder$Builder.particle(DefaultParticleBinder.java:456)
  at
com.sun.tools.xjc.reader.xmlschema.BGMBuilder.applyRecursively(BGMBuilder.java:483)
  at
com.sun.tools.xjc.reader.xmlschema.DefaultParticleBinder$Builder.modelGroup(DefaultParticleBinder.java:508)
  at com.sun.xml.xsom.impl.ModelGroupImpl.apply(ModelGroupImpl.java:71) at
com.sun.tools.xjc.reader.xmlschema.DefaultParticleBinder$Builder.build(DefaultParticleBinder.java:421)
  at
com.sun.tools.xjc.reader.xmlschema.DefaultParticleBinder$Builder.particle(DefaultParticleBinder.java:479)
  at
com.sun.tools.xjc.reader.xmlschema.BGMBuilder.applyRecursively(BGMBuilder.java:483)
  at
com.sun.tools.xjc.reader.xmlschema.DefaultParticleBinder$Builder.modelGroup(DefaultParticleBinder.java:508)
  at com.sun.xml.xsom.impl.ModelGroupImpl.apply(ModelGroupImpl.java:71) at
com.sun.tools.xjc.reader.xmlschema.DefaultParticleBinder$Builder.build(DefaultParticleBinder.java:421)
  at
com.sun.tools.xjc.reader.xmlschema.DefaultParticleBinder$Builder.particle(DefaultParticleBinder.java:479)
  at
com.sun.tools.xjc.reader.xmlschema.DefaultParticleBinder$Builder.build(DefaultParticleBinder.java:424)
  at
com.sun.tools.xjc.reader.xmlschema.DefaultParticleBinder.build(DefaultParticleBinder.java:74)
  at
com.sun.tools.xjc.reader.xmlschema.FieldBuilder.particle(FieldBuilder.java:435)
  at
com.sun.tools.xjc.reader.xmlschema.FieldBuilder.access$100(FieldBuilder.java:70)
  at
com.sun.tools.xjc.reader.xmlschema.FieldBuilder$3.particle(FieldBuilder.java:286)
  at com.sun.xml.xsom.impl.ParticleImpl.apply(ParticleImpl.java:55) at
com.sun.tools.xjc.reader.xmlschema.FieldBuilder.complexType(FieldBuilder.java:270)
  at com.sun.xml.xsom.impl.ComplexTypeImpl.apply(ComplexTypeImpl.java:162) at
com.sun.tools.xjc.reader.xmlschema.FieldBuilder.build(FieldBuilder.java:79)
  at
com.sun.tools.xjc.reader.xmlschema.ClassSelector.build(ClassSelector.java:214)
  at
com.sun.tools.xjc.reader.xmlschema.ClassSelector.select(ClassSelector.java:157)
  at
com.sun.tools.xjc.reader.xmlschema.BGMBuilder.populate(BGMBuilder.java:250)
  at
com.sun.tools.xjc.reader.xmlschema.BGMBuilder.buildContents(BGMBuilder.java:216)
  at
com.sun.tools.xjc.reader.xmlschema.BGMBuilder._build(BGMBuilder.java:116)
  at
com.sun.tools.xjc.reader.xmlschema.BGMBuilder.build(BGMBuilder.java:72)
  at com.sun.tools.xjc.Driver.loadXMLSchemaGrammar(Driver.java:681) at
com.sun.tools.xjc.Driver.loadGrammar(Driver.java:522)
  at com.sun.tools.xjc.Driver.run(Driver.java:374)
  at com.sun.tools.xjc.Driver._main(Driver.java:113)
  at com.sun.tools.xjc.Driver.access$000(Driver.java:77)
  at com.sun.tools.xjc.Driver$1.run(Driver.java:93)
Exception in thread "main"




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net