Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 687
  • Last Modified:

Local JNDI lookup

Hi,
I am using j2ee application with session ejbs on WSAD5.0. I have both remote and local interfaces in my bean. Initiall i used jndi lookup using remotehome object,it works fine.Later,i tried using localhome look up...  I am getting following exception...Is there something i missed..I would appreciate if anybody help on this...

 javax.naming.NameNotFoundException: Name "ejb/ejb/us/ds/ejb/person/PersonLocalHome" not found in context "local

//client code
InitialContext context = new InitialContext();
 perHome = (PersonLocalHome)context.lookup("local:ejb/ejb/us/ds/ejb/person/PersonLocalHome");

In ejb-jar-bnd.xmi,i have something like this..
<ejbBindings xmi:id="EnterpriseBeanBinding_1094579280078" jndiName="ejb/us/ds/ejb/person/PersonLocalHome">
    <enterpriseBean xmi:type="ejb:Session" href="META-INF/ejb-jar.xml#Person"/>
    <ejbRefBindings xmi:id="EjbRefBinding_1094580260062" jndiName="local:ejb/ejb/us/ds/ejb/person/PersonLocalHome">
      <bindingEjbRef xmi:type="common:EJBLocalRef" href="META-INF/ejb-jar.xml#EJBLocalRef_1094580260062"/>
    </ejbRefBindings>
  </ejbBindings>

thanks.
0
prreddy
Asked:
prreddy
  • 3
  • 2
1 Solution
 
ldbkuttyCommented:
Try this:

InitialContext context = new InitialContext();
perHome = (PersonLocalHome)context.lookup(PersonLocalHome.JNDI_NAME);
0
 
prreddyAuthor Commented:
you mean JNDI_NAME is local jndiname right, but its not accepting if i say PersonLocalHome.JNDI_NAME
0
 
prreddyAuthor Commented:
Any help appreciated for the above problem!!!!!!!
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
ldbkuttyCommented:
Are you getting the same error?

one suggestion: You can post this Question in Java TopicArea, where you can get earlier & excellent responses than here. http://www.experts-exchange.com/Programming/Programming_Languages/Java/

You can also post a "20 points" Question there with the link of this Question in the body. (and subject - something like - Link to EJB Question.)
0
 
prreddyAuthor Commented:
I appreciate your help... I tried different ways ,it works fine...Actually we need to specify local reference in web.xml, that solved the problem.
0
 
GhostModCommented:
PAQed with points refunded (200)

GhostMod
Community Support Moderator
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now