6 Replies Latest reply on May 31, 2013 9:25 PM by Stephen Coy

    "JBAS014154: Failed to marshal EJB parameters" when invoking methods in remote EJB interfaces using EJB 2.1

    kayko_orrister Newbie

      We are porting an application that uses EJB 2.0 from JBoss 6.1.1 to JBoss 7.1.x; we understand that we have to use EJB 2.1 when moving to JBoss 7.1.x.

       

      We have found that in this sample application, when we...

       

      - make a call through the remote interface of one entity bean, which...

      - returns a plain-old Java object that...

      - contains a reference to a local interface of an entity bean...

       

      we get the following exception:

       

      java.lang.RuntimeException: JBAS014154: Failed to marshal EJB parameters

             at org.jboss.as.ejb3.remote.LocalEjbReceiver.clone(LocalEjbReceiver.java:270)

             at org.jboss.as.ejb3.remote.LocalEjbReceiver.clone(LocalEjbReceiver.java:259)

             at org.jboss.as.ejb3.remote.LocalEjbReceiver.processInvocation(LocalEjbReceiver.java:231)

             at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:179)

             at org.jboss.ejb.client.TransactionInterceptor.handleInvocation(TransactionInterceptor.java:43)

             at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:181)

             at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:125)

             at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:181)

             at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:136)

             at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:121)

             at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:104)

             at $Proxy14.returnPlainOldJavaObject(Unknown Source)

             at example.cannotmarshal.Controller.processRequest(Controller.java:57)

             at example.cannotmarshal.Controller.doGet(Controller.java:32)

             at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)

             at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)

             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)

             at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)

             at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)

             at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)

             at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)

             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:368)

             at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)

             at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:679)

             at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:931)

             at java.lang.Thread.run(Thread.java:662)

      Caused by: java.io.NotSerializableException: example.cannotmarshal.EntityBeanA.EntityBeanALocal$$$view7

             at org.jboss.marshalling.cloner.SerializingCloner.clone(SerializingCloner.java:255)

             at org.jboss.marshalling.cloner.SerializingCloner.clone(SerializingCloner.java:134)

             at org.jboss.marshalling.cloner.SerializingCloner.cloneFields(SerializingCloner.java:348)

             at org.jboss.marshalling.cloner.SerializingCloner.initSerializableClone(SerializingCloner.java:309)

             at org.jboss.marshalling.cloner.SerializingCloner.clone(SerializingCloner.java:253)

             at org.jboss.marshalling.cloner.SerializingCloner.clone(SerializingCloner.java:134)

             at org.jboss.as.ejb3.remote.LocalEjbReceiver.clone(LocalEjbReceiver.java:268)

             ... 28 more

       

      Some peculiarities that we've noticed in conjunction with this exception:

       

      - We have to make the plain-old Java object serializable ("implements java.lang.Serializable") or else we get a different "JBAS014154: Failed to marshal EJB parameters" exception complaining that it is not serializable.  This is something that we did not have to do on JBoss 6.1.1, Weblogic or Websphere, and appears to be a requirement of EJB 3.x rather than EJB 2.1.

      - We've marked the plain-old Java object as serializable in order to proceed and gotten the above exception, which complains about a proxy not being serializable, which we don't have control over.

       

      As it appears that it is imposing EJB 3.x restrictions on our remote interface calls, and also on this internal JBoss $$$view object as well, this looks like a bug, but I'd like to confirm.  We found a similar problem reported here that indicated that the best place to initially discuss the problem would be this forum:

       

      https://issues.jboss.org/browse/AS7-6793 

       

      We have built a small, distilled sample application to demonstrate this exception, and can submit it - please advise as to the preferred method of doing so in these forums.

       

      The exception that is raised in our production application is similar, but it indicates that a different object should be marked serialiazble - ProxyInvocationHandler:

       

      javax.servlet.ServletException: java.lang.RuntimeException: JBAS014154: Failed to marshal EJB parameters

       

             [3 application-specific calls here]

       

             at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)

             at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)

             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)

             at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)

             at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)

             at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:489)

             at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)

             at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)

             at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

             at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:416)

             at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

             at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)

             at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)

             at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:679)

             at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:931)

             at java.lang.Thread.run(Thread.java:662)

      Caused by: java.lang.RuntimeException: JBAS014154: Failed to marshal EJB parameters

             at org.jboss.as.ejb3.remote.LocalEjbReceiver.clone(LocalEjbReceiver.java:270)

             at org.jboss.as.ejb3.remote.LocalEjbReceiver.clone(LocalEjbReceiver.java:259)

             at org.jboss.as.ejb3.remote.LocalEjbReceiver.processInvocation(LocalEjbReceiver.java:231)

             at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:179)

             at org.jboss.ejb.client.TransactionInterceptor.handleInvocation(TransactionInterceptor.java:43)

             at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:181)

             at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:125)

             at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:181)

             at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:136)

             at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:121)

             at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:104)

             at $Proxy21.unlock(Unknown Source)

       

             [1 application-specific call here]

       

             ... 19 more

      Caused by: java.io.NotSerializableException: org.jboss.as.ee.component.ProxyInvocationHandler

             at org.jboss.marshalling.cloner.SerializingCloner.clone(SerializingCloner.java:255)

             at org.jboss.marshalling.cloner.SerializingCloner.clone(SerializingCloner.java:134)

             at org.jboss.marshalling.cloner.SerializingCloner.cloneFields(SerializingCloner.java:348)

             at org.jboss.marshalling.cloner.SerializingCloner.initSerializableClone(SerializingCloner.java:309)

             at org.jboss.marshalling.cloner.SerializingCloner.clone(SerializingCloner.java:253)

             at org.jboss.marshalling.cloner.SerializingCloner.clone(SerializingCloner.java:134)

             at org.jboss.marshalling.cloner.SerializingCloner.cloneFields(SerializingCloner.java:348)

             at org.jboss.marshalling.cloner.SerializingCloner.initSerializableClone(SerializingCloner.java:309)

             at org.jboss.marshalling.cloner.SerializingCloner.clone(SerializingCloner.java:253)

             at org.jboss.marshalling.cloner.SerializingCloner.clone(SerializingCloner.java:134)

             at org.jboss.as.ejb3.remote.LocalEjbReceiver.clone(LocalEjbReceiver.java:268)

             ... 31 more

       

      Due to the similarity, it looks like the problem in the sample may reveal something of the nature of the problem in the production application.  We've tried to get the same exception in the sample by approximating the conditions but we may need a little advice; in either case, the sample seems to demonstrate a potential bug in JBoss 7.1.x.