Forums Register Login

EJB-JBOSS - Problem in accessing JNDI

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
Thanks..It works
I don't always make ads but when I do they're tiny
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 502 times.
Similar Threads
JBOSS/EJB - Problem while accessing EJB
JNDI - problem while accessing EJB using jboss
Accessing local EJBs (JNDI problem)
need help on log4j.properties
JNDI not creating for EJB Local interfaces example
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 05:53:28.