Hi all,
I'm using Jboss 3.0.4 w/ Tomcat 4.1.12, running Sun's JDK (build
1.4.0_01-b03), on Solaris 7. I have one ear file which contains a bunch
of local entity CMP 2.0 beans that access my database. I have a
separate ear file containing a session bean that looks the Entity beans
up via the global JNDI, and trys to use the local interface to do its
work.
The problem I'm encountering, is that if I redeploy the ear file
containing the entity beans without redeploying the ear containing the
session bean, when I go to retrieve my local interface via the following
code I get a ClassCastException:
private UserLocalHome getUserLocalHome()
throws NamingException
{
UserLocalHome home = null;
InitialContext ctx = new InitialContext();
try
{
home = (UserLocalHome)
PortableRemoteObject.narrow(
ctx.lookup("ejb/iaf/User"), UserLocalHome.class);
}
finally
{
ctx.close();
}
}
If I simply go and redeploy the ear containing the session bean after
that, everything works again. Is this supposed to happen and if so, can
somebody explain it. I know that class files have the notion of a
version, but the interface is really not changing at all between
redeployments, etc.
Also, I read on some jboss-user list archive of people experiencing
similar problems if the ear files contained jndi.properties files. I
have double-checked this and can assure you that neither of my .ear
files have this.
Thanks in advance for any help,
-Eric
Snippet from server.log w/ exception is attached
2003-01-29 13:56:07,328 ERROR [org.jboss.ejb.plugins.LogInterceptor] EJBException,
causedBy:
java.lang.ClassCastException
at
com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
at net.snet.ejb.ait.YahooMigrationManagerEJB.getUserLocalHome(Unknown Source)
at net.snet.ejb.ait.YahooMigrationManagerEJB.migrate(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:324)
at
org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:660)
at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
at
org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)
at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107)
at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60)
at
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:204)
at
org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)
at org.jboss.ejb.Container.invoke(Container.java:712)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:382)
at sun.reflect.GeneratedMethodAccessor58.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:536)