1 Reply Latest reply on Oct 31, 2011 3:58 AM by Wolf-Dieter Fink

    StackOverflowError Invoking a Method on an EJB

    Stephen Wick Newbie

      Hi,

       

      I hope you all are doing well today.

       

      I am having a problem invoking an EJB method remotely.

       

      I have 2 JBoss app servers, one hosting the EJB in an EAR and the other hosting a client application packaged as a WAR within an EAR.

       

      The client application creates an InitialContext that uses auto-discovery to connect to the HAJNDI service in the JBoss server containing the EJB.  Then the client gets the EJB by name from the InitialContext using the lookup(String name) method.  Once it has the EJB stub, it invokes a method, and that's where I am stuck.  Here's the error I'm getting...

      java.lang.StackOverflowError
              at java.lang.Exception.(Exception.java:77)
              at java.lang.reflect.InvocationTargetException.(InvocationTargetException.java:54)
              at sun.reflect.GeneratedMethodAccessor141.invoke(Unknown Source)
              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)
      ...repeats about 50 times...
              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 org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:184)
              at org.jboss.remoting.Client.invoke(Client.java:1936)
              at org.jboss.remoting.Client.invoke(Client.java:789)
              at org.jboss.invocation.unified.interfaces.UnifiedInvokerProxy.invoke(UnifiedInvokerProxy.java:184)
              at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:365)
              at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:197)
              at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
              at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
              at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:112)
              at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
              at $Proxy61.executeFlow(Unknown Source)
              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 com.hallmark.oms.ClusterCapableYantraEJBClient.invoke(ClusterCapableYantraEJBClient.java:207)
              at $Proxy62.executeFlow(Unknown Source)
              at com.hallmark.oms.OMSAdapterOrder.OrderList(OMSAdapterOrder.java:1855)
              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 com.hallmark.oms.OMSAdapterServlet.runService(OMSAdapterServlet.java:169)
              at com.hallmark.oms.OMSAdapterServlet.doPost(OMSAdapterServlet.java:54)
              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.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
              at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
              at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:437)
              at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:381)
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
              at java.lang.Thread.run(Thread.java:595)
      

       

      I am using JBoss EAP 4.3 from Redhat, and SUN JDK 1.5.0_08.

       

      Has anyone seen this issue before?  Does anyone know how to fix it?

       

      I'm glad to provide more information if necessary.

       

      Thanks!

       

       

       

      Message was edited by: Stephen Wick Removed several lines from the stack trace to reduce scrolling in the thread.

        • 1. Re: StackOverflowError Invoking a Method on an EJB
          Wolf-Dieter Fink Master

          Looks like that objects can not serialized because of recursion.

          Please describe where the Exception raise (I suppose in your WebApp on the first server) and attach the relevant source code.

           

          Please attach logs and code instead of paste it to comments because the thread will be come to a scroll hell.

           

          But if you use EAP and have a subscription you might raise a Red Hat support case.

          If you don't have a subscription you should use the community version of JBoss.

          1 of 1 people found this helpful