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.