You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Tom Bruser <to...@web2go.com> on 2001/09/22 04:04:45 UTC

Tomcat 4 jndi problems

I am having trouble connecting to my JBoss server from TomCat 4.  My test
code throws javax.naming.NameNotFoundException.  The equivalant code in a
stand-alone application works fine and calls the EJB method.  There is a
jndi.properties file that comes with JBoss that I use with my stand-alone
application.  I am unsure if Tomcat is loading this or not.  Any direction
that can be given after my lengthy attempt to do this on my own is
appreciated.

sample.jsp:

<%@
page import="javax.naming.InitialContext" %><%@
page import="javax.rmi.PortableRemoteObject" %><%@
page import="myejb.*" %><%
try {
InitialContext jndiContext = new InitialContext();
Object ref  = jndiContext.lookup("myejb.Sample");
SampleHome home = (SampleHome)
PortableRemoteObject.narrow(ref, SampleHome.class);
Sample sample = home.create();
time = sample.getTime();
%><%= time %>



Regards,

Tom Bruser
Web2Go Corporation