I've got a JEE 5.2 application that ran fine under Glassfish that I'm trying to regress to run under JBoss 4.2.1.GA (because while Glassfish may completely implement EE 5, it's exasperatingly unstable).
I've read a number of complaints about ClassCastExceptions involved with JNDI lookups, and how they're related either to the lack of a .../remote or .../local suffix on the JNDI name, or to classes loaded by different classloaders. I've tried to take care of all that. Here's (part of) my global JNDI namespace:
+- BackEnd (class: org.jnp.interfaces.NamingContext) | +- GeneralService (class: org.jnp.interfaces.NamingContext) | | +- remote (proxy: $Proxy97 implements interface pkg.GeneralService,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBObject)
java.lang.ClassCastException: $Proxy97 cannot be cast to pkg.GeneralService