on 09-30-2005 11:30 AM
Hello All,
I successfully tried to connect to XI from Java Proxy.basically I tried the example given by Sudhir.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/java 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 sap.com and finally I got the string sap.com/AppName/BeanName. 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/sap.com/appname/beanname) 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.
Regards
Rajeev
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,
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.