soap client with cxf: Soap11FaultInInterceptor.unmarshalFault - soap

I am developing a SOAP client with Apache CXF. One method of the request returns me this stack in the client. With SOAPUI the same request returns me the expected response. Maybe I lost a library in JNLP? Maybe it is a binding problem?
2013-11-08 15:31:16,593 ERROR [es.isoftsanidad.eprescribe.comunclient.paneles.buscadorfarmacos.ListadoPF5Controlador] [setListaObjetos] Error en establecer el listado de los objetos
javax.xml.ws.soap.SOAPFaultException: Couldn't create SOAP message due to exception: Unable to create StAX reader or writer
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:157)
at
.....
Caused by: org.apache.cxf.binding.soap.SoapFault: Couldn't create SOAP message due to exception: Unable to create StAX reader or writer
at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:84)
at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:51)
at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:40)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:113)
at org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor.handleMessage(SOAPHandlerInterceptor.java:140)
at org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor.handleMessage(SOAPHandlerInterceptor.java:71)
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:1606)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1502)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1309)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:627)
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)

Check the logs on the server side. This is the message that the server is sending back in it's SOAP fault. Thus, something is happening on the server side that needs investigating.

Related

Why is the geoserver server status via web administration interface not displayed correctly/accessible?

I'm using geoserver-2.20.3.war together with Apache Tomcat/9.0.36 on Linux. Everything works as it should but if i try to access the server status via the web administration interface i only get Error messages. I can't really figure out the problem and how to fix it.
`HTTP Status 500 – Internal Server Error
Type Exception Report
Message Handler dispatch failed; nested exception is java.lang.InternalError: java.lang.reflect.InvocationTargetException
Beschreibung The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.InternalError: java.lang.reflect.InvocationTargetException
...
Root Cause
java.lang.InternalError: java.lang.reflect.InvocationTargetException
...
Root Cause
java.lang.reflect.InvocationTargetException
...
Root Cause
java.lang.NullPointerException
java.desktop/sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1262)
java.desktop/sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:225)
java.desktop/sun.awt.FontConfiguration.init(FontConfiguration.java:107)
java.desktop/sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:719)
...
I tried to find a similar issue but unfortunately did not stumble over something really helpful.
I found a solution! The problem were missing fonts. After following these very helpful steps by Andreas Ahlenstorf and installing the font-package dejavu-fonts on linux everything works fine.

How can invalid websocket requests be gracefully handled in Play 2.6?

We have a play 2.6 app which uses websockets. This is working great, but in our error logs we occasionally see the following:
[ERROR] [08/25/2017 16:00:44.770] [play-dev-mode-akka.actor.default-dispatcher-35] [akka.actor.ActorSystemImpl(play-dev-mode)] Internal server error, sending 500 response
java.lang.RuntimeException: WebSocket returned for non WebSocket request
at scala.sys.package$.error(package.scala:27)
at play.core.server.AkkaHttpServer.executeHandler(AkkaHttpServer.scala:271)
at play.core.server.AkkaHttpServer.handleRequest(AkkaHttpServer.scala:201)
at play.core.server.AkkaHttpServer.$anonfun$createServerBinding$3(AkkaHttpServer.scala:107)
at akka.stream.impl.fusing.MapAsync$$anon$23.onPush(Ops.scala:1172)
at akka.stream.impl.fusing.GraphInterpreter.processPush(GraphInterpreter.scala:499)
at akka.stream.impl.fusing.GraphInterpreter.processEvent(GraphInterpreter.scala:462)
at akka.stream.impl.fusing.GraphInterpreter.execute(GraphInterpreter.scala:368)
at akka.stream.impl.fusing.GraphInterpreterShell.runBatch(ActorGraphInterpreter.scala:571)
at akka.stream.impl.fusing.GraphInterpreterShell$AsyncInput.execute(ActorGraphInterpreter.scala:457)
at akka.stream.impl.fusing.GraphInterpreterShell.processEvent(ActorGraphInterpreter.scala:546)
at akka.stream.impl.fusing.ActorGraphInterpreter.akka$stream$impl$fusing$ActorGraphInterpreter$$processEvent(ActorGraphInterpreter.scala:725)
at akka.stream.impl.fusing.ActorGraphInterpreter$$anonfun$receive$1.applyOrElse(ActorGraphInterpreter.scala:740)
at akka.actor.Actor.aroundReceive(Actor.scala:513)
at akka.actor.Actcorrectlyor.aroundReceive$(Actor.scala:511)
at akka.stream.impl.fusing.ActorGraphInterpreter.aroundReceive(ActorGraphInterpreter.scala:650)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:527)
at akka.actor.ActorCell.invoke(ActorCell.scala:496)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:257)
at akka.dispatch.Mailbox.run(Mailbox.scala:224)
at akka.dispatch.Mailbox.exec(Mailbox.scala:234)
at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
After a little sleuthing it seems this occurs when an HTTP request without the correct Connection and/or Upgrade headers is made. The play source is here.
We would like to log more detailed information to determine why this is happening (we suspect header-stripping firewalls), but unfortunately our websocket handler is never invoked (nothing is printed to console) when the error occurs:
def ws = WebSocketcorrectly.acceptOrResult[String, String] { implicit request =>
println("Hello world") // Only printed for requests with valid headers
...
}
How can we insert some logging statements with access to the request headers and IP?

SOAPFaultException:Failed to send request while using the SOAP webservice

java.rmi.RemoteException: SOAP Fault:javax.xml.rpc.soap.SOAPFaultException: Failed to send request
Detail:
<detail><bea_fault:stacktrace xmlns:bea_fault="http://www.bea.com/servers/wls70/webservice/fault/1.0.0">java.net.ConnectException: Connection timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:559)
at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:141)
at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:272)
at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:329)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:172)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:911)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:158)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1014)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:230)
at weblogic.webservice.binding.http11.Http11ClientBinding.send(Http11ClientBinding.java:438)
at weblogic.webservice.core.handler.ClientHandler.handleRequest(ClientHandler.java:38)
at weblogic.webservice.core.HandlerChainImpl.handleRequest(HandlerChainImpl.java:144)
at weblogic.webservice.core.ClientDispatcher.send(ClientDispatcher.java:235)
at weblogic.webservice.core.ClientDispatcher.dispatch(ClientDispatcher.java:146)
at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:449)
at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:435)
at weblogic.webservice.core.rpc.StubImpl._invoke(StubImpl.java:306)
at com.cengage.ips.IPSInquiryWebServiceSoap_Stub.itemInquiry(IPSInquiryWebServiceSoap_Stub.java:64)
at main.java.com.cengage.ips.ServiceManager.getItemResponse(ServiceManager.java:57)
at main.java.com.cengage.ips.process.ResponseHandler.itemResponseHandler(ResponseHandler.java:49)
at main.java.com.cengage.ips.IPSIntegration.process(IPSIntegration.java:63)
at main.java.com.cengage.ips.IPSIntegration.run(IPSIntegration.java:37)
at main.java.com.cengage.ips.IPSIntegration.main(IPSIntegration.java:28)
</bea_fault:stacktrace></detail>; nested exception is:
javax.xml.rpc.soap.SOAPFaultException: Failed to send request
at com.cengage.ips.IPSInquiryWebServiceSoap_Stub.itemInquiry(IPSInquiryWebServiceSoap_Stub.java:69)
at main.java.com.cengage.ips.ServiceManager.getItemResponse(ServiceManager.java:57)
at main.java.com.cengage.ips.process.ResponseHandler.itemResponseHandler(ResponseHandler.java:49)
at main.java.com.cengage.ips.IPSIntegration.process(IPSIntegration.java:63)
at main.java.com.cengage.ips.IPSIntegration.run(IPSIntegration.java:37)
at main.java.com.cengage.ips.IPSIntegration.main(IPSIntegration.java:28)
Caused by: javax.xml.rpc.soap.SOAPFaultException: Failed to send request
at weblogic.webservice.core.ClientDispatcher.receive(ClientDispatcher.java:317)
at weblogic.webservice.core.ClientDispatcher.dispatch(ClientDispatcher.java:147)
at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:449)
at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:435)
at weblogic.webservice.core.rpc.StubImpl._invoke(StubImpl.java:306)
at com.cengage.ips.IPSInquiryWebServiceSoap_Stub.itemInquiry(IPSInquiryWebServiceSoap_Stub.java:64)
... 5 more
Am trying to use one SOAP web service. I have tried executing this application in my local windows machine using some cmd script file. Its working fine. But when i try in Unix server with shell script am getting the above error. Can someone please suggest the solution?

Producing SOAP webservices with spring-ws with Soap v1.2 instead of the default v1.1

I am currently working on Spring soap server project. I started off with the Getting Started guide from Spring here http://spring.io/guides/gs/producing-web-service/ to build a basic SOAP service.
The default SOAP protocol is SOAP v1.1. Is there a way I could set the protocol to v1.2, possibly via annotations?
I tried #BindingType(javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING) annotation on the #Endpoint class but it doesnt seem to work.
I also tried #Endpoint(value = SOAPBinding.SOAP12HTTP_BINDING) to set it, but this doesnt work either as seen in the logs on startup
INFO --- [nio-8080-exec-1] o.s.ws.soap.saaj.SaajSoapMessageFactory :
Creating SAAJ 1.3 MessageFactory with SOAP 1.1 Protocol
Ofcourse, if I post a SOAP request to the server, I get the following error
2015-01-19 15:50:17.610 ERROR 20172 --- [nio-8080-exec-1] c.sun.xml.internal.messaging.saaj.soap : SAAJ0533: Cannot create message: incorrect content-type for SOAP version. Got application/soap+xml;
charset=utf-8, but expected text/xml
2015-01-19 15:50:17.611 ERROR 20172 --- [nio-8080-exec-1] c.sun.xml.internal.messaging.saaj.soap :
SAAJ0535: Unable to internalize message
2015-01-19 15:50:17.617 ERROR 20172 --- [nio-8080-exec-1] a.c.c.C.[.[.[.[messageDispatcherServlet] :
Servlet.service() for servlet [messageDispatcherServlet] in context with path [] threw exception [R
equest processing failed; nested exception is org.springframework.ws.soap.SoapMessageCreationException: Could not create message from InputStream: Unable to internalize message; nested exception is com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Unable to internalize message] with root cause
com.sun.xml.internal.messaging.saaj.soap.SOAPVersionMismatchException: Cannot create message: incorrect content-type for SOAP version. Got: application/soap+xml; charset=utf-8 Expected: text/xml
at com.sun.xml.internal.messaging.saaj.soap.MessageImpl.init(Unknown Source)
at com.sun.xml.internal.messaging.saaj.soap.MessageImpl.<init>(Unknown Source)
at com.sun.xml.internal.messaging.saaj.soap.ver1_1.Message1_1Impl.<init>(Unknown Source)
at com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl.createMessage(Unknown Source)
Any help is appreciated.
Thanks!
You are mixing Spring-WS with annotations from JAX-WS (package javax.xml.ws). That won't work. To configure Spring-WS to use SOAP 1.2, add the following bean definition:
#Bean
public SaajSoapMessageFactory messageFactory() {
SaajSoapMessageFactory messageFactory = new SaajSoapMessageFactory();
messageFactory.setSoapVersion(SoapVersion.SOAP_12);
return messageFactory;
}
If the messageFactory Bean is not in the singleton scope, then the afterPropertiesSet() method in the SaajSoapMessageFactory is not called on bean instantation.
The afterPropertiesSet() method sets up an internal message factory. So if your messageFactory bean has its own scope you need to set up the internal message factory like this:
#Bean
#Scope("custom-scope")
public SaajSoapMessageFactory messageFactory() {
SaajSoapMessageFactory messageFactory = new SaajSoapMessageFactory();
messageFactory.messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
return messageFactory;
}
The messageFactory() #Bean is a necessary step, but isn't it also fundamental to add
wsdl11Definition.setCreateSoap12Binding(true);
to the service definition, to generate the appropriate soap 1.2 binding?
Anyway, thanks to Andreas Veithen

Unable to send a JMS message using WSO2 DSS output event trigger

I am using WSO2 DSS 3.2.1 and trying to configure an output event trigger with the following event sink URL:
jms:/ MyQueueName?transport.jms.DestinationType=queue&transport.jms.ContentTypeProperty=Content-Type&java.naming.provider.url=tcp://10.11.11.15:61616&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&transport.jms.ConnectionFactoryType=queue&transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory
but unable to make WSO2 DSS work in the way as expected:
TID: [0] [DSS] [2014-10-04 05:33:55,576] INFO {org.apache.axis2.deployment.DeploymentEngine} - Deploying Web service: EventingSample.dbs - file:/C:/WSO2DS~1.1/bin/../repository/deployment/server/dataservices/samples/EventingSample.dbs {org.apache.axis2.deployment.DeploymentEngine}
TID: [0] [DSS] [2014-10-04 05:34:06,371] ERROR {org.apache.axis2.description.ClientUtils} - The system cannot infer the transport information from the jms:/MyQueueName?transport.jms.DestinationType=queue&transport.jms.ContentTypeProperty=Content-Type&java.naming.provider.url=tcp://10.11.11.15:61616&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&transport.jms.ConnectionFactoryType=queue&transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory URL. {org.apache.axis2.description.ClientUtils}
TID: [0] [DSS] [2014-10-04 05:34:06,371] ERROR {org.wso2.carbon.event.ws.internal.notify.WSEventDispatcher} - Unable to send message {org.wso2.carbon.event.ws.internal.notify.WSEventDispatcher}
org.apache.axis2.AxisFault: The system cannot infer the transport information from the jms:/ MyQueueName?transport.jms.DestinationType=queue&transport.jms.ContentTypeProperty=Content-Type&java.naming.provider.url=tcp://10.11.11.15:61616&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&transport.jms.ConnectionFactoryType=queue&transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory URL.
at org.apache.axis2.description.ClientUtils.inferOutTransport(ClientUtils.java:81)
at org.apache.axis2.client.OperationClient.prepareMessageContext(OperationClient.java:288)
at org.apache.axis2.description.OutOnlyAxisOperationClient.executeImpl(OutOnlyAxisOperation.java:249)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at org.apache.axis2.client.ServiceClient.fireAndForget(ServiceClient.java:511)
at org.apache.axis2.client.ServiceClient.fireAndForget(ServiceClient.java:488)
at org.wso2.carbon.event.ws.internal.notify.WSEventDispatcher.sendNotification(WSEventDispatcher.java:96)
at org.wso2.carbon.event.ws.internal.notify.WSEventDispatcher.notify(WSEventDispatcher.java:66)
at org.wso2.carbon.event.core.internal.notify.CarbonNotificationManager.sendNotification(CarbonNotificationManager.java:62)
at org.wso2.carbon.event.core.internal.delivery.Worker.run(Worker.java:52)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
I have checked/confirmed that nothing is wrong on the Active MQ side, including ip address, port number, and queue name. And org.apache.axis2.transport.jms.JMSSender is also enabled. Appreciate any help on this issue.
By the way, I also took a working JMS endpoint URI already properly tested with WSO2 ESB but still got the same error with WSO2 DSS. It seems to me that something is wrong with WSO2 DSS JMS transport.
Above error was occurring because you have enabled the org.apache.axis2.transport.jms.JMSSender in the axis2.xml but not the axis2-client.xml. To use jms sender you need to enable the jms transport in axis2_client.xml.
I have retested the same use case with WSO2 DSS 3.2.2 and got the same error again .... a buggy product .... not recommend for a serious usage.