0 Replies Latest reply on Aug 14, 2005 9:18 PM by Alan Ho

    EJB3 Problem Returning Collection of Object from Session Bea

    Alan Ho Newbie

      I encountered problem when a session bean returns a collection of object or even an object instance if the session bean method (for example find) is called by a servlet residing in another server. This probelm did not appear when the servlet is deployed in the web container in JBOSS AS. The exception error is "java.lang.reflect.UndeclaredThrowableException".

      The console display the following message:

      at $Proxy119.getAccounts1(Unknown Source)
      at org.apache.jsp.accountsetup_jsp._jspService(org.apache.jsp.accountset
      up_jsp:139)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
      .java:322)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
      14)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:173)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi
      lter.java:81)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
      alve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
      alve.java:178)
      at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrinc
      ipalValve.java:39)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit
      yAssociationValve.java:153)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
      e.java:59)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
      ava:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
      ava:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
      ve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
      a:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
      :856)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
      ssConnection(Http11Protocol.java:744)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo
      int.java:527)
      at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWor
      kerThread.java:112)
      at java.lang.Thread.run(Thread.java:595)
      09:15:41,843 ERROR [SocketClientInvoker] Got marshalling exception, exiting
      java.lang.ClassNotFoundException: No ClassLoaders found for: example.bean.entity
      .AccountDetails
      at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:292)
      at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryCl
      assLoader.java:475)
      at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassL
      oader.java:377)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:242)
      at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:574)
      at org.jboss.remoting.loading.ObjectInputStreamWithClassLoader.resolveCl
      ass(ObjectInputStreamWithClassLoader.java:102)
      at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:153
      8)
      at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
      693)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
      at java.util.ArrayList.readObject(ArrayList.java:592)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:919
      )
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1813)

      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
      713)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
      at org.jboss.aop.joinpoint.InvocationResponse.readExternal(InvocationRes
      ponse.java:107)
      at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:175
      3)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
      711)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:19
      12)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)

      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
      713)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
      at org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.read
      (SerializableUnMarshaller.java:72)
      at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(Soc
      ketClientInvoker.java:244)
      at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.jav
      a:117)
      at org.jboss.remoting.Client.invoke(Client.java:201)
      at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemot
      eInterceptor.java:41)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
      java:88)
      at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPr
      opagationInterceptor.java:46)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
      java:88)
      at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityC
      lientInterceptor.java:40)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
      java:88)
      at org.jboss.aspects.remoting.IsLocalInterceptor.invoke(IsLocalIntercept
      or.java:34)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
      java:88)
      at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteP
      roxy.java:79)
      at $Proxy119.getAccounts1(Unknown Source)
      at org.apache.jsp.accountsetup_jsp._jspService(org.apache.jsp.accountset
      up_jsp:139)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
      .java:322)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
      14)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:173)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi
      lter.java:81)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
      alve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
      alve.java:178)
      at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrinc
      ipalValve.java:39)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit
      yAssociationValve.java:153)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
      e.java:59)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
      ava:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
      ava:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
      ve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
      a:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
      :856)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
      ssConnection(Http11Protocol.java:744)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo
      int.java:527)
      at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWor
      kerThread.java:112)
      at java.lang.Thread.run(Thread.java:595)
      09:15:41,859 ERROR [SocketClientInvoker] Error loading classes from remote call
      result.
      java.lang.ClassNotFoundException: No ClassLoaders found for: example.bean.entity
      .AccountDetails
      at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:292)
      at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryCl
      assLoader.java:475)
      at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassL
      oader.java:377)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:242)
      at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:574)
      at org.jboss.remoting.loading.ObjectInputStreamWithClassLoader.resolveCl
      ass(ObjectInputStreamWithClassLoader.java:102)
      at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:153
      8)
      at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
      693)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
      at java.util.ArrayList.readObject(ArrayList.java:592)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:919
      )
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1813)

      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
      713)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
      at org.jboss.aop.joinpoint.InvocationResponse.readExternal(InvocationRes
      ponse.java:107)
      at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:175
      3)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
      711)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:19
      12)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)

      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
      713)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
      at org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.read
      (SerializableUnMarshaller.java:72)
      at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(Soc
      ketClientInvoker.java:244)
      at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.jav
      a:117)
      at org.jboss.remoting.Client.invoke(Client.java:201)
      at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemot
      eInterceptor.java:41)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
      java:88)
      at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPr
      opagationInterceptor.java:46)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
      java:88)
      at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityC
      lientInterceptor.java:40)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
      java:88)
      at org.jboss.aspects.remoting.IsLocalInterceptor.invoke(IsLocalIntercept
      or.java:34)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
      java:88)
      at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteP
      roxy.java:79)
      at $Proxy119.getAccounts1(Unknown Source)
      at org.apache.jsp.accountsetup_jsp._jspService(org.apache.jsp.accountset
      up_jsp:139)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
      .java:322)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
      14)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:173)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi
      lter.java:81)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
      alve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
      alve.java:178)
      at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrinc
      ipalValve.java:39)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit
      yAssociationValve.java:153)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
      e.java:59)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
      ava:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
      ava:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
      ve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
      a:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
      :856)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
      ssConnection(Http11Protocol.java:744)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo
      int.java:527)
      at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWor
      kerThread.java:112)
      at java.lang.Thread.run(Thread.java:595)