• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

local interface lookup problem

 
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have deployed my bean and its having both local and remote
interfaces. If i do remoke lookup then its working fine but with I go for
local lookup its giving the following error :


javax.naming.LinkException: [Root exception is
javax.naming.NameNotFoundException: While trying to
look up /app/ejb/advice.jar#AdviceBean/local-home in
/app/webapp/webapplication/12817424.; remaining
name '/app/ejb/advice/jar#AdviceBean/local-home']; Link Remaining Name:
'java:app/ejb/advice.jar#Ad
viceBean/local-home'


My client code is :


InitialContext cntx = getContext();
Object obj = cntx.lookup("AdviceLocalBean");
AdviceBeanLocalHome home = (AdviceBeanLocalHome) obj;
AdviceBeanLocalRemote rem = home.create();
System.out.println(rem.getAdvice());


I check the weblogic JNDI tree and its showing the Bind Name for the local
bean JNDI.


Any help is highly appreciated.


Regards,
Sawan
 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you access a local interface, it must be deployed in the same JVM instance as the class/jsp from where you are accessing it.
If you have deployed your EJB separately and your other classes separately, the local interface may not work.
Try deploying everything as an ear file.
 
reply
    Bookmark Topic Watch Topic
  • New Topic