Hi,

The javax.naming.NameNotFoundException is being thrown because you have bound 
the EJB into the global namespace with the name 'ejb/Liga' but you are looking 
for it in the ENC namespace (java:comp/env).

When you changed the jndi-name to Liga and used the following code, you 
correctly lookup the bean using JNDI:

Object obj = ic.lookup("Liga");

However as you are no longer using the ENC namespace your web application isn't 
as portable as it could be. If the EJB is bound to a different name, like it 
was before 'ejb/Liga', then you will have to change the lookup string in your 
source code to 'ejb/Liga' and recompile it in order for it to work.

Ideally what you should do is add an <ejb-ref> or <ejb-local-ref> element to 
your web.xml file and then add the corresponding <ejb-ref> or <ejb-local-ref> 
element to your jboss-web.xml file. These tags map your ENC name to the global 
name which the EJB is really bound to. You can then use:

Object obj = ic.lookup("java:comp/env/ejb/Liga");

hopefully this is enough information to get you on the right track.

Mark

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

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


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to