File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 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
I agree. Here's the link:
subject: EJB Lookup from a servlet
It's not a secret anymore!