Solved

Local JNDI lookup

Posted on 2004-09-07
8
679 Views
Last Modified: 2008-01-09
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
Comment
Question by:prreddy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
8 Comments
 
LVL 32

Expert Comment

by:ldbkutty
ID: 12002612
Try this:

InitialContext context = new InitialContext();
perHome = (PersonLocalHome)context.lookup(PersonLocalHome.JNDI_NAME);
0
 

Author Comment

by:prreddy
ID: 12005977
you mean JNDI_NAME is local jndiname right, but its not accepting if i say PersonLocalHome.JNDI_NAME
0
 

Author Comment

by:prreddy
ID: 12020488
Any help appreciated for the above problem!!!!!!!
0
Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

 
LVL 32

Expert Comment

by:ldbkutty
ID: 12022013
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
 

Author Comment

by:prreddy
ID: 12129654
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
 
LVL 1

Accepted Solution

by:
GhostMod earned 0 total points
ID: 12580065
PAQed with points refunded (200)

GhostMod
Community Support Moderator
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question