[jboss-user] [Beginners Corner] - Lookup ejb by its COMP_NAME
kanth_seenu
do-not-reply at jboss.com
Fri Jul 13 09:34:34 EDT 2007
I have given the code that I used to lookup a bean by its COMP_NAME, after googling for several hours, posting this here to get some clues atleast.
Code:
Context initial = new InitialContext();
| Object objref = initial.lookup("java:comp/env/ejb/LicenseVerifier");
| LicenseVerifierLocalHome home = (LicenseVerifierLocalHome) objref;
| LicenseVerifierLocal license = home.create();
Exception:
javax.naming.NameNotFoundException: env not bound
JNDI View
java:comp namespace of the LicenseVerifier bean:
+- env (class: org.jnp.interfaces.NamingContext)
| +- ejb (class: org.jnp.interfaces.NamingContext)
| | +- LicenseVerifier[link -> LicenseVerifierLocalHome] (class: javax.naming.LinkRef)
| +- security (class: org.jnp.interfaces.NamingContext)
| | +- subject[link -> java:/jaas/SecurityPolicy/subject] (class: javax.naming.LinkRef)
| | +- security-domain[link -> java:/jaas/SecurityPolicy] (class: javax.naming.LinkRef)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4063988#4063988
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4063988
More information about the jboss-user
mailing list