• 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 ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Frits Walraven
  • Himai Minh


Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I am having this error in my jdeveloper environment when i tried to connect entity bean from session bean.
05/12/22 20:06:25 javax.naming.NameNotFoundException: Ship not found in SessionEJB

05/12/22 20:06:25 at com.oracle.naming.J2EEContext.getSubContext(J2EEContext.java:93)
My ejb-jar.xml contains
<description>Entity Bean ( CMP )</description>

and in session bean i am trying like this
InitialContext ctx = OcmLocationMasterData.getInitialContext();
System.out.println("Context has been initialized");

Object objref=ctx.lookup("java:comp/env/Ship");
System.out.println("lookup finished");
ShipLocalHome home=(ShipLocalHome)PortableRemoteObject.narrow(objref,ShipLocalHome.class);
Long id = new Long(1);
ShipLocal result=home.create(id,"INSkundan","kolkata");

For initial context i am doing just
return new InitialContext();

Thanks for the help
Posts: 10445
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by kundan varma:
Object objref=ctx.lookup("java:comp/env/Ship");

Do the following:

Object objref=ctx.lookup("com.ocm.ShipLocal");
Have you no shame? Have you no decency? Have you no tiny ad?
the value of filler advertising in 2021
    Bookmark Topic Watch Topic
  • New Topic