-
1. Re: Problems accessing jndi from war (not embedded in ear)
xnuandax Nov 9, 2006 2:01 AM (in response to frer)Hi,
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 ?? -
2. Re: Problems accessing jndi from war (not embedded in ear)
frer Nov 9, 2006 7:27 AM (in response to frer)Hi,
Yeah I actually got it to work. I modified some configurations. You can see the details here:
http://mail-archive.com/mdarad-toolbox-devs%40lists.sourceforge.net/msg00127.html
Hope this helps,
Francois -
3. Re: Problems accessing jndi from war (not embedded in ear)
xnuandax Nov 9, 2006 7:09 PM (in response to frer)Thanks Francois,
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) ??
Many thanks,
David -
4. Re: Problems accessing jndi from war (not embedded in ear)
frer Nov 9, 2006 10:27 PM (in response to frer)Hmmm...sorry David. That's where my knowledge stops. I haven't yet used EJB3 and don't know anything about jems.
-
5. Re: Problems accessing jndi from war (not embedded in ear)
philipwu Nov 12, 2006 10:45 PM (in response to frer)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?
Thanx -
6. Re: Problems accessing jndi from war (not embedded in ear)
philipwu Nov 12, 2006 10:53 PM (in response to frer)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();
p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
p.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
p.put(Context.PROVIDER_URL, "jnp://localhost:1099");
return new InitialContext(p);
now i just simply returned new InitialContext() without the properties.