You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by asookazian <as...@gmail.com> on 2014/05/06 22:54:46 UTC

javax.xml.ws.soap.SOAPFaultException: Unmarshalling Error: unexpected element

We have multiple applications running as bundles in Karaf 3.0.1.

I am able to load the WSDL here:
http://localhost:8181/ws/wf/WorkflowManagerWS?wsdl

I am able to get a SOAP response via SOAP UI as well for the
predefinedTaskSearchCriteria API call using above WSDL.

I have read on google for a while on this particular exception but confused
on what is root cause and how to resolve.  Please advise.  We are using cxf
2.7.10 in karaf.

I am seeing the following exception while executing a use case in the web
browser for the web app:

20140506 09:54:36.988 [ERROR] qtp443975686-1261 |
267:com.nextgate.mm.PersonDQM |
com.nextgate.dqm.presentation.amfendpoint.DqmMessageBrokerFilter |
MessageException
flex.messaging.MessageException:
com.sun.mdm.index.master.ProcessingException :
javax.xml.ws.soap.SOAPFaultException: Unmarshalling Error: unexpected
element (uri:"", local:"predefinedSearchCriteria"). Expected elements are
<{http://server.ws.workflow.mm.nextgate.com/}predefinedSearchCriteria> 
	at
flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:447)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
	at
flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:183)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
	at
flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1503)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
	at
flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:884)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
	at
com.nextgate.dqm.presentation.amfendpoint.DqmAMFEndpoint.serviceMessage(DqmAMFEndpoint.java:92)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
	at
com.nextgate.dqm.presentation.amfendpoint.DqmMessageBrokerFilter.invoke(DqmMessageBrokerFilter.java:169)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
	at
flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
	at
flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:44)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
	at
flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
	at
flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:146)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
	at
flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:278)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
	at
org.springframework.flex.servlet.MessageBrokerHandlerAdapter.handle(MessageBrokerHandlerAdapter.java:101)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
	at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
	at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
	at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
	at
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
	at
javax.servlet.http.HttpServlet.service(HttpServlet.java:595)[64:org.apache.geronimo.specs.geronimo-servlet_3.0_spec:1.0]
	at
javax.servlet.http.HttpServlet.service(HttpServlet.java:668)[64:org.apache.geronimo.specs.geronimo-servlet_3.0_spec:1.0]
	at
org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
	at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1496)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
	at
org.ops4j.pax.web.service.internal.WelcomeFilesFilter.doFilter(WelcomeFilesFilter.java:185)[78:org.ops4j.pax.web.pax-web-runtime:3.1.0]
	at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1467)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
	at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
	at
org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:69)[79:org.ops4j.pax.web.pax-web-jetty:3.1.0]
	at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
	at
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:533)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
	at
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
	at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
	at
org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:240)[79:org.ops4j.pax.web.pax-web-jetty:3.1.0]
	at
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
	at
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
	at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
	at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
	at
org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:77)[79:org.ops4j.pax.web.pax-web-jetty:3.1.0]
	at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
	at
org.eclipse.jetty.server.Server.handle(Server.java:370)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
	at
org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
	at
org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:982)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
	at
org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1043)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
	at
org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
	at
org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
	at
org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
	at
org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
	at
org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
	at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
	at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
	at java.lang.Thread.run(Thread.java:744)[:1.7.0_51]
Caused by: com.sun.mdm.index.master.ProcessingException:
javax.xml.ws.soap.SOAPFaultException: Unmarshalling Error: unexpected
element (uri:"", local:"predefinedSearchCriteria"). Expected elements are
<{http://server.ws.workflow.mm.nextgate.com/}predefinedSearchCriteria> 
	at
com.nextgate.mm.workflow.flex.WorkflowHandler.getPredefinedSearches(WorkflowHandler.java:418)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_51]
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_51]
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_51]
	at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_51]
	at
flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:421)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
	... 46 more
Caused by: javax.xml.ws.soap.SOAPFaultException: Unmarshalling Error:
unexpected element (uri:"", local:"predefinedSearchCriteria"). Expected
elements are
<{http://server.ws.workflow.mm.nextgate.com/}predefinedSearchCriteria> 
	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:157)
	at com.sun.proxy.$Proxy117.getPredefinedTaskSearchCriteria(Unknown
Source)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
	at
com.nextgate.mm.workflow.flex.WorkflowHandler.getPredefinedSearches(WorkflowHandler.java:410)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
	... 51 more
Caused by: javax.xml.bind.UnmarshalException
 - with linked exception:
[javax.xml.bind.UnmarshalException: unexpected element (uri:"",
local:"predefinedSearchCriteria"). Expected elements are
<{http://server.ws.workflow.mm.nextgate.com/}predefinedSearchCriteria>]
	at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:425)
	at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:362)
	at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:339)
	at
org.apache.cxf.jaxb.JAXBEncoderDecoder.doUnmarshal(JAXBEncoderDecoder.java:842)[196:org.apache.cxf.cxf-rt-databinding-jaxb:2.7.10]
	at
org.apache.cxf.jaxb.JAXBEncoderDecoder.access$100(JAXBEncoderDecoder.java:101)[196:org.apache.cxf.cxf-rt-databinding-jaxb:2.7.10]
	at
org.apache.cxf.jaxb.JAXBEncoderDecoder$2.run(JAXBEncoderDecoder.java:870)
	at java.security.AccessController.doPrivileged(Native Method)[:1.7.0_51]
	at
org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:868)[196:org.apache.cxf.cxf-rt-databinding-jaxb:2.7.10]
	at
org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:702)[196:org.apache.cxf.cxf-rt-databinding-jaxb:2.7.10]
	at org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:160)
	at
org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:107)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
	at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:835)
	at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1614)
	at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1504)
	at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1310)
	at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
	at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:628)
	at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
	at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:565)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:474)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:377)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:330)
	at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)
	... 53 more
Caused by: javax.xml.bind.UnmarshalException: unexpected element (uri:"",
local:"predefinedSearchCriteria"). Expected elements are
<{http://server.ws.workflow.mm.nextgate.com/}predefinedSearchCriteria>
	at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:642)
	at
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:254)
	at
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:249)
	at
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement(Loader.java:116)
	at
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.childElement(Loader.java:101)
	at
com.sun.xml.bind.v2.runtime.unmarshaller.StructureLoader.childElement(StructureLoader.java:243)
	at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:478)
	at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:459)
	at
com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleStartElement(StAXStreamConnector.java:242)
	at
com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:176)
	at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:360)
	... 77 more
Caused by: javax.xml.bind.UnmarshalException: unexpected element (uri:"",
local:"predefinedSearchCriteria"). Expected elements are
<{http://server.ws.workflow.mm.nextgate.com/}predefinedSearchCriteria>
	... 88 more



--
View this message in context: http://cxf.547215.n5.nabble.com/javax-xml-ws-soap-SOAPFaultException-Unmarshalling-Error-unexpected-element-tp5743794.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: javax.xml.ws.soap.SOAPFaultException: Unmarshalling Error: unexpected element

Posted by asookazian <as...@gmail.com>.
Upgraded to latest JDK 7 on Mac OS X:

java version "1.7.0_55"
Java(TM) SE Runtime Environment (build 1.7.0_55-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.55-b03, mixed mode)

didn't help...



--
View this message in context: http://cxf.547215.n5.nabble.com/javax-xml-ws-soap-SOAPFaultException-Unmarshalling-Error-unexpected-element-tp5743794p5743978.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: javax.xml.ws.soap.SOAPFaultException: Unmarshalling Error: unexpected element

Posted by asookazian <as...@gmail.com>.
I tried building using <version>3.0.0-milestone2</version> for all three and
the generated class looks incorrect still...



--
View this message in context: http://cxf.547215.n5.nabble.com/javax-xml-ws-soap-SOAPFaultException-Unmarshalling-Error-unexpected-element-tp5743794p5743977.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: javax.xml.ws.soap.SOAPFaultException: Unmarshalling Error: unexpected element

Posted by asookazian <as...@gmail.com>.
So I just determined after some experimenting with different version of JDKs
for building each project the following:

If I build the generated client classes with jaxws-maven-plugin with JDK 6
or JDK 7 that's ok.

If I build the server (WSDL) with cxf-java2ws-plugin JDK 6 it's ok, JDK 7
it's not (exception will reproduce).

So the issue is that the differences b/n the JDK 6 WSDL and the JDK 7 WSDL
are making a difference for this exception to reproduce or not (and I think
it's specifically the first diff below).

Here are the diffs:

<xs:element minOccurs="0" name="predefinedSearchCriteria"
type="tns:predefinedSearchCriteria"/> //JDK6
<xs:element minOccurs="0" ref="tns:predefinedSearchCriteria"/> //JDK7

<xs:element minOccurs="0" name="caseCreationConfig"
type="tns:caseCreationConfig"/> //JDK6
<xs:element minOccurs="0" ref="tns:caseCreationConfig"/> //JDK7

<xs:element minOccurs="0" name="caseCreationConfig"
type="tns:caseCreationConfig"/> //JDK6
<xs:element minOccurs="0" ref="tns:caseCreationConfig"/> //JDK7



--
View this message in context: http://cxf.547215.n5.nabble.com/javax-xml-ws-soap-SOAPFaultException-Unmarshalling-Error-unexpected-element-tp5743794p5743975.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: javax.xml.ws.soap.SOAPFaultException: Unmarshalling Error: unexpected element

Posted by asookazian <as...@gmail.com>.
Ok this exception began reproducing again (consistently).  I was able to code
a fix by adding 'targetNamespace = ""' like:

@WebResult(name = "predefinedSearchCriteria", targetNamespace = "")

When I build 'mvn clean install' my two projects (one is the server [WAR]
which uses the class to generate the WSDL, the other is the generated
clients which uses the WSDL to generate the clients) using JDK 6, the above
code is generated in target.  If I build 'mvn clean install' my two projects
using JDK 7, the above line looks like following:

@WebResult(name = "predefinedSearchCriteria", targetNamespace =
"http://server.ws.workflow.mm.nextgate.com/")

b/c of this the JDK 7 build reproduces the UnmarshalException during test
case execution in the web browser.  The JDK 6 build does not reproduce.

Please advise how I can get this to work with JDK 7.  Is there some option I
am missing?

Here is the mvn console output for the generated-client build (using JDK 6):

[INFO] Processing: /Users/arbisookazian/Documents/Versions/matchmetrix
(trunk)/workflow/ws-client-generated/target/ws-server-resources/WEB-INF/classes/wsdl/WorkflowManagerWSService.wsdl
[INFO] jaxws:wsimport args: [-s,
/Users/arbisookazian/Documents/Versions/matchmetrix
(trunk)/workflow/ws-client-generated/target/generated-sources/wsimport, -d,
/Users/arbisookazian/Documents/Versions/matchmetrix
(trunk)/workflow/ws-client-generated/target/classes, -wsdllocation,
http://localhost:8080/test, -target, 2.1, -Xnocompile,
/Users/arbisookazian/Documents/Versions/matchmetrix
(trunk)/workflow/ws-client-generated/target/ws-server-resources/WEB-INF/classes/wsdl/WorkflowManagerWSService.wsdl]
parsing WSDL...


generating code...

When I view the WSDL in diff merge tool for JDK 6 version vs. JDK 7 version
there are 3 differences.

Here is the cxf maven plugin I am using for the WSDL generation:

<plugin>
			    <groupId>org.apache.cxf</groupId>
			    <artifactId>cxf-java2ws-plugin</artifactId>
			    <version>2.7.11</version>
			    <dependencies>
			        <dependency>
			            <groupId>org.apache.cxf</groupId>
			            <artifactId>cxf-rt-frontend-jaxws</artifactId>
			            <version>2.7.11</version>
			        </dependency>
			        <dependency>
			            <groupId>org.apache.cxf</groupId>
			            <artifactId>cxf-rt-frontend-simple</artifactId>
			            <version>2.7.11</version>
			        </dependency>
			    </dependencies>
			 
			    <executions>
			        <execution>
			            <id>process-classes</id>
			            <phase>process-classes</phase>
			            <goals>
			                <goal>java2ws</goal>
			            </goals>
			            <configuration>
			            
<outputFile>${project.build.directory}/cxf/java2ws/wsdl/WorkflowManagerWSService.wsdl</outputFile>
			               
<className>com.nextgate.mm.workflow.ws.server.WorkflowManagerWS</className>
			                <genWsdl>true</genWsdl>
			                <verbose>true</verbose>
			                <portname>WorkflowManagerWSPort</portname>
			               
<address>http://localhost:8181/ws/wf/WorkflowManagerWS</address>
			                <databinding>jaxb</databinding>
			                <frontend>jaxws</frontend>
			            </configuration>
			        </execution>
			    </executions>
			</plugin>




--
View this message in context: http://cxf.547215.n5.nabble.com/javax-xml-ws-soap-SOAPFaultException-Unmarshalling-Error-unexpected-element-tp5743794p5743974.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: javax.xml.ws.soap.SOAPFaultException: Unmarshalling Error: unexpected element

Posted by asookazian <as...@gmail.com>.
rebuilding the client and server JARs/WAR fixed the problem.  The .xsd files
were out-of-sync according to a diff...



--
View this message in context: http://cxf.547215.n5.nabble.com/javax-xml-ws-soap-SOAPFaultException-Unmarshalling-Error-unexpected-element-tp5743794p5743820.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: javax.xml.ws.soap.SOAPFaultException: Unmarshalling Error: unexpected element

Posted by Aki Yoshida <el...@gmail.com>.
you mention that you are calling the service from your browser app.
how does your request message look?

basically, the service is complaining about the
predefinedSearchCriteria element and how it appears. According to your
definition, this element must be namespace-qualified and as such, it
should look something like
   ...
   <x:predefinedTaskSearchCriteria xmlns:x =
"http://server.ws.workflow.mm.nextgate.com/">
     ….
   </x:predefinedTaskSearchCriteria>

where x can be an arbitrary prefix and the declaration xmlns:x="…" may
appear somewhere about the element itself.

But it appears to the that this element is not namespace-qualified in
your request message, so something like:
   <predefinedTaskSearchCriteria>
   ….
   </predefinedTaskSearchCriteria>


2014-05-06 22:54 GMT+02:00 asookazian <as...@gmail.com>:
> We have multiple applications running as bundles in Karaf 3.0.1.
>
> I am able to load the WSDL here:
> http://localhost:8181/ws/wf/WorkflowManagerWS?wsdl
>
> I am able to get a SOAP response via SOAP UI as well for the
> predefinedTaskSearchCriteria API call using above WSDL.
>
> I have read on google for a while on this particular exception but confused
> on what is root cause and how to resolve.  Please advise.  We are using cxf
> 2.7.10 in karaf.
>
> I am seeing the following exception while executing a use case in the web
> browser for the web app:
>
> 20140506 09:54:36.988 [ERROR] qtp443975686-1261 |
> 267:com.nextgate.mm.PersonDQM |
> com.nextgate.dqm.presentation.amfendpoint.DqmMessageBrokerFilter |
> MessageException
> flex.messaging.MessageException:
> com.sun.mdm.index.master.ProcessingException :
> javax.xml.ws.soap.SOAPFaultException: Unmarshalling Error: unexpected
> element (uri:"", local:"predefinedSearchCriteria"). Expected elements are
> <{http://server.ws.workflow.mm.nextgate.com/}predefinedSearchCriteria>
>         at
> flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:447)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
>         at
> flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:183)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
>         at
> flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1503)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
>         at
> flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:884)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
>         at
> com.nextgate.dqm.presentation.amfendpoint.DqmAMFEndpoint.serviceMessage(DqmAMFEndpoint.java:92)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
>         at
> com.nextgate.dqm.presentation.amfendpoint.DqmMessageBrokerFilter.invoke(DqmMessageBrokerFilter.java:169)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
>         at
> flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
>         at
> flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:44)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
>         at
> flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
>         at
> flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:146)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
>         at
> flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:278)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
>         at
> org.springframework.flex.servlet.MessageBrokerHandlerAdapter.handle(MessageBrokerHandlerAdapter.java:101)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
>         at
> org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
>         at
> org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
>         at
> org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
>         at
> org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
>         at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:595)[64:org.apache.geronimo.specs.geronimo-servlet_3.0_spec:1.0]
>         at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:668)[64:org.apache.geronimo.specs.geronimo-servlet_3.0_spec:1.0]
>         at
> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>         at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1496)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>         at
> org.ops4j.pax.web.service.internal.WelcomeFilesFilter.doFilter(WelcomeFilesFilter.java:185)[78:org.ops4j.pax.web.pax-web-runtime:3.1.0]
>         at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1467)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>         at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>         at
> org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:69)[79:org.ops4j.pax.web.pax-web-jetty:3.1.0]
>         at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>         at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:533)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>         at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>         at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>         at
> org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:240)[79:org.ops4j.pax.web.pax-web-jetty:3.1.0]
>         at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>         at
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>         at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>         at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>         at
> org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:77)[79:org.ops4j.pax.web.pax-web-jetty:3.1.0]
>         at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>         at
> org.eclipse.jetty.server.Server.handle(Server.java:370)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:982)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>         at
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1043)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>         at
> org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>         at
> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>         at
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)[69:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]
>         at java.lang.Thread.run(Thread.java:744)[:1.7.0_51]
> Caused by: com.sun.mdm.index.master.ProcessingException:
> javax.xml.ws.soap.SOAPFaultException: Unmarshalling Error: unexpected
> element (uri:"", local:"predefinedSearchCriteria"). Expected elements are
> <{http://server.ws.workflow.mm.nextgate.com/}predefinedSearchCriteria>
>         at
> com.nextgate.mm.workflow.flex.WorkflowHandler.getPredefinedSearches(WorkflowHandler.java:418)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_51]
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_51]
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_51]
>         at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_51]
>         at
> flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:421)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
>         ... 46 more
> Caused by: javax.xml.ws.soap.SOAPFaultException: Unmarshalling Error:
> unexpected element (uri:"", local:"predefinedSearchCriteria"). Expected
> elements are
> <{http://server.ws.workflow.mm.nextgate.com/}predefinedSearchCriteria>
>         at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:157)
>         at com.sun.proxy.$Proxy117.getPredefinedTaskSearchCriteria(Unknown
> Source)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
>         at
> com.nextgate.mm.workflow.flex.WorkflowHandler.getPredefinedSearches(WorkflowHandler.java:410)[267:com.nextgate.mm.PersonDQM:1.0.0.SNAPSHOT]
>         ... 51 more
> Caused by: javax.xml.bind.UnmarshalException
>  - with linked exception:
> [javax.xml.bind.UnmarshalException: unexpected element (uri:"",
> local:"predefinedSearchCriteria"). Expected elements are
> <{http://server.ws.workflow.mm.nextgate.com/}predefinedSearchCriteria>]
>         at
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:425)
>         at
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:362)
>         at
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:339)
>         at
> org.apache.cxf.jaxb.JAXBEncoderDecoder.doUnmarshal(JAXBEncoderDecoder.java:842)[196:org.apache.cxf.cxf-rt-databinding-jaxb:2.7.10]
>         at
> org.apache.cxf.jaxb.JAXBEncoderDecoder.access$100(JAXBEncoderDecoder.java:101)[196:org.apache.cxf.cxf-rt-databinding-jaxb:2.7.10]
>         at
> org.apache.cxf.jaxb.JAXBEncoderDecoder$2.run(JAXBEncoderDecoder.java:870)
>         at java.security.AccessController.doPrivileged(Native Method)[:1.7.0_51]
>         at
> org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:868)[196:org.apache.cxf.cxf-rt-databinding-jaxb:2.7.10]
>         at
> org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:702)[196:org.apache.cxf.cxf-rt-databinding-jaxb:2.7.10]
>         at org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:160)
>         at
> org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:107)
>         at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
>         at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:835)
>         at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1614)
>         at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1504)
>         at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1310)
>         at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
>         at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:628)
>         at
> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
>         at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
>         at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:565)
>         at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:474)
>         at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:377)
>         at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:330)
>         at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
>         at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)
>         ... 53 more
> Caused by: javax.xml.bind.UnmarshalException: unexpected element (uri:"",
> local:"predefinedSearchCriteria"). Expected elements are
> <{http://server.ws.workflow.mm.nextgate.com/}predefinedSearchCriteria>
>         at
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:642)
>         at
> com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:254)
>         at
> com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:249)
>         at
> com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement(Loader.java:116)
>         at
> com.sun.xml.bind.v2.runtime.unmarshaller.Loader.childElement(Loader.java:101)
>         at
> com.sun.xml.bind.v2.runtime.unmarshaller.StructureLoader.childElement(StructureLoader.java:243)
>         at
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:478)
>         at
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:459)
>         at
> com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleStartElement(StAXStreamConnector.java:242)
>         at
> com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:176)
>         at
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:360)
>         ... 77 more
> Caused by: javax.xml.bind.UnmarshalException: unexpected element (uri:"",
> local:"predefinedSearchCriteria"). Expected elements are
> <{http://server.ws.workflow.mm.nextgate.com/}predefinedSearchCriteria>
>         ... 88 more
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/javax-xml-ws-soap-SOAPFaultException-Unmarshalling-Error-unexpected-element-tp5743794.html
> Sent from the cxf-user mailing list archive at Nabble.com.

Re: javax.xml.ws.soap.SOAPFaultException: Unmarshalling Error: unexpected element

Posted by asookazian <as...@gmail.com>.
OSGI-INF/blueprint/blueprint.xml:

<?xml version="1.0" encoding="UTF-8"?> 
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:jaxws="http://cxf.apache.org/blueprint/jaxws"
xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
  http://www.osgi.org/xmlns/blueprint-ext/v1.1.0
https://svn.apache.org/repos/asf/aries/tags/blueprint-0.3.1/blueprint-core/src/main/resources/org/apache/aries/blueprint/ext/blueprint-ext.xsd  
  http://cxf.apache.org/blueprint/jaxws
http://cxf.apache.org/schemas/blueprint/jaxws.xsd
  http://cxf.apache.org/blueprint/jaxrs
http://cxf.apache.org/schemas/blueprint/jaxrs.xsd
  http://cxf.apache.org/blueprint/core
http://cxf.apache.org/schemas/blueprint/core.xsd
  http://camel.apache.org/schema/blueprint
http://camel.apache.org/schema/blueprint/camel-blueprint.xsd
  http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0
http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd">
    <jaxws:endpoint
        address="/wf/WorkflowManagerWS"
	    implementor="com.nextgate.mm.workflow.ws.server.WorkflowManagerWS">
    </jaxws:endpoint>
</blueprint>



--
View this message in context: http://cxf.547215.n5.nabble.com/javax-xml-ws-soap-SOAPFaultException-Unmarshalling-Error-unexpected-element-tp5743794p5743796.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: javax.xml.ws.soap.SOAPFaultException: Unmarshalling Error: unexpected element

Posted by asookazian <as...@gmail.com>.
Add'l details:

ObjectFactory.java:

/**
     * Create an instance of {@link JAXBElement }{@code <}{@link
PredefinedSearchCriteria }{@code >}}
     * 
     */
    @XmlElementDecl(namespace =
"http://server.ws.workflow.mm.nextgate.com/", name =
"predefinedSearchCriteria")
    public JAXBElement<PredefinedSearchCriteria>
createPredefinedSearchCriteria(PredefinedSearchCriteria value) {
        return new
JAXBElement<PredefinedSearchCriteria>(_PredefinedSearchCriteria_QNAME,
PredefinedSearchCriteria.class, null, value);
    }

package-info.java:

@javax.xml.bind.annotation.XmlSchema(namespace =
"http://server.ws.workflow.mm.nextgate.com/")
package com.nextgate.mm.workflow.ws.server;




--
View this message in context: http://cxf.547215.n5.nabble.com/javax-xml-ws-soap-SOAPFaultException-Unmarshalling-Error-unexpected-element-tp5743794p5743795.html
Sent from the cxf-user mailing list archive at Nabble.com.