It's not a secret anymore!
The moose likes Websphere and the fly likes EJB3 JNDI lookup in WAS7 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "EJB3 JNDI lookup in WAS7" Watch "EJB3 JNDI lookup in WAS7" New topic

EJB3 JNDI lookup in WAS7

Viji San
Ranch Hand

Joined: Aug 12, 2010
Posts: 35
I need to invoke ejb3 beans in my struts2 action class in Websphere 7 server. As struts action is not a container managed component, I could not use DI to inject EJB3 beans. I 'm using the below JNDI lookup code in Websphere 7 server, but fails. Could anyone help me to provide JNDI EJB3 lookup URL/code for WAS7? What are the JNDI lookup methods available in WAS 7 for ejb3 and where could i find the documents please?. Thank you very much for helping me.


Deepak Pant
Ranch Hand

Joined: Feb 13, 2004
Posts: 446
Just change


and your JNDI lookup should work.

The other thing you can do is to look in the SystemOut.log for binding information for SampleEjbLocal. The log provides both short and long form JNDI bindings for all the objects that bind to the JNDI directory.

Let me know if this doesnt work
Viji San
Ranch Hand

Joined: Aug 12, 2010
Posts: 35
Thank you very much Deepak!!

The below lookup code worked, prefixed "ejblocal:" with the full qualified interface name. I found this in System.out log as you mentioned.

Rafiuddin Syed

Joined: Aug 31, 2004
Posts: 5

I am getting the below error while looking up EJB3.0 version bean, any suggestions?

[color=red]javax.naming.ConfigurationException: NamingManager.getURLContext cannot find the factory for this scheme[/color]

I agree. Here's the link:
subject: EJB3 JNDI lookup in WAS7
It's not a secret anymore!