[jboss-user] JBoss+remote client connection refused issues

Allan Kamau kamauallan at yahoo.com
Fri May 25 07:31:16 EDT 2007


Hi,
Am running JBoss-4.2.0.GA and it appears I am unable
to establish a connection from a client running
remotely.
A quite port scan (between port 1000 and 10000) using
'localhost' or '127.0.0.1' indicates an open port
1099. But a similar scan using 192.168.0.2 (the
computer's ip) reports the port 1099 closed.
How can I enable JBoss to listen on all the server's
IPs?

When I run the client locally and connect using
'localhost:1099' or '172.0.0.1:1099' the connection
succeeds, but when I provide the computer's ip
'192.168.0.2:1099' I get the printStackTrace() output
below
<error>
     [java] javax.naming.CommunicationException: Could
not obtain connection to any of these urls:
jnp://192.168.0.2:1099 and discovery failed with
error: javax.naming.CommunicationException: Receive
timed out [Root exception is
java.net.SocketTimeoutException: Receive timed out]
[Root exception is
javax.naming.CommunicationException: Failed to connect
to server 192.168.0.2:1099 [Root exception is
javax.naming.ServiceUnavailableException: Failed to
connect to server 192.168.0.2:1099 [Root exception is
java.net.ConnectException: Connection refused]]]
     [java]     at
org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1414)
     [java]     at
org.jnp.interfaces.NamingContext.lookup(NamingContext.java:594)
     [java]     at
org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
     [java]     at
javax.naming.InitialContext.lookup(InitialContext.java:351)
</error>

Below is my client code
    public static Context getInitialContext() 
        throws javax.naming.NamingException 
    {
			InitialContext ctx=null;
			try{
				ctx = new InitialContext();
			
ctx.addToEnvironment("java.naming.factory.initial",
				"org.jnp.interfaces.NamingContextFactory");
			
ctx.addToEnvironment("java.naming.factory.url.pkgs",
				"org.jboss.naming:org.jnp.interfaces");
				ctx.addToEnvironment(Context.PROVIDER_URL,
"jnp://192.168.0.2:1099");
				/*
				SimpleSession simpleSession =
			
(SimpleSession)ctx.lookup(SimpleSession.class.getName());
			
System.out.println(simpleSession.sayHello("EJB3"));
				*/
			}catch (NamingException e){
				e.printStackTrace();
			}
			return ctx;
			//return new javax.naming.InitialContext();
    }

Allan.



 
____________________________________________________________________________________
The fish are biting. 
Get more visitors on your site using Yahoo! Search
Marketing.
http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php


       
____________________________________________________________________________________Need a vacation? Get great deals
to amazing places on Yahoo! Travel.
http://travel.yahoo.com/



More information about the jboss-user mailing list