Jackson's used for JSON purposes, I'm building a SOAP client.

We've been digging and frankly I don't believe what I am observing. Two
JAX-WS annotated service classes in the server. Run wsimport against both
to auto-build clients.

One produces a service interface definition where the @WebParam has both a
name and a targetNamespace matching that of the @WebService attribute. This
client exhibits the issue.
One produces a service interface definition where the @WebParam has just a
name and an empty targetNamespace. This client does not exhibit the issue.

In both cases the @WebService class has a targetNamespace declared on the
@WebService class but not on the @WebParam method parameter.

Doesn't make any sense. Even the WSDLs looks extremely similar. We just
changed the server classes to have explicitly empty targetNamespaces in the
@WebParam of some methods but even that's inconsistent when the client is
auto-built.

Looks like it must be a wsimport bug, somehow.

If I find anything useful I'll update this thread.



On 10 May 2013 10:21, Romain Manni-Bucau <rmannibu...@gmail.com> wrote:

> Didnt you talked about jackson? Misconfiguration?
> Le 10 mai 2013 11:17, "James Green" <james.mk.gr...@gmail.com> a écrit :
>
> > Here's the actual exception:
> >
> > WARNING: Interceptor for {
> >
> >
> http://www.mysite/doc/2012-08-01}KeyStoreService#{http://www.mysite/doc/2012-08-01}createhas
> > thrown exception, unwinding
> > now
> > org.apache.cxf.interceptor.Fault: Unmarshalling Error: unexpected element
> > (uri:"http://www.mysite/doc/2012-08-01";, local:"createKeyStoreRequest").
> > Exp
> > ected elements are <{}createKeyStoreRequest>
> >         at
> >
> >
> org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:808)
> >         at
> >
> >
> org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:629)
> >         at
> > org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:157)
> >         at
> >
> >
> org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:109)
> >         at
> >
> >
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
> >         at
> >
> >
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
> >         at
> >
> >
> org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:237)
> >         at
> >
> >
> org.apache.openejb.server.cxf.CxfWsContainer.onMessage(CxfWsContainer.java:74)
> >         at
> >
> org.apache.openejb.server.webservices.WsServlet.service(WsServlet.java:98)
> >         at
> >
> >
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
> >         at
> >
> >
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> >         at
> >
> >
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
> >         at
> >
> >
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
> >         at
> > org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:45)
> >         at
> >
> >
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
> >         at
> >
> >
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
> >         at
> >
> >
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
> >         at
> > org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
> >         at
> >
> >
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
> >         at
> >
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
> >         at
> >
> >
> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
> >         at
> >
> >
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
> >         at
> >
> >
> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
> >         at
> >
> >
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> >         at
> >
> >
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> >         at java.lang.Thread.run(Thread.java:722)
> > Caused by: javax.xml.bind.UnmarshalException
> >  - with linked exception:
> > [com.sun.istack.SAXParseException2; lineNumber: 0; columnNumber: 0;
> > unexpected element (uri:"http://www.mysite/doc/2012-08-01";,
> > local:"createKeyStoreRequest"). Expected elements are
> > <{}createKeyStoreRequest>]
> >         at
> >
> >
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:435)
> >         at
> >
> >
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:372)
> >         at
> >
> >
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:349)
> >         at
> >
> >
> org.apache.cxf.jaxb.JAXBEncoderDecoder.doUnmarshal(JAXBEncoderDecoder.java:769)
> >         at
> >
> >
> org.apache.cxf.jaxb.JAXBEncoderDecoder.access$100(JAXBEncoderDecoder.java:94)
> >         at
> > org.apache.cxf.jaxb.JAXBEncoderDecoder$1.run(JAXBEncoderDecoder.java:797)
> >         at java.security.AccessController.doPrivileged(Native Method)
> >         at
> >
> >
> org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:795)
> >         ... 25 more
> > Caused by: com.sun.istack.SAXParseException2; lineNumber: 0;
> columnNumber:
> > 0; unexpected element (uri:"http://www.mysite/doc/2012-08-01";,
> > local:"createKeyStoreRequest"). Expected elements are
> > <{}createKeyStoreRequest>
> >         at
> >
> >
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:662)
> >         at
> >
> >
> com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:258)
> >         at
> >
> >
> com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:253)
> >         at
> >
> >
> com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement(Loader.java:120)
> >         at
> >
> >
> com.sun.xml.bind.v2.runtime.unmarshaller.Loader.childElement(Loader.java:105)
> >         at
> >
> >
> com.sun.xml.bind.v2.runtime.unmarshaller.StructureLoader.childElement(StructureLoader.java:262)
> >         at
> >
> >
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:498)
> >         at
> >
> >
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:480)
> >         at
> >
> >
> com.sun.xml.bind.v2.runtime.unmarshaller.InterningXmlVisitor.startElement(InterningXmlVisitor.java:75)
> >         at
> >
> >
> com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleStartElement(StAXStreamConnector.java:246)
> >         at
> >
> >
> com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:180)
> >         at
> >
> >
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:370)
> >         ... 31 more
> > Caused by: javax.xml.bind.UnmarshalException: unexpected element (uri:"
> > http://www.mysite/doc/2012-08-01";, local:"createKeyStoreRequest").
> > Expected
> > elements are <{}createKeyStoreRequest>
> >         ... 43 more
> >
> > Reading around it may be that CXF is being handed a entity with a
> > namespace, but it's expecting one without a namespace. Lots of people all
> > reporting much the same thing. Not sure why this particular
> service/entity
> > is different to my others to be honest.
> >
> > James
> >
> >
> >
> > On 10 May 2013 09:23, Romain Manni-Bucau <rmannibu...@gmail.com> wrote:
> >
> > > Not directly linked i guess. Can you try to reproduce the issue in a
> mini
> > > sample?
> > > Le 10 mai 2013 10:07, "James Green" <james.mk.gr...@gmail.com> a
> écrit :
> > >
> > > > I have not specified one - it is the TomEE default. Which I presume
> > means
> > > > Apache CXF?
> > > >
> > > > I do have Jackson setup as a provider for JSON marshalling purposes,
> > but
> > > > that provider does not specify any classes to handle marshalling for.
> > > >
> > > > I am therefore rather puzzled.
> > > >
> > > > The only notable thing about the jar which has the working entities
> in
> > it
> > > > is that it is also configured as a CDI provider by having a
> beans.xml.
> > I
> > > > would not expect this to be needed to register classes for JAXB
> mapping
> > > > though.
> > > >
> > > > James
> > > >
> > > > On 9 May 2013 21:32, Romain Manni-Bucau <rmannibu...@gmail.com>
> wrote:
> > > >
> > > > > so depends your provider,
> > > > >
> > > > > basically you'll probably need once of them or to configure it...or
> > > write
> > > > > your own provider (very easy)
> > > > >
> > > > > *Romain Manni-Bucau*
> > > > > *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> > > > > *Blog: **http://rmannibucau.wordpress.com/*<
> > > > > http://rmannibucau.wordpress.com/>
> > > > > *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> > > > > *Github: https://github.com/rmannibucau*
> > > > >
> > > > >
> > > > >
> > > > > 2013/5/9 James Green <james.mk.gr...@gmail.com>
> > > > >
> > > > > > Neither. JAX-RS/JAX-WS expose our classes.
> > > > > >
> > > > > >
> > > > > >
> > > > > > On 9 May 2013 20:50, Romain Manni-Bucau <rmannibu...@gmail.com>
> > > wrote:
> > > > > >
> > > > > > > Hi,
> > > > > > >
> > > > > > > Depends the context.
> > > > > > >
> > > > > > > Do you use ObjectFactory or jaxb.index?
> > > > > > > Le 9 mai 2013 21:47, "James Green" <james.mk.gr...@gmail.com>
> a
> > > > écrit
> > > > > :
> > > > > > >
> > > > > > > > Is there anything special I need to do in order to ensure
> > > > > > @XmlRootElement
> > > > > > > > annotated classes in a jar included as a dependency of a
> > deployed
> > > > war
> > > > > > > file
> > > > > > > > get included for JAXB mapping?
> > > > > > > >
> > > > > > > > My .war has multiple jar dependencies and it seems one of
> those
> > > has
> > > > > > > working
> > > > > > > > mapped classes but the other (a new one) does not. Not
> entirely
> > > > sure
> > > > > > what
> > > > > > > > I'm missing.
> > > > > > > >
> > > > > > > > Thanks,
> > > > > > > >
> > > > > > > > James
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Reply via email to