• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJB-JBOSS - Problem in accessing JNDI

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This means that the EJB is not bound by this name. To investigate that problem you should first check if the EJB was deployed successfully (consult the log file).
Then open the JMX Console (default: 'localhost:8080/jmx-console'), search for the 'JNDI Viewer', click on that, the click on the button for the method 'list', scroll down to the 'global' namespace and search for your EJB. If you cannot find your Remote Home interface listed somewhere then your deployment must have failed.

-Andy
 
arnav prateek
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks..It works
 
reply
    Bookmark Topic Watch Topic
  • New Topic