This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes JBoss/WildFly and the fly likes JNDI - problem while accessing EJB using jboss Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "JNDI - problem while accessing EJB using jboss" Watch "JNDI - problem while accessing EJB using jboss" New topic

JNDI - problem while accessing EJB using jboss

arnav prateek

Joined: Apr 06, 2006
Posts: 17
To access ejb from servlet follwoing code snippet has been written:
InitialContext init = new InitialContext();
Object objref = init.lookup("CDSAdminJNDI");
CDSAdminHome cdsAdminHome = (CDSAdminHome)PortableRemoteObject.narrow(objref,CDSAdminHome.class);
CDSAdmin cdsAdmin = cdsAdminBean.create();

jboss xml file is as follows:
------Start -----------------
<?xml version="1.0" encoding="UTF-8"?>

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

Joined: Jan 18, 2006
Posts: 58
Did you check under what name space the bean was deployed...?
You could do this by starting up your jboss and navigating to the

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.


Have you checked out Aspose?
subject: JNDI - problem while accessing EJB using jboss
It's not a secret anymore!