I have the same problem with JBoss 4.0.5 (ClassCastException when trying to narrow an EJB interface retrieved via a JNDI lookup).
As with you, my WAR and EJB are colocated in a single Jboss instance.
I figured setting "Call by Value" semantics everywhere would fix this (assuming the usual JBoss flat-classloader issues) - however that did not resolve the problem in 4.0.5 !?!?
Have you made any further progress ??
Yeah I actually got it to work. I modified some configurations. You can see the details here:
Hope this helps,
It seems you just mod'd the CallByValue semantics per your instructions:
- default/deploy/ear-deployer.xml - Isolated => true - CallByValue => true - default/conf/jboss-service.xml - NamingService: CallByValue => true - default/conf/jboss-minimal.xml - NamingService: CallByValue => true
This makes sense to do, however this references files that don't appear in my JBoss4.0.5GA - because I used the "jems-installer-1.2.0BETA3.jar" when I set up JBoss (and it re-arranges config files all over the shop for some reason).
I used the jems-installer to basically turn on "EJB3" mode in JBoss 4.0.5GA. Is there a better way of achieving EJB3/JEE5 in JBoss 4.0.5GA without using the jems-installer (I don't like the way it mangles the JBoss config files) ??
Hmmm...sorry David. That's where my knowledge stops. I haven't yet used EJB3 and don't know anything about jems.
hi i used the installer as well to take advantage of ejb3 and im having the same ClassCastException when narrowing. Have you been able to solve this?
i found a way around it, and it was a change to the way I initizlied my jndi context.
before i was doing:
Properties p = new Properties();
return new InitialContext(p);
now i just simply returned new InitialContext() without the properties.