Image

Imagestipe wrote in Imagejava_dev

JBoss JNDI

Update: It always seems to go this way. Shortly after posting this here, I solved the problem. I'm not sure how, but things seem to work now. I think I may have screwed up some JBoss config.

I'm having some trouble doing a client-side JNDI lookup on a bean.


I'm running JBoss, and have created an InitialContext on the client with the following properties:
java.naming.factory.initial = org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs = org.jnp.interfaces
java.naming.provider.url = localhost:1099

The actual lookup is done with:
Object ref = jndiContext.lookup("jndi/AuthenticationServiceBean");

In my jboss.xml file I have:
<session>
  <ejb-name>AuthenticationService</ejb-name>
  <jndi-name>jndi/AuthenticationServiceBean</jndi-name>
  ... more non-JNDI stuff ...
</session>


When I try to do the lookup, I get a naming exception saying that "jndi" is not bound. I've tried using the JNDIView MBean, and it shows the java:comp contexts for my beans, but nothing else. Doing a list("/") on the InitialContext also seems to indicate that "jndi" is indeed not bound. I've tried leaving out the "jndi" prefix in the bindings/lookups, but then I just get an exception saying that "AuthenticationServiceBean" is not bound.

Am I missing some step in allowing a client to lookup the bean?