Skip to Content
author's profile photo Former Member
Former Member

JNDI Lookup string incase of JavaProxy client call

Hello All,

I successfully tried to connect to XI from Java Proxy.basically I tried the example given by Sudhir. proxies and sap xi - the inside story,%20Part%20II.pdf

But I faced lot of problems regarding the lookup string for the same. The one string mentioned in his PDF java:comp/env/ejb/BeanName never worked for me.Finally I searched into our JNDI for and finally I got the string I tried with this string but was giving ClassCastExceptions and NullPointerExceptions. Then I referred to the documenation of the SAP for local ejbs (the example was creating the instance of local ejb) which says the path starts with localejbs (localejbs/ and finally it worked for us.

There we have InvokeProxy class which is encapsulated in the same EAR file. Now I am having wrapper another EJB which calls the Proxy EJB with the same lookup string but still it gives ClassCast Exception. I have written small application to call this wrapper EJB in which the connection was successful but gave error while calling ProxyEJB.

Does anyone know the standard JNDI lookup string (for SAP-WAS) or any method to find out the same which will give reference of our Home interface.

Thanks in advance.



Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Oct 01, 2005 at 09:12 PM

    You have to distinguish between calls from outside to the J2EE and calls between EJBs.

    When you call from outside, you address the EJBs running on the server by the JNDI name.

    When an EJB (or a servlet/JSP) calls another EJB, then you have to assign a reference. In this reference, you define the name, you want to use in your program. It need not be the same as the JNDI name, as the reference in the ejb.xml or web.xml points to the called EJB.

    When you create an EJB as a wrapper to the Java Proxy Beans, I recommend to combine the code and call the Java Proxy methods directly from the wrapper Bean.

    Hope that helps,


    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.