0 Replies Latest reply: Aug 8, 2012 2:51 AM by BRN BRN RSS

external ip not connected in jboss sever4.0

BRN BRN Newbie

hi all,

 

i have using ejb2.0 with jboss server 4.0 .my server program running private ip network then my client program running external ip through internet.but my client not connecting  internal server.

 

           Properties props = new Properties(); 

            props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces"); 

            props.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.security.jndi.JndiLoginInitialContextFactory"); 

            props.setProperty(Context.PROVIDER_URL, "externalhost:1099"); 

            props.put("java.naming.factory.initial", 

                    "org.jnp.interfaces.NamingContextFactory"); 

            props.put("java.naming.factory.url.pkgs", 

                    "org.jboss.naming:org.jnp.interfaces"); 

            props.put("java.naming.provider.url", "jnp://externalhost:1099");

 

 

run steps

------------

1. jboss server running - private ip

2. client running external ip -

3. run server linux server : sh  run.sh

 

Client exception

 

 

Exception caughtjavax.naming.CommunicationException [Root exception is java.rmi.

ConnectException: Connection refused to host: xxxxxxxxxxxxx; nested exc

eption is:

        java.net.ConnectException: Connection timed out: connect]

javax.naming.CommunicationException [Root exception is java.rmi.ConnectException

: Connection refused to host: xxxxxxxxxxxxx; nested exception is:

        java.net.ConnectException: Connection timed out: connect]

        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:722)

        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)

        at javax.naming.InitialContext.lookup(Unknown Source)

        at welclient.main(welclient.java:47)

Caused by: java.rmi.ConnectException: Connection refused to host: xxxxxxxxxxx nested exception is:

        java.net.ConnectException: Connection timed out: connect

        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)

        at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)

        at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)

        at sun.rmi.server.UnicastRef.invoke(Unknown Source)

        at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)

        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)

        ... 3 more

Caused by: java.net.ConnectException: Connection timed out: connect

        at java.net.DualStackPlainSocketImpl.connect0(Native Method)

        at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)

        at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)

        at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)

        at java.net.AbstractPlainSocketImpl.connect(Unknown Source)

        at java.net.PlainSocketImpl.connect(Unknown Source)

        at java.net.SocksSocketImpl.connect(Unknown Source)

        at java.net.Socket.connect(Unknown Source)

        at java.net.Socket.connect(Unknown Source)

        at java.net.Socket.<init>(Unknown Source)

        at java.net.Socket.<init>(Unknown Source)

        at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown S

ource)

        at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown S

ource)

        ... 9 more

 

 

kindly tell me steps avoid above this problem.