Skip to main content

Connection prob, coja-server@W2k8-R2

  6 posts   Feedicon  
Replies: 5 - Last Post: December 02, 2011 14:04
by: danny70437
showing 1 - 6 of 6
Posted: November 28, 2011 19:38 by danny70437
Hallo coja-members,

we are running a coja-server on a W2K8-R2 machine.

If we try to connect to this machine from a remote client,
we get always an exception.

If we connect using a local client (means, the client
runs on the same machine than the coja server), all
works fine.

If we configured the coja-server on a winxp/w2k8 machine,
we can connect from a local/remote client well.

Also, we captured the traffic between the client and server:
about 15 Ethernet-packages in both directions. So, we have
no firewall issue.

So, I think the server returns "127.0.0.1" to the client and
the client tries to use this "new" IP-address ... But why ?

The coja server listen to ALL interfaces.

On the server, the remote method is not called, nor any information in the logfile.

Out server/clients works now for 2 year - the only problem is the installation on the
W2K8-R2 machine.

May somebody can help me ?

kind regards
Danny


Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
at $Proxy0.runSynchronouslyAsUser(Unknown Source)
at de.dtnet.swd.agent.client.AgentCaller.main(AgentCaller.java:87)
Caused by: java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
java.net.ConnectException: Connection refused
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 gnu.cajo.invoke.Remote_Stub.invoke(Unknown Source)
at gnu.cajo.invoke.Remote.invoke(Unknown Source)
at gnu.cajo.utils.extra.TransparentItemProxy.invoke(Unknown Source)
... 2 more
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:519)
at java.net.Socket.connect(Socket.java:469)
at java.net.Socket.<init>(Socket.java:366)
at java.net.Socket.<init>(Socket.java:180)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
at gnu.cajo.invoke.Remote$RCSF.createSocket(Unknown Source)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
... 8 more


** Client
- AgentCaller.java:87: AgentCaller is the client. In line 87, the coja server is called.

- The call to the backend looks like this
String this.url = "//" + serverHostname + ":" + port + "/"+serviceName;
MachineAgentIF2 agent = (MachineAgentIF2) TransparentItemProxy.getItem(url, new Class[] { MachineAgentIF2.class });
agent.myMethod();


** Server - looks a little bit like this:
Remote.config(hostname, 1098, null, 0);

private static final MachineAgentManager machineAgentManager = new MachineAgentManager();
private static final VersionServer versionServer = new VersionServer();

ItemServer.bind(machineAgentManager, MachineAgentServerService.getDefaultServiceName());
ItemServer.bind(versionServer, MachineAgentVersionService.getDefaultServiceName());
LOGGER.info("Services [machineAgentManager, versionServer] registered.");

Posted: November 28, 2011 22:14 by Jan Staal
You could be the victim of stricter security policies on 2008R2 machines.
Even ordinary ping response is disabled by default on this operating system.
Not exactly sure which policy is affecting you, but give it a try.
Posted: November 29, 2011 08:10 by danny70437
I tried to disabled the firewall - but it does not work.
Also i can connect via telnet to the server (coja port) and get a response.
So, it may not be a firewall topic.

I think it has something to do with the x64-bit window. Does anybody
run coja server on a windows7-64Bit or W2k8-R2 successfully and is
able to connect from another, remote client to this server ?

kind regards
Danny

Posted: November 29, 2011 14:51 by Jan Staal
Hi Danny,

Haven't tried it on a 64bit server. But I was not talking about the firewall, but the policies that block these connections. Policies can be enforced domain wide or on the local machine depending on your network realm setup. However this might also be an enforced java policy. If you look in the project sources in the ItemServer class, you see which java policies are required for it to work.

<p>< grant codeBase "file:${java.class.path}" {

permission java.security.AllPermission;

};

grant {

permission java.net.SocketPermission "*:1024-", "accept";

permission java.net.SocketPermission "*", "connect";

};
Posted: December 02, 2011 11:10 by danny70437
We tried to setup this server.policy - but I get the same result.
-Djava.security.manager
-Djava.security.policy=conf/server.policy

I think it may has something to do with the RMI - not mit cajo itself.

Also, I added the "-Djava.rmi.server.hostname=10.1.1.52" - but no success.

If I start the client running on the SAME W2k8R2 server than the cajo server is running on.
it works great. Only connecting from remote produces these kind of problems.

Any additional ideas to track down this issue ?

kind regards
Danny
Posted: December 02, 2011 14:04 by danny70437
We found the problem!!

There was a wrong entry in the hosts file (%systemroot%\system32\drivers\etc)
of our (vanilla installed !!) W2k8-R2(DE) server:

127.0.0.1 <TheNameOfTheServer>

We fixed this to "127.0.0.1 localhost" and all worked fine. I found the hint to the hosts-file
in another forum: http://forum.springsource.org/showthread.php?33711-RMI-invocation-attempts-connecting-to-127.0.0.1

Jan, thanks for your help !

Best regards
Danny

showing 1 - 6 of 6
Replies: 5 - Last Post: December 02, 2011 14:04
by: danny70437
 
 
Close
loading
Please Confirm
Close