Please join us at the new JavaWorld Q&A Forums. Your existing login will work there. The discussions here are now read-only.


JavaWorld Talkback >> 960482

Pages: 1

Unregistered




Error: SimpleSession not bound
      #44756 - 03/22/07 05:46 AM

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


Post Extras: Print Post   Remind Me!   Notify Moderator  

Unregistered




Re: Error: SimpleSession not bound [Re: Anonymous]
      #44794 - 03/23/07 04:04 AM

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?


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 1 anonymous users are browsing this forum.

Moderator:   

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 7045

Rate this topic

Jump to

Contact us JavaWorld

Powered by UBB.threads™ 6.5.5