Skip to Content
avatar image
Former Member

Error when calling an EJB from a web sevice

Hi all,

I am getting the following error while trying to the lookup for my session bean Path to object does not exist at java:comp, the whole lookup name is java:comp/env/ejb/MyProcessorBean

here's a part of my code:

String WebserviceFunction()



Context ctx = new InitialContext();

BiasProcessorLocalHome orderHome =(BiasProcessorLocalHome)ctx.lookup("java:comp/env/ejb/MyProcessorBean");



I am using NWDS Version: 7.0.09

SAP NetWeaver 2004s.

I did find some threads related to it but none has been answered or weren't

that helpful in solving my problem.



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Aug 02, 2007 at 04:06 PM


    What is the implementation of your Web service? If it's another EJB then you have to define an ejb-local-ref in the deployment descriptor for that other EJB, like this:


    If it's not a J2EE component, there is no java:comp environment naming context (ENC) available. In this case you can look up the EJB local home from the "localejbs/" context, e.g. "localejbs/". By default the provider name is "".

    For more information please refer to this" target="_blank">">this article.


    -- Vladimir

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks Baris Buyuktanir and Vladimir Pavlov for replying.

      @Baris Buyuktanir:

      Am trying to use and call the session bean from one of my Web service function(my ejb and web service are two separate projects)

      Well.... I tried out that option too and it gave me another error saying:


      @ Vladimir Pavlov:

      Actually I created the project as a Java project and converted it into a web service

      by creating the VI and WS definitions.

      And there is not deployment descriptor (web.xml) in my project.

      I tried including it (web.xml with the ejb local ref ) in my project manually but I guess it's not reading from it. Any way of including the reference in the ws-deployment-descriptor.xml. Coz I tried and and it gave an error while deploying my project(web service).


      Ok!! I Solved it with the help of the link that Vladimir provided.

      Initially I was trying to reference the ejb in my ws-deployment-descriptor.xml but it was giving an error while deploying so I tried it in my application-j2ee-engine.xml and it worked.

      Thanks to Vladimir and Baris too. 😊



      Message was edited by:

      talimeren Lkr

  • avatar image
    Former Member
    Aug 02, 2007 at 03:27 PM


    From where are you tying to reach your ejb?

    For local references try


    Add comment
    10|10000 characters needed characters exceeded