[jboss-user] [Installation, Configuration & DEPLOYMENT] - Another deployment ClassCastException

dnwiebe do-not-reply at jboss.com
Tue Aug 21 17:24:35 EDT 2007


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)
  | 

I recognize the stuff in bold: that's my stuff.  I'm careful to use the JNDI name only with the .../remote suffix, so as to grab something that's compatible with my GeneralService interface.

But during deployment, I get this exception when I try to cast the result of InitialContext.lookup () to pkg.GeneralService:


  | java.lang.ClassCastException: $Proxy97 cannot be cast to pkg.GeneralService
  | 

Can't be cast to it?  But the JNDI catalog says $Proxy97 implements it!  What's going on?  Is this an instance of the classloader incompatibility?  Why would JBoss be written to use two different classloaders in the process of loading an EJB from JNDI?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4076496#4076496

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4076496



More information about the jboss-user mailing list