Unregistered
|
|
For some reason this example is not working with JBoss 4.0.5.
Even though the ejb3 file is deployed fine, the following line is not working:
SimpleSession simpleSession = (SimpleSession) ctx.lookup(SimpleSession.class.getName());
Exception in thread "main" javax.naming.NameNotFoundException: SimpleSession not bound at org.jnp.server.NamingServer.getBinding(NamingServer.java:529) at org.jnp.server.NamingServer.getBinding(NamingServer.java:537) ...
On the other hand if I try to put things like: ctx.lookup("SimpleSessionBean"); the instance returned is not an instance of SimpleSession or SimpleSessionBean but an instance of NamingContext.
JBoss is saying that the ejb3 file is deployed successfully (see below), so I dont know whats wrong. I am relatively new to EJB and JNDI so its a bit difficult to understand where to start to solve the problem.
17:18:46,755 INFO [Ejb3Deployment] EJB3 deployment time took: 47 17:18:46,755 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:jar=EJBHe lloWorld.ejb3,name=SimpleSessionBean,service=EJB3 with dependencies: 17:18:46,786 INFO [EJBContainer] STARTED EJB: beans.SimpleSessionBean ejbName: SimpleSessionBean 17:18:46,849 INFO [EJB3Deployer] Deployed: file:/C:/Program Files/jboss-4.0.5.G A/server/default/deploy/EJBHelloWorld.ejb3
|
Unregistered
|
|
For some reason it worked when I changed it to:
SimpleSession simpleSession = (SimpleSession) ctx.lookup("SimpleSessionBean/remote");
What is the correct naming convention to use for this? Why was the tutorial referring to the interface, while for it to work I had to change it to the actual implementation?
|
|