Lookups and EJBs

R

Ravi Shankar Nair

Dear all,

Its a well known fact that whenever we want a servlet to look up an EJB, we
need to specify resource-ref tag in the web.xml.

I have some 20 different J2EE modules, each having their own web.xml. Assume
that these 20 modules have their own EJBS as well. Now when First module is
accessing the fifth module's EJB, then first module obviously need to have a
web.xml with relevant resource-ref entry. Hmmm, thats is annoying - no
independence.

Well, I wrote a utility class which looks up an EJB and returns an
interface, which can be used by different modules for their busineess logic.
I kept all such interfaces in the common class path of the server.
Everything fine, except...

a NamingException!! Why ? Servlet is not direclty looking up the EJB,
servlet calls a utility class which in turn looks up and EJB. Why should I
have a resource-ref in this case?

Hope the question is clear. Please help, thanks

Best regards,
Ravi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top