JBoss Community

Re: Overriding server libs in an EJB inside an EAR - 5.1.0.GA

created by Rodrigo Uchoa in JBoss Microcontainer - View the full discussion

Sorry for the delay. Had to leave work before I could answer you.

 

So, this is the piece of code I'm debugging, inside Ejb3Configuration.class:

 

                Class interceptor = classForName( interceptorName );

                cfg.setInterceptor( (Interceptor) interceptor.newInstance() );

 

According to the stack trace, line I get a ClassCastException in line two. As if my interceptor does not implement org.hibernate.Interceptor interface (which it does). The debug got me this:

 

interceptor.getClassLoader()

     (org.jboss.classloader.spi.base.BaseClassLoader) BaseClassLoader@a92653{vfsfile:/Users/rodrigouchoa/Java/jboss-5.1.0-dpf.GA/server/default/deploy/sinpi-packaging.ear/}

 

org.hibernate.Interceptor.class.getClassLoader()

     (org.jboss.classloader.spi.base.BaseClassLoader) BaseClassLoader@a92653{vfsfile:/Users/rodrigouchoa/Java/jboss-5.1.0-dpf.GA/server/default/deploy/sinpi-packaging.ear/}

 

If I'm not mistaken, this is normal. Both classes are coming from the same classloader, aren't they? There shouldn't be any problems. Any clues?

Reply to this message by going to Community

Start a new discussion in JBoss Microcontainer at Community