• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to access LocalHome interface in websphere5.1

 
Mahesh Malviya
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I try with the code below for accessing a entity bean Loan_Split_History_B.
Object homeObject = null;
homeObject = initCtx.lookup("java:comp/env/ejb/Loan_Split_History_B");
Loan_Split_History_BLocalHome entityLocalHome = (Loan_Split_History_BLocalHome)homeObject;

But it gives me the error.
javax.naming.NameNotFoundException: Name "comp/env/ejb/Loan_Split_History_BLocalHome" not found in context "java:".

Before this I have made a <ejb-local-ref> entry in the ejb-jar.xml with the session bean which is calling it.

Thanks
Mahesh Malviya
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35733
412
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mahesh,
Try java:comp/env/local:ejb/ejb/Loan_Split_History_B

Websphere prepends local:ejb to local interfaces.
 
Mahesh Malviya
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks for reply. I tried as you had told. but it is giving the error.
javax.naming.NameNotFoundException: Name comp/env/local:ejb not found in context "java:".

I did not understand the meaning of using java: and local:
please help me.
Thanks
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35733
412
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java: is the namespace. local: is just something WSAD sticks in the JNDI name. Are you using WSAD or Websphere?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!