Solved

Local JNDI lookup

Posted on 2004-09-07
8
678 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
  • 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
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 …
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

856 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