EJB Not found.

Discussions

EJB programming & troubleshooting: EJB Not found.

  1. EJB Not found. (1 messages)

    Hi, I tried a simple program on EJB3.0. I am using JBoss5.0, Eclipse 3.4.1 and jdk1.6. I created a EJB Project in Eclipse, chose EJB 3.0 and created a session bean. It asked for home and remote interface. But EJB 3.0 says Home and Remote interfaces are deprecated and uses Annotation widely. @EJB HelloEJBLocal hello; .... ... and then called the sayHello method. hello.sayHello(); But while running it gives NamingException HelloEJB not found. I got struck with this for couple of days. I tried another example using deployment descriptors too ejb-jar.xml and jboss.xml but same error. Can anyone help? ejb-jar.xml ------------- JBoss Stateless Session Bean Tutorial JBoss Stateless Session Bean Tutorial FIrstEJB com.first.FIrstEJBRemote com.hello.FIrstEJBLocal com.hello.FIrstEJB Stateless Container jboss.xml FIrstEJB com.first.FIrstEJBRemote com.first.FIrstEJBLocal Ejb client ------------- Properties properties = new Properties(); properties.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory"); properties.put("java.naming.factory.url.pkgs","=org.jboss.naming:org.jnp.interfaces"); properties.put("java.naming.provider.url","localhost:1099"); InitialContext ctx = new InitialContext(properties); FIrstEJBLocal hello = (FIrstEJBLocal) ctx.lookup("FirstEJB/"+FIrstEJB.class.getSimpleName() +"/local"); Please help. I need this to be solved by Monday. Thanks, Cheenu.

    Threaded Messages (1)

  2. Re: EJB Not found.[ Go to top ]

    Try matching JNDI name used in deployment descriptor and the lookup, these chould match Thanks, Ishtiak http://interview-questions.weebly.com