我目前正在将Web服务从Websphere 7迁移到Websphere 8.5.5.2 该应用程序在版本7中工作,但不完全在8.5
它在happy路径中工作,但是当我想抛出SOAPFault时会生成IllegalStateException。
我很乐意提供更多信息,但我不确定相关内容。
web.xml 版本为2.5,但我也尝试了3.0版
<web-app id="WebApp_ID" version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
使用@ javax.jws.WebService注释webservice并使用本地ejb注入
@javax.ejb.Stateless
@javax.jws.WebService(endpointInterface = "com.example.DialogService", targetNamespace = "http://services.example.com/DialogService", serviceName = "DialogService", portName = "DialogService")
public class DialogServiceImpl {
@EJB
Service service;
public DialogResponseType get(DialogRequestType dialogMessage) throws DialogMessageFault {
try {
DialogMsg response = service.process(dialogMessage);
return response.respond();
} catch (Exception e) {
DialogMessageFault dialogMessageFault = new DialogMessageFault(SERVICE_ERROR, e);
throw dialogMessageFault;
}
}
}
例外:
@javax.xml.ws.WebFault(name = "messageFault", targetNamespace = "http://services.example.com/DialogService")
public class DialogMessageFault extends Exception
堆栈跟踪:
AxisEngine E
org.apache.axis2.engine.AxisEngine receive java.lang.IllegalStateException: WSEJBEndpointManager.ejbPostInvoke already called.
org.apache.axis2.AxisFault: java.lang.IllegalStateException: WSEJBEndpointManager.ejbPostInvoke already called.
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at org.apache.axis2.jaxws.server.JAXWSMessageReceiver.receive(JAXWSMessageReceiver.java:242)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:212)
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172)
at com.ibm.ws.websvcs.transport.http.WASAxis2Servlet.doPost(WASAxis2Servlet.java:1583)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1235)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:779)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1071)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3837)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:981)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:459)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:526)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:312)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:283)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1864)
Caused by: javax.xml.ws.WebServiceException: java.lang.IllegalStateException: WSEJBEndpointManager.ejbPostInvoke already called.
at org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:175)
at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:70)
at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:128)
at org.apache.axis2.jaxws.server.EndpointController.responseReady(EndpointController.java:710)
at org.apache.axis2.jaxws.server.EndpointController.handleResponse(EndpointController.java:439)
at org.apache.axis2.jaxws.server.EndpointController.invoke(EndpointController.java:130)
at org.apache.axis2.jaxws.server.JAXWSMessageReceiver.receive(JAXWSMessageReceiver.java:161)
... 29 more
Caused by: java.lang.IllegalStateException: WSEJBEndpointManager.ejbPostInvoke already called.
at com.ibm.ejs.container.WSEJBWrapper.ejbPostInvoke(WSEJBWrapper.java:246)
at com.ibm.ws.websvcs.server.WSEJBInvocationListener.responseReady(WSEJBInvocationListener.java:416)
at com.ibm.ws.websvcs.server.WSEJBInvocationListener.notify(WSEJBInvocationListener.java:102)
at org.apache.axis2.jaxws.server.EndpointController.responseReady(EndpointController.java:707)
... 32 more
答案 0 :(得分:0)
显然,应用程序使用了额外的设置来防止早期版本的Websphere中出现这种确切的异常。删除此设置可解决问题:
com.ibm.websphere.websvcs.EJBPostInvokeCallOnException
请参阅:IBM PM59231