用于处理Axis2Fault的自定义错误页面,未找到EPR

时间:2013-07-04 06:50:54

标签: java web-services wsdl axis2

我创建了一个新的Web服务项目,工作正常,当尝试使用正确的URL访问时,我能够在浏览器上查看wsdl。

但是当键入错误的url时,浏览器上会显示堆栈跟踪,如下所示:

org.apache.axis2.AxisFault: The endpoint reference (EPR) for the Operation not found is //services/TestService?wsdlkdfl and the WSA Action = null. If this EPR was previously reachable, please contact the server administrator.
    at org.apache.axis2.engine.DispatchPhase.checkPostConditions(DispatchPhase.java:102)
    at org.apache.axis2.engine.Phase.invoke(Phase.java:329)
    at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:262)
    at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:168)
    at org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:144)
    at org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:139)
    at org.apache.axis2.transport.http.AxisServlet$RestRequestProcessor.processURLRequest(AxisServlet.java:837)
    at org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:273)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    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.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:947)

如何处理此方案以显示空白页而不是显示堆栈跟踪?

1 个答案:

答案 0 :(得分:0)

我能够通过更改axis2.xml文件解决此问题,如下所示:

" sendStacktraceDetailsWithFaults"参数to>假

" DrillDownToRootCauseForFaultReason"参数to>假

以前这两个参数都是正确的,因为整个堆栈跟踪都会显示出来。

希望这对有同样问题的人有所帮助。我在互联网上找不到多少。