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 "" 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

Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
at $Proxy0.runSynchronouslyAsUser(Unknown Source)
at de.dtnet.swd.agent.client.AgentCaller.main(
Caused by: java.rmi.ConnectException: Connection refused to host:; nested exception is: Connection refused
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(
at sun.rmi.transport.tcp.TCPChannel.createConnection(
at sun.rmi.transport.tcp.TCPChannel.newConnection(
at sun.rmi.server.UnicastRef.invoke(
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: Connection refused
at Method)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(
at gnu.cajo.invoke.Remote$RCSF.createSocket(Unknown Source)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(
... 8 more

** Client
- 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 });

** 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());"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

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}" {



grant {

permission "*:1024-", "accept";

permission "*", "connect";

Posted: December 02, 2011 11:10 by danny70437
We tried to setup this server.policy - but I get the same result.

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

Also, I added the "-Djava.rmi.server.hostname=" - 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
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: <TheNameOfTheServer>

We fixed this to " localhost" and all worked fine. I found the hint to the hosts-file
in another forum:

Jan, thanks for your help !

Best regards

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