on 07-05-2005 10:29 PM
Hi,
I have a session bean which I'm trying to access remotely. If I lookup the bean this way:
Object ob = ctx.lookup("java:comp/env/EventHandlerBean");
I get
java.lang.Exception: Error instantiating EventProxy EJBcom.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Path to object does not exist at java:comp, the whole lookup name is java:comp/env/EventHandlerBean ...
(this lookup works fine if made from a JSP inside a web container deployed in the same ear that the bean)
I have to lookup this way:
Object ob = ctx.lookup("sap.com/myJarProject/EventHandlerBean");
to get the bean successfuly.
Is there any reason for this?
Thanks
Juan Manuel
Thanks for the help
Regards,
Juan Manuel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Juan Manuel,
> Is there any reason for this?
Yes, the explanation can be found in <a href="http://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/java/accessing%20ejb%20applications%20using%20jndi.pdf">this</a> guide. It covers all aspects of EJB access via JNDI.
Hope that helps,
Vladimir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sanmarco,
In first case, your EJB is locally available within your EAR file. So, you can directly access that EJB using this java:comp/env path. This path is useful to find any EJB locally means within the same EAR.
But, if you have deployed EJB seperatly on WAS server and you want to access that ejb temotely then this EJB is registered in JNDI under the sap.com/<proj name>/<ejb name> path.
So, you have to give this path for look up.
If, you have specified any special JNDI name to your EJB in ejb-j2ee-engine.xml file then you can directly give this name in lookup.
Because now this EJB is registered under this name in JNDI registry.
Regards,
Bhavik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Read your environment variable support for the deployment of EJB. There should be something in help.sap.com about it.
Enjoy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.