tags:

views:

107

answers:

1

The following code is used by IPMBaseBean.class for accessing remote interface .

Object obj = iniCtx.lookup("java:/comp/env/ejb/ODIControllerSessionEJB");

In jboss-web.xml jndi-name is refered as below

<ejb-ref-name>ejb/ODIControllerSessionEJB</ejb-ref-name>
<jndi-name>jnp://vwhq5275.whq.ual.com:6200/ODIControllerSessionEJB</jndi-name>

Error:

Naming exception 
javax.naming.NameNotFoundException: comp not bound..

Please suggest on this issue.

A: 

While starting JBoss, it shows the Global JNDI names like shown below:

 15:26:47,394 INFO  [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:

        hrms/AccountSummarySessionBean/local - EJB3.x Default Local Business Interface
        hrms/AccountSummarySessionBean/local-com.cc.hrms.bl.accounts.generalaccount.session.AccountSummarySessionBeanLocal - EJB3.x Local Business Interface

You can then lookup by using that convention

lookup signature - "hrms/AccountSummarySessionBean/local-com.cc.hrms.bl.accounts.generalaccount.session.AccountSummarySessionBeanLocal"

initialContext.lookup(ProjectConstants.PROJECT_NAME+className.getSimpleName().substring(0, className.getSimpleName().lastIndexOf("Local")) + "/local-" + className.getName());

I am working in JBoss-5 & this convention works fine for me.

Nayan Wadekar