Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Local JNDI lookup

Posted on 2004-09-07
8
Medium Priority
?
685 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

Question has a verified solution.

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

Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

670 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