I am migrating our application (ebj2 based) from JBoss 3.2.5/JDK 1.4 to JBoss 4.2/JDK 5. I am able to compile/build/deploy, and the application main page shows up after I start JBoss, but when I click on any of the options, I get the following JNDI lookup error. The application is working fine in JBoss 3.2.5/JDK 1.4 environment though, it's not working in JBoss 4.2/JDK 1.5, what do I need to do? Any help is greatly appreciated.
Error in JBoss Console
13:54:59,075 ERROR [STDERR] java.lang.ClassCastException
13:54:59,075 ERROR [STDERR] at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:229)
Code where it fails (on debugging):
Object ref = new InitialContext().lookup(commonTasks ("miscsqlsessionjndi"));
MiscSqlSessionHome home = (com.pmg.icustomer.db.MiscSqlSessionHome)PortableRemoteObject.narrow(ref, com.pmg.icustomer.db.MiscSqlSessionHome.class);
The ejb, home, remote interface is mapped properly in the ejb-jar.xml
<session id="Session_5"> <ejb-name>MiscSqlSessionBean</ejb-name> <home>com.pmg.icustomer.db.MiscSqlSessionHome</home> <remote>com.pmg.icustomer.db.MiscSqlSession</remote> <ejb-class>com.pmg.icustomer.db.MiscSqlSessionBean</ejb-class> <session-type>Stateless</session-type> <transaction-type>Container</transaction-type> </session>
<property> <name>MISCSQLSESSIONJNDI</name> <stringValue>pmg.db.MiscSqlSessionBean</stringValue> </property>