wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes EJB Lookup from a servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB Lookup from a servlet" Watch "EJB Lookup from a servlet" New topic

EJB Lookup from a servlet

mohdz Shalaby

Joined: Jan 17, 2008
Posts: 1
I have a servlet which is deployed on a webserver and I want to lookup a sesion bean fro it.
this is my code:

But this code throwing the following exception:

com.ibm.websphere.naming.CannotInstantiateObjectException: Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object.

I think I need to set the properties in the initial Context.
but how could I get the IIOP URI+PORT and how could I get the factory?
NOte: My directory Service is in WebSphere App Server.
Lave Kulshreshtha
Ranch Hand

Joined: Oct 21, 2007
Posts: 106
Have you made following entry in web.xml.


Above entry is an example only. The home and remote interfaces in entry above should be fully qualified classname for e.g. com.example.CustomerNumbersHome. In <ejb-ref-type> put the tyoe of your bean
session or entity.

Once you make an entry here, then application server will take care of every thing, please do not bother about IIOP URI+PORT etc..It is application server's responsibility.


SCJP 1.4, SCWCD 1.4, SCBCD 1.3, ITIL V3 Foundation Certification
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: EJB Lookup from a servlet
Similar Threads
java.lang.ClassCastException when assigning to home interface?
EJB and my servlet
no security manager: RMI class loader disabled
EJB client for Websphere throws ClassCastException
Problem in getting EJBHome for stateless session bean in servlet in websphere4.0