wood burning stoves*
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
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: 497
    
    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