I have a question about this:

I modified the Duke's Bank to include a very simple object called SimpleEJB, with JNDI 
name MySimpleEJB and with a ref that was
ejb/Simple.

When I got the default initial context, it worked just great using

initial.lookup("java:comp/env/ejb/Simple");

However, when I tried this:

       
  | Hashtable env = new Hashtable();
  | env.putContext.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
  | env.put(Context.PROVIDER_URL, "jnp://localhost:1099");
  | env.put"java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
  | InitialContext initial2 = new InitialContext(env);
  | Object objref2 = initial2.lookup("ejb/Simple");
  | 

It didn't work. It said it couldn't deference it and that was part of a 
NameNotFoundException because ejb was not bound.

However, if I change that last line to read:


  | Object objref2 = initial2.lookup("MySimpleEJB");
  | 

It worked just great. Do I always have to use the JNDI name when not using the 
java:comp/env? That is, accessing a remote bean. I thought that JBoss would do that 
making using the refs.

What I am trying to do is modify another war file I have to use an session bean but I 
am having trouble getting the bean even by the JNDI name. The war file I am using does 
include the bank-ejb.jar, I put it in there to try it out, and there is no way I can 
look up that bean.

Some hints would help. Do I need the clientall-jboss.jar for the JNDI look up? I've 
been reading up on the Jboss JNDI but so far the book I am using, SAMS JBoss, says 
that I am settng up everything correctly.

Thanks.


View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3851033#3851033

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3851033


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to