gpt4 book ai didi

java - 如何在 Apache Axis 上捕获 MessagingException

转载 作者:行者123 更新时间:2023-12-01 05:55:09 41 4
gpt4 key购买 nike

在我的 Axis 1.4 Web 服务上,当传入消息损坏时会引发此异常。

WARN ;2010-07-15 14:45:38,232;org.apache.axis.attachments.AttachmentsImpl;;Exception:
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: javax.mail.MessagingException: Error in input stream;
nested exception is:
java.io.IOException: End of stream encountered before final boundary marker.
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:javax.mail.MessagingException: Error in input stream;
nested exception is:
java.io.IOException: End of stream encountered before final boundary marker.
at javax.mail.internet.InternetHeaders.load(InternetHeaders.java:361)
at javax.mail.internet.InternetHeaders.<init>(InternetHeaders.java:310)
at org.apache.axis.attachments.MultiPartRelatedInputStream.readTillFound(MultiPartRelatedInputStream.java:499)
at org.apache.axis.attachments.MultiPartRelatedInputStream.readAll(MultiPartRelatedInputStream.java:433)
at org.apache.axis.attachments.MultiPartRelatedInputStream.getAttachments(MultiPartRelatedInputStream.java:439)
at org.apache.axis.attachments.AttachmentsImpl.mergeinAttachments(AttachmentsImpl.java:171)
at org.apache.axis.attachments.AttachmentsImpl.getAttachmentCount(AttachmentsImpl.java:550)
at org.apache.axis.Message.getAttachments(Message.java:689)
at prg.xft.in.attachments.ExtractAttachments.extract(ExtractAttachments.java:45)
at prg.xft.ib.In.inbound(In.java:79)
at prg.xft.ib.In.<init>(In.java:54)
at prg.skel.jiz.ServiceImpl.inbound(ServiceImpl.java:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:769)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:698)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.IOException: End of stream encountered before final boundary marker.
at org.apache.axis.attachments.BoundaryDelimitedStream.read(BoundaryDelimitedStream.java:308)
at org.apache.axis.attachments.BoundaryDelimitedStream.read(BoundaryDelimitedStream.java:358)
at org.apache.axis.attachments.BoundaryDelimitedStream.read(BoundaryDelimitedStream.java:370)
at com.sun.mail.util.LineInputStream.readLine(LineInputStream.java:84)
at javax.mail.internet.InternetHeaders.load(InternetHeaders.java:338)
... 42 more

我尝试在源代码中的不同位置多次捕获异常,但无法捕获它。堆栈跟踪仅出现在我的日志中。

最佳答案

我几乎可以肯定异常是在这个类中捕获的,并且 apache 记录器会打印堆栈跟踪。这是常见的做法。你将无法捕获它。

请参阅源代码以确保: http://kickjava.com/src/org/apache/axis/attachments/AttachmentsImpl.java.htm

关于java - 如何在 Apache Axis 上捕获 MessagingException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3255669/

41 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com