users@jaxb.java.net

Re: XJC and "choice" element.

From: Wolfgang Laun <wolfgang.laun_at_gmail.com>
Date: Sun, 22 Nov 2009 10:21:18 +0100

This does not depend on <choice...> alone. Can you post a full .xsd
producing the exception?
-W

On 11/22/09, John Leonard <jleonard.20081_at_gmx.com> wrote:
> Does JAXB understand the following use of the "choice" element?
>
> <choice minOccurs="0" maxOccurs="unbounded">
> <element...
> <element...
> ...
> </choice>
>
> Here is the output of XJC when I run it from the command line on a file
> containing such code:
> parsing a schema...
> compiling a schema...
> [INFO] generating code
> unknown location
>
> Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
> at $Proxy7.required(Unknown Source)
> at
> com.sun.tools.xjc.generator.bean.field.AbstractField.annotateReferenc
> e(AbstractField.java:197)
> at
> com.sun.tools.xjc.generator.bean.field.AbstractField.annotate(Abstrac
> tField.java:156)
> at
> com.sun.tools.xjc.generator.bean.field.AbstractListField.generate(Abs
> tractListField.java:124)
> at
> com.sun.tools.xjc.generator.bean.field.UntypedListField.<init>(Untype
> dListField.java:107)
> at
> com.sun.tools.xjc.generator.bean.field.UntypedListFieldRenderer.gener
> ate(UntypedListFieldRenderer.java:72)
> at
> com.sun.tools.xjc.generator.bean.field.DefaultFieldRenderer.generate(
> DefaultFieldRenderer.java:79)
> at
> com.sun.tools.xjc.generator.bean.BeanGenerator.generateFieldDecl(Bean
> Generator.java:747)
> at
> com.sun.tools.xjc.generator.bean.BeanGenerator.generateClassBody(Bean
> Generator.java:535)
> at
> com.sun.tools.xjc.generator.bean.BeanGenerator.<init>(BeanGenerator.j
> ava:235)
> at
> com.sun.tools.xjc.generator.bean.BeanGenerator.generate(BeanGenerator
> .java:175)
> at com.sun.tools.xjc.model.Model.generateCode(Model.java:286)
> at com.sun.tools.xjc.Driver.run(Driver.java:343)
> at com.sun.tools.xjc.Driver.run(Driver.java:191)
> at com.sun.tools.xjc.Driver._main(Driver.java:116)
> at com.sun.tools.xjc.Driver.access$000(Driver.java:74)
> at com.sun.tools.xjc.Driver$1.run(Driver.java:96)
> Caused by: java.lang.NoSuchMethodException:
> javax.xml.bind.annotation.XmlElement
> Ref.required()
> at java.lang.Class.getDeclaredMethod(Unknown Source)
> at
> com.sun.codemodel.TypedAnnotationWriter.invoke(TypedAnnotationWriter.
> java:107)
> ... 17 more
>
> Thanks,
> John L.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>