Bugs item #557209, was opened at 2002-05-17 05:20
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=376685&aid=557209&group_id=22866
Category: JBossServer
Group: v3.0 Rabbit Hole
Status: Closed
Resolution: Invalid
Priority: 5
Submitted By: Christian Riege (lqd)
Assigned to: Scott M Stark (starksm)
Summary: IntiialContext() fails to remote server
Initial Comment:
scott,
this seems to be something w/ respect to your changes
in org.jnp.naming. the current Branch_3_0 gives me an
exception when connecting to a JNDI server that is
running on a remote machine (above are the Properties
that I'm trying to use):
Using: {jnp.port=12345,
java.naming.provider.url=195.145.13.46:1099,
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory,
jnp.rmiPort=0, jnp.localPort=9876,
java.naming.factory.url.pkgs=org.jnp.interfaces,
jnp.localAddress=195.145.13.33}
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:350)
at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:137)
at
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:124)
at java.net.Socket.<init>(Socket.java:268)
at java.net.Socket.<init>(Socket.java:95)
at
sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:20)
at
sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:115)
at
sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:494)
at
sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
at
sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:169)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:78)
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:345)
it could be that there are "just" some of my Properties
messed up; however this used to work up until yesterday.
regards,
christian
----------------------------------------------------------------------
>Comment By: Scott M Stark (starksm)
Date: 2002-05-21 08:00
Message:
Logged In: YES
user_id=175228
I don't see that there is any access to the stub endpoint
information other than parsing its toString form which I'm
not going to do. Go beat up on your linux vendor for
defaulting the hostname to the localhost interface. RedHat
is notorious for this.
----------------------------------------------------------------------
Comment By: Christian Riege (lqd)
Date: 2002-05-21 06:21
Message:
Logged In: YES
user_id=176671
adrian and scott,
thanks for the pointers; turned out my /etc/hosts had the
hostname of the machine pointing to 127.0.0.1. Once I
changed that to the IP of my eth0 interface things started
working again.
just a quick thought w/o having looked at the JBoss source:
would it be possible to ensure that we don't return a stub
pointing to 127.0.0.1 if we know that the call came in via
an interface other than 127.0.0.1?!
----------------------------------------------------------------------
Comment By: Adrian Brock (ejort)
Date: 2002-05-17 08:27
Message:
Logged In: YES
user_id=9459
Try this link. This indicates an error in your ip config.
http://main.jboss.org/forums/thread.jsp?forum=67&thread=8092
Regards,
Adrian
----------------------------------------------------------------------
Comment By: Scott M Stark (starksm)
Date: 2002-05-17 08:15
Message:
Logged In: YES
user_id=175228
This is working for me. I initially saw the same problem
and I added a log statement to show the RMI stub exported
on the server and I had the server address setup
incorrectly. After fixing that this test program works fine:
jboss-all 1146>cat tstNS.java
import java.util.Properties;
import javax.naming.*;
class tstNS
{
public static void main(String[] args) throws Exception
{
Properties env = new Properties();
env.setProperty
("java.naming.factory.initial","org.jnp.interfaces.NamingCo
ntextFactory");
env.setProperty
("java.naming.factory.pkgs","org.jnp.interfaces");
env.setProperty
("java.naming.provider.url","172.17.66.53:1099");
env.setProperty("jnp.port", "12345");
env.setProperty("jnp.rmiPort", "0");
env.setProperty("jnp.localPort", "9876");
env.setProperty("jnp.localAddress","172.17.66.54");
InitialContext ctx = new InitialContext(env);
System.out.println("Created InitialContext");
Object ut = ctx.lookup("UserTransaction");
System.out.println("Found UserTransaction, ut="+ut);
}
}
jboss-all 1147>cat tstNS.sh
#!/bin/sh
CLIENT=build/output/jboss-3.0.0RC3/client
CP="$CLIENT/jnp-client.jar;$CLIENT/jnet.jar;."
OPTS=-Dsun.rmi.transport.tcp.logLevel=99
java -cp $CP $OPTS tstNS
jboss-all 1144>tstNS.sh
Created InitialContext
Fri May 17 08:22:28 PDT 2002:tcp:main:TCPEndpoint.<clinit>:
localHostKnown = true, localHost = 172.17.66.54
Fri May 17 08:22:28 PDT 2002:tcp:main:TCPTransport.<init>:
Version = 2, ep = [172.17.66.54:0]
Fri May 17 08:22:28 PDT
2002:tcp:main:TCPEndpoint.getLocalEndpoint: created loca
l endpoint for socket factory null on port 0
Fri May 17 08:22:28 PDT
2002:tcp:main:TCPChannel.newConnection: create connectio
n
Fri May 17 08:22:28 PDT
2002:tcp:main:TCPEndpoint.newSocket: opening socket to [
172.17.66.53:34079]
Fri May 17 08:22:28 PDT
2002:tcp:main:TCPChannel.newConnection: server suggested
172.17.66.100:3380
Fri May 17 08:22:28 PDT
2002:tcp:main:TCPChannel.newConnection: using 172.17.66.
54:0
Fri May 17 08:22:28 PDT 2002:tcp:main:TCPChannel.free:
reuse connection
Fri May 17 08:22:28 PDT 2002:tcp:main:TCPChannel.free:
create reaper
Fri May 17 08:22:28 PDT
2002:tcp:main:TCPChannel.newConnection: reuse connection
Fri May 17 08:22:28 PDT 2002:tcp:main:TCPChannel.free:
reuse connection
Found UserTransaction, ut=Reference Class Name:
org.jboss.tm.usertx.client.Clien
tUserTransaction
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=376685&aid=557209&group_id=22866
_______________________________________________________________
Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development