tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martijn <>
Subject Tomcat 4.1.18 and J2EE server (default server that ships with the J2EE) problem
Date Sat, 15 Feb 2003 13:35:05 GMT
Dear reader,

I've been trying to let Tomcat remotely call an EJB (Enterprise Java Bean) from a JSP page.
But so far without any result (but many different exceptions). I am new to Tomcat, so I guess
I am missing something somewhere.

Tomcat runs in a separate JVM and so does the default J2EE server (so basically 2 different
locations). The EJB deployed at the J2EE servers JNDI name is ejb/AuthorRef. I've created
a simple web.xml file that goes with the JSP, which content is:

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"


<!-- EJB Reference -->
      <description>Author Bean</description>

The code in the JSP I used to locate the EJB is:

Hashtable env = new Hashtable();
env.put(Context.PROVIDER_URL, "iiop://");
InitialContext context = new InitialContext(env);
Object ref    = context.lookup("java:comp/env/ejb/AuthorRef");

The last line (of the code) causes an exception. Such as "object not bound to this Context"
and alike. I don't know what I am doing wrong, or what I should do different as I haven't
found any good documentation about this subject.  I hope someone knows what I should do. I
am really stuck now.. at Suns Java forum no-one seems to know either... Thanx a lot in advance!

Regards Martijn

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message