I wouldn't recommend putting jndi.properties into the Tomcat classpath,
because then you are restricting everyone using that instance of Tomcat to
those settings. What we do is to include the home and object creation into
a header file, and include that header file on each jsp page that needs to
get to JBoss (equivalent things can be done for servlets). Here is what our
header looks like:
java.util.Hashtable env = new java.util.Hashtable();
env.put("java.naming.factory.initial", INITIAL_FACTORY);
env.put("java.naming.provider.url", aJndiURL);
env.put("java.naming.factory.url.pkgs", URL_FACTORY);
ctx = new InitialContext(env);
Object ref = ctx.lookup("xxxxxxx");
home =
(AuthenticationHome)PortableRemoteObject.narrow(ref,xxxxxxx.class);
obj = home.create();
A page that needs to connect to JBoss then would looks something like this:
<%@ include file="/common/html/nccheader.jsp" %>
<%
obj.callSomeMethod(....);
%>
If you have multiple objects you need to lookup, maybe just setting up the
initial context in the header would be better, then getting the home and
remote references can be done on the pages.
----- Original Message -----
From: "Jason Stortz" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 21, 2002 8:29 AM
Subject: RE: [JBoss-user] Never ending etandalone Tomcat issues
Adrian,
Link didn't work, maybe because forums have been up and
down lately. Got any other links?
-----Original Message-----
From: Adrian Brock [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 20, 2002 8:30 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] Never ending etandalone Tomcat issues
Hi,
Try this link.
http://www.jboss.org/forums/thread.jsp?forum=67&thread=8092
Regards,
Adrian
>From: Jon Swinth <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>Subject: [JBoss-user] Never ending etandalone Tomcat issues
>Date: Thu, 20 Jun 2002 14:59:23 -0700
>
>First off, thanks to all of you that help out on this list. It is greatly
>appreciated.
>
>Is there someone out there that has been successful at deploying JBoss
>3.0.0 Final
>on a different machine than Tomcat 4.0.3?
>
>Everything works fine for us as long as JBoss and Tomcat are on the same
>machine.
>It seems that no matter what properties we set or where we put the
>jndi.properties file,
>the jnp classes try to use 127.0.0.1 to connect to JBoss. Hence the
>following (partial)
>error stack:
>
>javax.naming.CommunicationException. Root exception is
>java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested
>exception is:
> java.net.ConnectException: Connection refused
>java.net.ConnectException: Connection refused
> at java.net.PlainSocketImpl.socketConnect(Native Method)
> at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:355)
> at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:142)
> at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:129)
> at java.net.Socket.(Socket.java:273)
> at java.net.Socket.(Socket.java:100)
> at
>sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocket
Factory.java:25)
> at
>sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocket
Factory.java:120)
> at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:499)
> at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:190)
> at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:174)
> at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:83)
> at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
> at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:445)
> at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:429)
> at javax.naming.InitialContext.lookup(InitialContext.java:350)
>
>Tomcat is being started with -nonaming.
>
>
>-------------------------------------------------------
>Sponsored by:
>ThinkGeek at http://www.ThinkGeek.com/
>_______________________________________________
>JBoss-user mailing list
>[EMAIL PROTECTED]
>https://lists.sourceforge.net/lists/listinfo/jboss-user
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com
-------------------------------------------------------
Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user
-------------------------------------------------------
Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user
-------------------------------------------------------
Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user