This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JNDI - problem while accessing EJB using jboss

 
arnav prateek
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To access ejb from servlet follwoing code snippet has been written:
-----------Start--------------
InitialContext init = new InitialContext();
Object objref = init.lookup("CDSAdminJNDI");
CDSAdminHome cdsAdminHome = (CDSAdminHome)PortableRemoteObject.narrow(objref,CDSAdminHome.class);
CDSAdmin cdsAdmin = cdsAdminBean.create();
cdsAdmin.saveCDSAdminRecords(hmAdminParameters);
----------End-----------------

jboss xml file is as follows:
------Start -----------------
<?xml version="1.0" encoding="UTF-8"?>
<jboss>
<enterprise-beans>
<session>
<ejb-name>CDSAdmin</ejb-name>
<jndi-name>CDSAdminJNDI</jndi-name>
</session>
</enterprise-beans>
</jboss>
-------End------------

While accessing this Bean..I get following exception on jboss console:

Exception While accessing EJB: javax.naming.NameNotFoundException: CDSAdminJNDI not bound

Can Any body help where is problem?

Thanks in advance
 
madhuri madhuri
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you check under what name space the bean was deployed...?
You could do this by starting up your jboss and navigating to the

jboss
service=JNDIView (on your JMX console http://localhost:8080/jmx-console)

Click on invoke button the java.lang.String.list(). You will see under what name space your bean was deployed.

accordingly modify your lookup.

Thanks,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic