[jboss-user] [JNDI/Naming/Network] - NameNotFoundException for SLSB Visible in JNDIView
serac
do-not-reply at jboss.com
Thu Jan 24 12:55:53 EST 2008
We have deployed a service MBean in a SAR within an EAR that needs to perform a JNDI lookup to get resources in both a "Manager" JAR and a "Query" JAR. Simplified package structure:
| EAR
| +- Service SAR
| +- MBean
| +- Manager JAR (JNDI lookup for these resources succeeds)
| +- Query JAR (JNDI lookup fails)
|
The following code generates a NameNotFoundException when called from our service MBean:
| final InitialContext jndiContext = this.getJndiContext();
| obj = (T) jndiContext.lookup(jndiName);
|
where jndiName = vt-ejb/PersonQuery/local. This resource is clearly registered in JNDI as shown by the following output from JNDIView:
| Global JNDI Namespace
|
| +- vt-ejb (class: org.jnp.interfaces.NamingContext)
| | +- PersonQuery (class: org.jnp.interfaces.NamingContext)
| | | +- local (proxy: $Proxy215 implements interface edu.vt.middleware.registry.query.person.PersonQueryLocal,interface org.jboss.ejb3.JBossProxy)
| | | +- remote (proxy: $Proxy214 implements interface edu.vt.middleware.registry.query.person.PersonQueryRemote,interface org.jboss.ejb3.JBossProxy)
| | +- EmailManager (class: org.jnp.interfaces.NamingContext)
| | | +- local (proxy: $Proxy134 implements interface edu.vt.middleware.registry.manage.email.EmailManagerLocal,interface org.jboss.ejb3.JBossProxy)
| | | +- remote (proxy: $Proxy133 implements interface edu.vt.middleware.registry.manage.email.EmailManagerRemote,interface org.jboss.ejb3.JBossProxy)
|
Stack trace:
| javax.naming.NameNotFoundException: vt-ejb/PersonQuery/local
| at org.jboss.ha.jndi.TreeHead.lookup(TreeHead.java:242)
| at org.jboss.ha.jndi.HAJNDI.lookup(HAJNDI.java:155)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.ha.framework.interfaces.HARMIClient.invoke(HARMIClient.java:312)
| ...
|
What's interesting is that the error message for a NameNotFoundException typically reads "x not bound" for query on a non-existent name; the "not bound" text is conspicuously missing, which suggests that it's not a name resolution problem.
We are puzzled that a similar JNDI lookup as above, from the same calling context (an MBean), succeeds if we do a lookup on the EmailManager bean using the name vt-ejb/EmailManager/local.
We are using EJB3 annotations to mark up the beans and register them in JNDI, and the two beans above have exactly the same annotations except EmailManager has a @RunAs(...) annotation. They also occur in different JARs within the same EAR.
For reference, the annotations on PersonQueryBean follow:
| @Stateless
| @SecurityDomain("EDClient")
| @WebService(name = "PersonQuery",
| endpointInterface =
| "edu.vt.middleware.ed.query.PersonQueryEndpoint")
| @WebContext(contextRoot = "/registryquery",
| transportGuarantee = "CONFIDENTIAL",
| authMethod = "CLIENT-CERT")
| @LocalBinding(jndiBinding = PersonQuery.LOCAL_JNDI_NAME)
| @RemoteBinding(jndiBinding = PersonQuery.REMOTE_JNDI_NAME)
| public class PersonQueryBean extends AbstractQuery
| implements PersonQueryLocal, PersonQueryRemote
| ...
|
| public interface PersonQuery extends PersonQueryEndpoint
| {
| /** local jndi name */
| String LOCAL_JNDI_NAME = "vt-ejb/PersonQuery/local";
|
| /** remote jndi name */
| String REMOTE_JNDI_NAME = "vt-ejb/PersonQuery/remote";
| ...
|
We would appreciate any suggestions for resolving this issue or investigating it further.
Thanks,
Marvin
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4123140#4123140
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4123140
More information about the jboss-user
mailing list