Announcement Announcement Module
Collapse
No announcement yet.
switch from rmiinvoker->httpinvoker causing serialization issue Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • switch from rmiinvoker->httpinvoker causing serialization issue

    This is a weird one...I am having a problem with using beanshell scripts and httpinvokers.

    My application is a java/spring/hibernate app with a swing front end.
    I have been using the spring lightweight remoting RMIInvoker to let
    the client talk to the server. I have migrated from RMIInvokers to using tomcat with the spring HTTPInvokers. After I made the configuration changes
    everything in my application works except executing the beanshell scripts.

    I have been using beanshell scripts for years now. The way I use them
    is that I have a set of scripts that each do some auditing procedure
    in my application. Each user can select which scripts to use when
    running their audit. They are executed on the server side.

    Now when I execute them I get the serialization error below. It is
    odd because the RMIInvokers depend on serialization as well so I don't
    see why that change would cause such an issue but apparently the
    mechanism works differently. I think the problem occurs when the beanshell script makes a call using one of my DAO service objects which is injected into the beanshell script. Again this worked for years under RMIInvokers.

    I am totally stuck right now. Any ideas for solutions?


    Code:
    java.io.NotSerializableException: bsh.CallStack
           at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
           at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
           at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
           at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
           at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
           at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
           at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:391)
           at java.lang.Throwable.writeObject(Throwable.java:649)
           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:585)
           at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:917)
           at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1339)
           at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
           at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
           at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
           at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:391)
           at java.lang.Throwable.writeObject(Throwable.java:649)
           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:585)
           at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:917)
           at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1339)
           at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
           at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
           at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
           at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
           at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
           at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
           at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
           at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
           at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
           at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
           at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
           at org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter.doWriteRemoteInvocationResult(HttpInvokerServiceExporter.java:309)
           at org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter.writeRemoteInvocationResult(HttpInvokerServiceExporter.java:258)
           at org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter.writeRemoteInvocationResult(HttpInvokerServiceExporter.java:234)
           at org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter.handleRequest(HttpInvokerServiceExporter.java:118)
           at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:49)
           at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:819)
           at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:754)
           at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:399)
           at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:364)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
           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:128)
           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:286)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
           at java.lang.Thread.run(Thread.java:595)

  • #2
    The problem seems to incur when I have a little incestual calling of a service class wrapped in an httpinvoker. The a method in service class A is called, then it invokes another service that has service class A injected into it. When service class A is called from the other service class it throws the error.

    Pretty odd, I think i can change how the calls are structured to get around it but there must be something different about the httpinvoker serialization as compared to the rmi invokers.

    Comment

    Working...
    X