Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in acessing session bean using jndi

 
Aseet Padhi
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 1208
25
Android C++ Java Linux PHP Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since client and JBoss are running in different VMs, client will not have access to the "java:/" and "java:comp/env/" namespaces.
Just use

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic