There should also be a generated class ...impl.JAXBcontextFactory. Is that
so?
How is the JAXB context created in the client application? With this
customization, using the class (User.class) as an argument to
JAXBContext.newInstance(...) will not work; it should be the package name.
-W
On Fri, Jul 17, 2009 at 11:18 PM, Daniel Melo <dpmelo_at_gmail.com> wrote:
> Hi all,
>
> I'm having a problem with JAXB and JAX-WS Runtime. Suppose the following
> schema piece:
>
> <xs:complexType name="*ctUser*">
> <xs:sequence>
> <xs:element name="login" minOccurs="1" maxOccurs="1"
> type="xsd:string" />
> </xs:sequence>
> </xs:complexType>
>
> And the following JAXB customization file:
>
> <jaxb:globalBindings *generateValueClass="false"*/>
>
> <jaxb:bindings node="//xsd:complexType[@name='*ctUser*']">
> <jaxb:class name="User"/>
> </jaxb:bindings>
>
> When I run *wsimport*, two files are generated: *User *(an interface), and
> *UserImpl *(a concrete implementation of User). That's exactly what I
> expected.
>
> The problem is, when I try to invoke my Web Service with a client using the
> generated classes, the following error occurs:
>
> *javax.ejb.EJBException: java.lang.IllegalStateException: Cannot build
> JAXB context*
>
> *com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of
> IllegalAnnotationExceptions
> foo.bar.User is an interface, and JAXB can't handle interfaces.*
>
> Any helps will be highly appreciated.
>
> thanks,
>
> Daniel
>
>