【问题标题】:IllegalStateException: "WSEJBEndpointManager.ejbPostInvoke already called" while throwing @WebFaultIllegalStateException:“WSEJBEndpointManager.ejbPostInvoke 已调用”同时抛出 @WebFault
【发布时间】:2014-07-31 10:32:45
【问题描述】:

我目前正在将 Web 服务从 Websphere 7 迁移到 Websphere 8.5.5.2 该应用程序在版本 7 中工作,但在 8.5 中并不完全

它可以正常工作,但是当我想抛出 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">

webservice 使用@javax.jws.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

【问题讨论】:

  • 这似乎是产品问题。我建议与 IBM 建立 PMR。

标签: java web-services axis2 websphere-8


【解决方案1】:

显然,该应用程序使用了一个额外的设置来防止在早期版本的 Websphere 中出现这种确切的异常。删除此设置解决了问题:

com.ibm.websphere.websvcs.EJBPostInvokeCallOnException

见:IBM PM59231

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-22
    • 2019-06-10
    • 2015-02-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多