1 Reply Latest reply on Dec 23, 2004 3:56 AM by Oscar Herrera

    java.lang.reflect.UndeclaredThrowableException???

    Kunarak Osatapirat Newbie

      my EAR was work on JBoss 3.2.5 but when i changed to 4.0

      i got an UndeclaredThrowableException while my Servlet calling ejb method that return custom type(already implements Serializable).


      16:45:30,812 INFO [STDOUT] java.lang.reflect.UndeclaredThrowableException
      16:45:30,812 INFO [STDOUT] at $Proxy122.getResultsAt(Unknown Source)
      16:45:30,812 INFO [STDOUT] at tu.cs.ips.search.web.SearchServlet.service(SearchServlet.java:141)
      16:45:30,812 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
      16:45:30,812 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      16:45:30,812 INFO [STDOUT] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
      16:45:30,828 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
      16:45:30,828 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      16:45:30,828 INFO [STDOUT] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
      16:45:30,828 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      16:45:30,828 INFO [STDOUT] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      16:45:30,828 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
      16:45:30,828 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
      16:45:30,828 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      16:45:30,828 INFO [STDOUT] at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:44)
      16:45:30,828 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      16:45:30,828 INFO [STDOUT] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:169)
      16:45:30,828 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      16:45:30,828 INFO [STDOUT] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      16:45:30,828 INFO [STDOUT] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
      16:45:30,828 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      16:45:30,828 INFO [STDOUT] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
      16:45:30,828 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      16:45:30,828 INFO [STDOUT] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      16:45:30,828 INFO [STDOUT] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      16:45:30,828 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      16:45:30,828 INFO [STDOUT] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      16:45:30,828 INFO [STDOUT] at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
      16:45:30,828 INFO [STDOUT] at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
      16:45:30,828 INFO [STDOUT] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
      16:45:30,828 INFO [STDOUT] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
      16:45:30,828 INFO [STDOUT] at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
      16:45:30,828 INFO [STDOUT] at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
      16:45:30,828 INFO [STDOUT] at java.lang.Thread.run(Unknown Source)
      16:45:30,828 INFO [STDOUT] Caused by: java.io.NotSerializableException: tu.cs.ips.search.ejb.Product
      16:45:30,828 INFO [STDOUT] at java.io.ObjectOutputStream.writeObject0(Unknown Source)
      16:45:30,828 INFO [STDOUT] at java.io.ObjectOutputStream.writeArray(Unknown Source)
      16:45:30,828 INFO [STDOUT] at java.io.ObjectOutputStream.writeObject0(Unknown Source)
      16:45:30,828 INFO [STDOUT] at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
      16:45:30,828 INFO [STDOUT] at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
      16:45:30,828 INFO [STDOUT] at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
      16:45:30,828 INFO [STDOUT] at java.io.ObjectOutputStream.writeObject0(Unknown Source)
      16:45:30,828 INFO [STDOUT] at java.io.ObjectOutputStream.writeObject(Unknown Source)
      16:45:30,828 INFO [STDOUT] at org.jboss.invocation.MarshalledValue.<init>(MarshalledValue.java:57)
      16:45:30,828 INFO [STDOUT] at org.jboss.invocation.MarshallingInvokerInterceptor.invoke(MarshallingInvokerInterceptor.java:56)
      16:45:30,828 INFO [STDOUT] at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
      16:45:30,828 INFO [STDOUT] at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
      16:45:30,828 INFO [STDOUT] at org.jboss.proxy.ejb.StatefulSessionInterceptor.invoke(StatefulSessionInterceptor.java:106)
      16:45:30,828 INFO [STDOUT] at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
      16:45:30,828 INFO [STDOUT] ... 33 more


      i think exception occur while my bean return the object to servlet or i do something missing.

      any help will be appreciate.
      thank you very much

        • 1. Re: java.lang.reflect.UndeclaredThrowableException???
          Oscar Herrera Newbie

          I had the same problem. Actually I was using Log4J on an own exception class, so I had a class field called like this:

          private Logger log = null;


          Actually, besides being implementing the serializable interface, Logger is not serializable so the class couldn't be serialized at all. You can solve it then just by adding the word transient after private, something like:

          private transient Logger log = null;


          Doing this, you tell the VM it has not to serialize that field, and everything works fine. I hope this helps you.