3 Replies Latest reply on Jul 30, 2002 6:04 AM by Richard Vigniel

    hotdeploy and classloader problem

    Richard Vigniel Newbie

      hello

      I got problems while redeploying EJBs with custom types.
      here is an example:

      my EJB:
      public abstract class TestEJB implements javax.ejb.EntityBean {
      ...
      public abstract java.lang.Integer getId();
      public abstract void setId(java.lang.Integer id);

      public abstract CustomData getData();
      public abstract void setData(CustomData data);
      ...
      }

      my class CustomData:
      public class CustomData implements java.io.Serializable {

      private String name;
      private byte[] rawdata;
      ...
      }

      I create an EJB instance, which is correctly stored and read.
      then I redeploy (hot deploy) my application, without any change and without restarting the jboss server.
      when I try to get an EJB, I get the following errors:

      2002-07-29 12:13:37,498 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.Test] Executing SQL: SELECT data FROM test WHERE (id=?)
      2002-07-29 12:13:37,526 WARN [org.jboss.jetty.Jetty] WARNING: Servlet Exception for /admin/testCustom.jsp
      java.lang.reflect.UndeclaredThrowableException
      at $Proxy172.getId(Unknown Source)
      at org.apache.jsp.testCustom$jsp._jspService(testCustom$jsp.java:70)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:371)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:613)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1387)
      at org.mortbay.jetty.servlet.FilterHandler$Chain.doFilter(FilterHandler.java:368)
      at org.mortbay.jetty.servlet.FilterHandler.handle(FilterHandler.java:228)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1387)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1326)
      at org.mortbay.http.HttpServer.service(HttpServer.java:757)
      at org.jboss.jetty.Jetty.service(Jetty.java:528)
      at org.mortbay.http.HttpConnection.service(HttpConnection.java:741)
      at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:914)
      at org.mortbay.http.HttpConnection.handle(HttpConnection.java:756)
      at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:151)
      at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:287)
      at org.mortbay.util.ThreadPool$JobRunner.run(ThreadPool.java:715)
      at java.lang.Thread.run(Thread.java:536)
      Caused by: java.rmi.ServerException: Internal error getting results for field member data; CausedByException is:
      Got a test.CustomData: 'test.CustomData@5268d7' while looking for a test.CustomData; nested exception is:
      javax.ejb.EJBException: Internal error getting results for field member data; CausedByException is:
      Got a test.CustomData: 'test.CustomData@5268d7' while looking for a test.CustomData
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:119)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:176)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:61)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:129)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:183)
      at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493)
      at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invoke(BaseLocalContainerInvoker.java:296)
      at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38)
      ... 24 more
      Caused by: javax.ejb.EJBException: Internal error getting results for field member data; CausedByException is:
      Got a test.CustomData: 'test.CustomData@5268d7' while looking for a test.CustomData
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.loadArgumentResults(JDBCAbstractCMPFieldBridge.java:360)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.loadInstanceResults(JDBCAbstractCMPFieldBridge.java:304)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:142)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:62)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadEntity(JDBCStoreManager.java:572)
      at org.jboss.ejb.plugins.CMPPersistenceManager.loadEntity(CMPPersistenceManager.java:410)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.loadEntity(CachedConnectionInterceptor.java:353)
      at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:262)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:152)
      at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:107)
      at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:69)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:96)
      ... 31 more


      if I restart the jboss server, everything is ok, I can get my EJBs without any problem.

      the line
      "Got a test.CustomData: 'test.CustomData@5268d7' while looking for a test.CustomData;"
      make me think this may be a classloader problem, there may be two instances of the class "test.CustomData" in two different classloaders.

      i'm using jboss3.0.1RC1 with jdk1.4.0-b92 on linux RH7.3

      anybody else has this problem ? should i file a bug ?

      this is quite annoying, since I must restart the server after each application update, hotdeploy feature is useless in this case...

      thanks.
      richard

        • 1. Re: hotdeploy and classloader problem
          Richard Vigniel Newbie

          I tried with current cvs HEAD revision, I get the same kind of errors with more details:

          2002-07-29 14:11:19,680 ERROR [org.jboss.ejb.plugins.LogInterceptor] EJBException, causedBy:
          java.sql.SQLException: Got a test.CustomData: 'test.CustomData@b5ac2c' while looking for a test.CustomData
          at org.jboss.ejb.plugins.cmp.jdbc.JDBCUtil.coerceToJavaType(JDBCUtil.java:457)
          at org.jboss.ejb.plugins.cmp.jdbc.JDBCUtil.getResult(JDBCUtil.java:327)
          at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.loadArgumentResults(JDBCAbstractCMPFieldBridge.java:350)
          at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.loadInstanceResults(JDBCAbstractCMPFieldBridge.java:304)
          at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:142)
          at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:62)
          at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadEntity(JDBCStoreManager.java:572)
          at org.jboss.ejb.plugins.CMPPersistenceManager.loadEntity(CMPPersistenceManager.java:410)
          at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.loadEntity(CachedConnectionInterceptor.java:353)
          at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:262)
          at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
          at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:152)
          at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:107)
          at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:69)
          at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:108)
          at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:179)
          at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:61)
          at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
          at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:204)
          at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:154)
          at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:481)
          at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:351)
          at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38)
          at $Proxy36.getId(Unknown Source)
          at org.apache.jsp.testCustom$jsp._jspService(testCustom$jsp.java:70)
          at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
          at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
          at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
          at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
          at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:348)
          at org.mortbay.jetty.servlet.WebApplicationHandler.handle(WebApplicationHandler.java:312)
          at org.mortbay.http.HttpContext.handle(HttpContext.java:1572)
          at org.mortbay.http.HttpContext.handle(HttpContext.java:1512)
          at org.mortbay.http.HttpServer.service(HttpServer.java:792)
          at org.jboss.jetty.Jetty.service(Jetty.java:531)
          at org.mortbay.http.HttpConnection.service(HttpConnection.java:784)
          at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:941)
          at org.mortbay.http.HttpConnection.handle(HttpConnection.java:799)
          at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:182)
          at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:322)
          at org.mortbay.util.ThreadPool$JobRunner.run(ThreadPool.java:713)
          at java.lang.Thread.run(Thread.java:536)
          2002-07-29 14:11:19,704 WARN [org.jboss.jbossweb] WARNING: Exception for /testCustom/testCustom.jsp
          javax.ejb.EJBException: Internal error getting results for field member data; CausedByException is:
          Got a test.CustomData: 'test.CustomData@b5ac2c' while looking for a test.CustomData
          at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.loadArgumentResults(JDBCAbstractCMPFieldBridge.java:360)
          at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.loadInstanceResults(JDBCAbstractCMPFieldBridge.java:304)
          at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:142)
          at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:62)
          at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadEntity(JDBCStoreManager.java:572)
          at org.jboss.ejb.plugins.CMPPersistenceManager.loadEntity(CMPPersistenceManager.java:410)
          at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.loadEntity(CachedConnectionInterceptor.java:353)
          at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:262)
          at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
          at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:152)
          at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:107)
          at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:69)
          at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:108)
          at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:179)
          at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:61)
          at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
          at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:204)
          at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:154)
          at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:481)
          at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:351)
          at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38)
          at $Proxy36.getId(Unknown Source)
          at org.apache.jsp.testCustom$jsp._jspService(testCustom$jsp.java:70)
          at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
          at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
          at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
          at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
          at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:348)
          at org.mortbay.jetty.servlet.WebApplicationHandler.handle(WebApplicationHandler.java:312)
          at org.mortbay.http.HttpContext.handle(HttpContext.java:1572)
          at org.mortbay.http.HttpContext.handle(HttpContext.java:1512)
          at org.mortbay.http.HttpServer.service(HttpServer.java:792)
          at org.jboss.jetty.Jetty.service(Jetty.java:531)
          at org.mortbay.http.HttpConnection.service(HttpConnection.java:784)
          at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:941)
          at org.mortbay.http.HttpConnection.handle(HttpConnection.java:799)
          at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:182)
          at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:322)
          at org.mortbay.util.ThreadPool$JobRunner.run(ThreadPool.java:713)
          at java.lang.Thread.run(Thread.java:536)
          java.sql.SQLException: Got a test.CustomData: 'test.CustomData@b5ac2c' while looking for a test.CustomData
          at org.jboss.ejb.plugins.cmp.jdbc.JDBCUtil.coerceToJavaType(JDBCUtil.java:457)
          at org.jboss.ejb.plugins.cmp.jdbc.JDBCUtil.getResult(JDBCUtil.java:327)
          at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.loadArgumentResults(JDBCAbstractCMPFieldBridge.java:350)
          at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.loadInstanceResults(JDBCAbstractCMPFieldBridge.java:304)
          at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:142)
          at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:62)
          at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadEntity(JDBCStoreManager.java:572)
          at org.jboss.ejb.plugins.CMPPersistenceManager.loadEntity(CMPPersistenceManager.java:410)
          at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.loadEntity(CachedConnectionInterceptor.java:353)
          at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:262)
          at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
          at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:152)
          at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:107)
          at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:69)
          at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:108)
          at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:179)
          at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:61)
          at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
          at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:204)
          at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:154)
          at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:481)
          at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:351)
          at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38)
          at $Proxy36.getId(Unknown Source)
          at org.apache.jsp.testCustom$jsp._jspService(testCustom$jsp.java:70)
          at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
          at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
          at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
          at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
          at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:348)
          at org.mortbay.jetty.servlet.WebApplicationHandler.handle(WebApplicationHandler.java:312)
          at org.mortbay.http.HttpContext.handle(HttpContext.java:1572)
          at org.mortbay.http.HttpContext.handle(HttpContext.java:1512)
          at org.mortbay.http.HttpServer.service(HttpServer.java:792)
          at org.jboss.jetty.Jetty.service(Jetty.java:531)
          at org.mortbay.http.HttpConnection.service(HttpConnection.java:784)
          at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:941)
          at org.mortbay.http.HttpConnection.handle(HttpConnection.java:799)
          at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:182)
          at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:322)
          at org.mortbay.util.ThreadPool$JobRunner.run(ThreadPool.java:713)
          at java.lang.Thread.run(Thread.java:536)

          • 2. Re: hotdeploy and classloader problem
            Dain Sundstrom Master

            Can you post a bug report on this?

            • 3. Re: hotdeploy and classloader problem
              Richard Vigniel Newbie

              ok it's done

              request ID = 588451