users@jaxb.java.net

Re: No class generated for element with type="int" (xjc)

From: Martin Grotzke <martin.grotzke_at_javakaffee.de>
Date: Tue, 11 Mar 2008 11:09:17 +0100

Hi,

setting <jaxb:class name="MyElement"/> does create a java class like
this:

public class MyElement extends JAXBElement<Integer> {

    protected final static QName NAME = new
QName("http://www.example.com/", "myElement");

    public MyElement(Integer value) {
        super(NAME, ((Class) Integer.class), null, value);
    }

}

I'm using jersey which supports jaxb-beans as one default-binding. When
I return an instance of MyElement to jersey, it complains that it cannot
handle this type (Java type). I'd suppose that it is missing the
@XmlRootElement and other annotations.

Is there a way to generate a java class that also contains these
annotations?

Thanx && cheers,
Martin


On Tue, 2008-03-11 at 09:23 +0100, Aleksei Valikov wrote:
> Hi.
> > thanx for your pointer! Unfortunately, activating simple-minded mode for
> > xjc doesn't change anything for me - there's still no class generated
> > for myElement. Should this be the case, or is it expected, that only the
> > ObjectFactory provides createMyElement?
> >
> > Btw. I changed the jaxb:version to "2.0", as I already have another
> > globalBindings that used jaxb:version="2.0" (I don't know if it does
> > matter).
> >
> > So my issue is, that no class at all is generated for myElement.
> >
> > Anything else?
>
> Please try annotating myElement with <jaxb:class name="MyElement"/>.
>
> Bye.
> /lexi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>