Skip to Content
avatar image
Former Member

JNDI lookup for external SessionBean fails

Hello, i have a problem i've been trying to solve all day and would appreciate it if you could help me.

I have an Ear file with an EJB Session Bean(EAR: EigenlijstenEar/EJB: EigenlijstenEJB) which i am attempting to use in a servlet in another web/ear (Web: HagaPortalWeb/EAR: HagaPortalEar). I have read and followed the guidance of, but to no avail.

The error i get is: Exception during lookup operation of object with name webContainer/applications/, cannot resolve object reference. [Root exception is Path to object does not exist at EigenlijstenEar, the whole lookup name is localejbs/]

my lookup code in a servlet in HagaPortalWeb:

Context ctx = new InitialContext();

EigenlijstenSessionLocalHome eigenlijstenHome =

(EigenlijstenSessionLocalHome) ctx.lookup(


content of my web.xml in HagaPortalWeb:








content of my application-j2ee-engine.xml in Ear project HagaPortalEar:







Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Aug 22, 2008 at 05:13 AM

    HI Arie,

    If you are accessing enterprise beans with J2EE clients (servlets, JSP, other enterprise beans, J2EE application clients), do not specify and use this arbitrary JNDI name. Instead, define EJB references in the clientsu2019 deployment descriptors and access the beans using these references. For more information, check the following link

    if the above does not work try the following:--

    Try to lookup the Ejb by its JNDI name given in the EJB-J2ee-engine.xml file if it does not exist there give any valid name and try to lookUp.

    or try to lookup the ejb by its default jndi name.

    "localejbs/bean name>"

    in the Above link refer the second option "Lookup from a Non-J2EE Java Application"


    Edited by: Siddharth Jain on Aug 22, 2008 7:13 AM

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 22, 2008 at 02:46 PM

    Thanks, that answered my question.

    Although i did look around at the library too much, making me quite dizzy. The simple answer was to look in the visadmin for the real path and try lots of paths until the right one came up. It was:

    localejbs/ and behold, the thing worked!

    thanks for the pointers.


    Arie Klop

    Add comment
    10|10000 characters needed characters exceeded