hotdeploy and classloader problem
rvigniel Jul 29, 2002 9:07 AMhello
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