----- Original Message -----
Sent: Sunday, November 03, 2002 9:31
AM
Subject: [JBoss-user] ClassCastException
on redeploy of .ear
Hello
all,
Using jboss-3.0.0_tomcat-4.0.3, I am trying to access a Session
bean called Registration from within a servlet, both of which are part of an
application called pc, deployed as pc.ear. Here is the code I’m using to do
it:
Context jndiContext = getInitialContext();
Object ref =
jndiContext.lookup("RegistrationHomeRemote");
RegistrationHomeRemote
registrationHome =
(RegistrationHomeRemote)
PortableRemoteObject.narrow(ref,RegistrationHomeRemote.class);
RegistrationRemote registration = registrationHome.create();
registration.remove();
Everything works fine when I start jboss fresh and deploy the ear.
However, as soon as I make a change to any file and re-deploy the ear, I get a
ClassCastException at the third line.
I’m totally stumped – why would it work on initial deployment, then
stop working on re-deployment???
Any help would be most appreciated.
My
deployment configuration files are as follows:
ejb.jar:
<session>
<display-name>Registration</display-name>
<ejb-name>Registration</ejb-name>
<home>com.pc.ejb.session.interfaces.RegistrationHomeRemote</home>
<remote>com.pc.ejb.session.interfaces.RegistrationRemote</remote>
<ejb-class>com.pc.ejb.session.beans.RegistrationBean</ejb-class>
<session-type>Stateful</session-type>
<transaction-type>Container</transaction-type>
</session>
jboss.xml:
<session>
<ejb-name>Registration</ejb-name>
<jndi-name>RegistrationHomeRemote</jndi-name>
</session>
web.xml:
<servlet>
<servlet-name>RegistrationServlet</servlet-name>
<servlet-class>com.pc.servlets.RegistrationServlet</servlet-class>
</servlet>
<ejb-ref>
<ejb-ref-name>Registration</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>RegistrationHomeRemote</home>
<remote>RegistrationRemote</remote>
<ejb-link>Registration</ejb-link>
</ejb-ref>
jboss-web.xml:
<ejb-ref>
<ejb-ref-name>Registration</ejb-ref-name>
<jndi-name>pc/RegistrationHomeRemote</jndi-name>
</ejb-ref>