Hello everyone!
First of all, sorry about my english, it sucks, I know.
I got a little problem using RMI on a linux server.
This is the stage...
Linux server:
Running CentOS 5.
Java & Javac -version: 1.6.0_24
SSH server running ok on port 22.
Open port 1099 for RMI with
system-config-securitylevel-tui Ok. Like
1099:tcp
iptables describes this configuration for por 1099
Code:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1099 -j ACCEPT
Data in /etc/hosts file
Code:
192.168.1.67 centos5test
127.0.0.1 centos5test
::1 localhost6.localdomain6 localhost6
Next verification
Code:
#nestat -napt |grep 1099
tcp 0 0 :::1099 :::* LISTEN 4054/java
tcp 0 0 ::ffff:192.168.1.67:1099 ::ffff:192.168.1.103:53525 ESTABLISHED 4054/java
tcp 0 0 ::ffff:192.168.1.67:1099 ::ffff:192.168.1.67:51309 ESTABLISHED 4054/java
tcp 0 0 ::ffff:192.168.1.67:51309 ::ffff:192.168.1.67:1099 ESTABLISHED 4054/java
192.168.1.103 is another machine with W7 OS... It has a RMI monitor.
It looks like conections are established but when I try to do any call to the RMI server, it fails.
When I look for the registry and the remote object with this Java line
Code:
Registry registry = LocateRegistry.getRegistry("192.168.1.67",1099);
Then print registry object to console and get:
RegistryImpl_Stub[UnicastRef [liveRef: [endpoint:[192.168.1.67:1099](remote),objID:[0:0:0, 0]]]]
So the registry EXISTS.
Next step, try to get the remote object, like this.
Code:
DataProvider dp = (DataProvider)registry.lookup(DataProvider.SERVICE_NAME);
Print the dp object to console and I get this:
Proxy[DataProvider,RemoteObjectInvocationHandler[UnicastRef [liveRef: [endpoint:[192.168.1.67:45719](remote),objID:[-e3dd853:12f5977846c:-7fff, 1478379431391312706]]]]]
Okey, it looks like its gonna work! But...
When I call a remote method (this method onlye returns true to the caller)... but never shows up!
After this, I get this error...
Code:
java.rmi.ConnectException: Connection refused to host: 192.168.1.67; nested exception is:
java.net.ConnectException: Connection timed out: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:110)
at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:178)
at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:132)
There's no timeout set up in any side of the test.
Other stages tested...
Win Server - Win Client (OK)
Win Server - Linux Client (
)
Linux Server - Linux Client (OK)
Linux Server - Win Client (
)
Any idea??? I newbie using linux and I can't figure out what's the problem...
Thanks u all...