Announcement Announcement Module
Collapse
No announcement yet.
Business exception not received by client with Spring remoting Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Business exception not received by client with Spring remoting

    Hi all, I am sorry if this subject has already been addressed somewhere else in the forum.

    Our customer app accesses via Spring remoting HttpInvoker a service and everything works pretty well, but there is a problem: when the server part throws a business exception the client just receives a RemoteAccessException with no trace about the original error sent by the server. This business exception (CustomerException) is a runtime exception so it is not declared in the method signature definition in the service interface.

    The root cause stacktrace received by the client is the following:

    java.io.NotSerializableException: com.sun.xml.internal.messaging.saaj.soap.ver1_1.SO APPart1_1Impl
    at java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1156)
    at java.io.ObjectOutputStream.defaultWriteFields(Obje ctOutputStream.java:1509)
    at java.io.ObjectOutputStream.writeSerialData(ObjectO utputStream.java:1474)
    at java.io.ObjectOutputStream.writeOrdinaryObject(Obj ectOutputStream.java:1392)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1150)
    at java.io.ObjectOutputStream.defaultWriteFields(Obje ctOutputStream.java:1509)
    at java.io.ObjectOutputStream.defaultWriteObject(Obje ctOutputStream.java:416)
    at com.sun.org.apache.xerces.internal.dom.NodeImpl.wr iteObject(NodeImpl.java:2017)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at java.io.ObjectStreamClass.invokeWriteObject(Object StreamClass.java:945)
    at java.io.ObjectOutputStream.writeSerialData(ObjectO utputStream.java:1461)
    at java.io.ObjectOutputStream.writeOrdinaryObject(Obj ectOutputStream.java:1392)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1150)
    at java.io.ObjectOutputStream.defaultWriteFields(Obje ctOutputStream.java:1509)
    at java.io.ObjectOutputStream.writeSerialData(ObjectO utputStream.java:1474)
    at java.io.ObjectOutputStream.writeOrdinaryObject(Obj ectOutputStream.java:1392)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1150)
    at java.io.ObjectOutputStream.defaultWriteFields(Obje ctOutputStream.java:1509)
    at java.io.ObjectOutputStream.defaultWriteObject(Obje ctOutputStream.java:416)
    at java.lang.Throwable.writeObject(Throwable.java:648 )
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at java.io.ObjectStreamClass.invokeWriteObject(Object StreamClass.java:945)
    at java.io.ObjectOutputStream.writeSerialData(ObjectO utputStream.java:1461)
    at java.io.ObjectOutputStream.writeOrdinaryObject(Obj ectOutputStream.java:1392)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1150)
    at java.io.ObjectOutputStream.defaultWriteFields(Obje ctOutputStream.java:1509)
    at java.io.ObjectOutputStream.writeSerialData(ObjectO utputStream.java:1474)
    at java.io.ObjectOutputStream.writeOrdinaryObject(Obj ectOutputStream.java:1392)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1150)
    at java.io.ObjectOutputStream.defaultWriteFields(Obje ctOutputStream.java:1509)
    at java.io.ObjectOutputStream.writeSerialData(ObjectO utputStream.java:1474)
    at java.io.ObjectOutputStream.writeOrdinaryObject(Obj ectOutputStream.java:1392)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1150)
    at java.io.ObjectOutputStream.writeObject(ObjectOutpu tStream.java:326)
    at org.springframework.remoting.rmi.RemoteInvocationS erializingExporter.doWriteRemoteInvocationResult(R emoteInvocationSerializingExporter.java:158)
    at org.springframework.remoting.httpinvoker.HttpInvok erServiceExporter.writeRemoteInvocationResult(Http InvokerServiceExporter.java:174)
    at org.springframework.remoting.httpinvoker.HttpInvok erServiceExporter.writeRemoteInvocationResult(Http InvokerServiceExporter.java:150)
    at org.springframework.remoting.httpinvoker.HttpInvok erServiceExporter.handleRequest(HttpInvokerService Exporter.java:75)
    at org.springframework.web.servlet.mvc.HttpRequestHan dlerAdapter.handle(HttpRequestHandlerAdapter.java: 49)
    at org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:875)
    at org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:807)
    at org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:571)
    at org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:511)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:709)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:237)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:157)
    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:214)
    at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520)
    at org.apache.catalina.core.StandardContextValve.invo keInternal(StandardContextValve.java:198)
    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:152)
    at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520)
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:137)
    at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104)
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:118)
    at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:102)
    at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520)
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
    at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520)
    at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:929)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(Co yoteAdapter.java:160)
    at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:799)
    at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.processConnection(Http11Protocol.jav a:705)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(P oolTcpEndpoint.java:577)
    at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:683)
    at java.lang.Thread.run(Thread.java:619)

    Thanks in advance for any contribution
Working...
X