This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes problem in acessing session bean using jndi Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "problem in acessing session bean using jndi" Watch "problem in acessing session bean using jndi" New topic
Author

problem in acessing session bean using jndi

Aseet Padhi
Greenhorn

Joined: Mar 29, 2010
Posts: 1
Hi All,

I am getting following error while accessing the session bean using jndi.

xxxxxxxxxxxxxxxxxxxxxx
yyyyyyyyyyyyyyyyyyyyy
zzzzzzzzzzzzzzzzzzzzzzzzz
aaaaaaaaaaaaaaaaaaaaaaaaa
javax.naming.NameNotFoundException: comp not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
at org.jnp.server.NamingServer.lookup(NamingServer.java:396)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:728)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:688)
at javax.naming.InitialContext.lookup(Unknown Source)
at MyClient.main(MyClient.java:31)


I have Session bean in com.mysession package
Session Bean Name:vMySessionBean
Home interface: MySessionBeanHome
Remote interface: MySessionBeanRemote

MyClient class as follows



my ejb-jar.xml



jboss-ejb-jar.xml



Kindly help me.

Regards,
Aseet

[Devaka: Added code tags - UseCodeTags]
Karthik Shiraly
Ranch Hand

Joined: Apr 04, 2009
Posts: 489
    
    5
Since client and JBoss are running in different VMs, client will not have access to the "java:/" and "java:comp/env/" namespaces.
Just use

 
 
subject: problem in acessing session bean using jndi
 
Similar Threads
"jndi:ejb not bound" error while deploying EJB
EJB JNDI name
Error: javax.naming.NameNotFoundException: SignOn not bound
Issues with jboss.xml file in jboss 5.1
Error while calling EJB