So in your web application can you do the following?
Code:SecurityService securityService = (SecurityService)ctx.lookup("java:comp/env/schlange-security/SecurityServiceEjb/local");
So in your web application can you do the following?
Code:SecurityService securityService = (SecurityService)ctx.lookup("java:comp/env/schlange-security/SecurityServiceEjb/local");
Caleb Washburn
It might work, but certainly looks ugly.![]()
Spring, it's a wonderful thing...
Tiago Fernandez
http://www.tiago182.spyw.com
This doesn't work either, I can get another proxy instance looking up for "schlange-security/SecurityServiceEjb/local", which can be casted only to EJBLocalObject.
The global JNDI namespace in my JMX console looks like this:
Code:+- schlange-security (class: org.jnp.interfaces.NamingContext) | +- SecurityServiceEjb (class: org.jnp.interfaces.NamingContext) | | +- local (proxy: $Proxy99 implements interface org.schlange.security.server.SecurityService,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBLocalObject) | | +- remote (proxy: $Proxy97 implements interface org.schlange.security.server.SecurityService,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBObject)
Last edited by tiago182; Dec 22nd, 2006 at 06:29 PM. Reason: Missing part
Tiago Fernandez
http://www.tiago182.spyw.com
Did you end-up figuring out anything to fix this problem? I'm basically having the exact same issue. I guess I might have to start looking at the JBoss Spring deployment thing, though I'd rather not since this seems like a programming problem which can be fixed somehow.
Sorry, but at the end I left this aside because I've realised I didn't *really* need such EJB... Just in case, I've just tried it now within JBoss 4.2.2.GA and it still doesn't work: javax.naming.NameNotFoundException. Next time I shall try another application server (if I really need to use EJB3).
Tiago Fernandez
http://www.tiago182.spyw.com
Thanks for the quick reply. I guess I'll keep messing with this... argh...
Classloading issues with local ejbs are an old, long and sad story. What it boils down to is that you have 2 classloaders for your local interface and you cannot assign instance created in one classloader to a variable in other classloader. (Classes in different classloaders can never be the same class, no matter if they have the same qname or not - that's exactly why we have different classloaders)
Usually there is an option in your app server to turn off the local interface pass-by-ref optimization and use pass-by-value. (Let's ignore the fact that app server is fully aware of all the classloaders it created and could do this on it's own, if needed)