Re: Invoking EJB but using *name* instead *IP*
Victor Langelo <[email protected]>
| Newsgroups | gmane.comp.java.sun.ejb.general |
|---|---|
| Message-ID | <[email protected]> |
Pedro, RMI will not work if the server address is being translated by a NAT router. See the list archives in particular http://archives.java.sun.com/cgi-bin/wa?A2=ind0211&L=ejb-interest&P=R13738&I=-3 <http://archives.java.sun.com/cgi-bin/wa?A2=ind0211&L=ejb-interest&P=R13738&I=-3> --Victor Pedro Salazar wrote: >Greetings, > >I'm trying to invoke a remote interface of a EJB. However, my server has >1 network interface card which is viewed as 10.xxx and as 192.xxx, >dependent of the network (the 192.xxx is translated by NAT in the >firewall). > >When I invoke my EJB (even over HTTP) if the client is in the network >10.xxx all works fine. When the client is in the 192.xxx network it >hangs on the lookup() for a while (about 1-2 min) and then it will hang >for long time in the create() until an exception is thrown: > >" >initial context... >lookup... >narrow... >create... >java.rmi.ConnectException: Connection refused to host: 10.112.80.4; >nested exception is: > java.net.ConnectException: Connection timed out > at >sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:567) > at >sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185) > at >sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171) > at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:101) > at >org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source) > at >org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:135) > at >org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:96) > at >org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46) > at >org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:45) > at >org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:173) > at >org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85) > at $Proxy1.create(Unknown Source) > at pt.ptinovacao.teste.ejb.TesteEJB.main(TesteEJB.java:32) >Caused by: java.net.ConnectException: Connection timed out > at java.net.PlainSocketImpl.socketConnect(Native Method) > at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:295) > at >java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:161) > at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:148) > at java.net.Socket.connect(Socket.java:425) > at java.net.Socket.connect(Socket.java:375) > at java.net.Socket.<init>(Socket.java:290) > at java.net.Socket.<init>(Socket.java:118) > at >sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22) > at >sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:122) > at >sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562) > ... 12 more >" > >I don't know but you may clarify me this, independent of the invocation >way (directly or over HTTP), the RMI callbacks are always made directly >to client, right? > >Any ideas how to solve this problem? > >I'm using the name of the host instead the IP address, but it throws >the error of connection refused to host 10.xxx!!! Why is using the ip >address instead the network name? In my application server (JBOSS) I >already put in the jboss-service all JNDI references to the host name. > >thanks. > >regards, >Pedro Salazar. >-- >PS >[email protected] >PGP:0E129E31D803BC61 > >=========================================================================== >To unsubscribe, send email to [email protected] and include in the body >of the message "signoff EJB-INTEREST". For general help, send email to >[email protected] and include in the body of the message "help". > > =========================================================================== To unsubscribe, send email to [email protected] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [email protected] and include in the body of the message "help".