This page is outdated, use FAQ instead. |
This document stands for resolving difficult problems or answers questions that you might have regarding DistributeMe product.
The structure of the document is pretty simple. Each section of this document describes a problem or a question and then the ways the problem can be solved.
When executing it I got the following exception stack trace:
CLIENT: Call to add method
Exception in thread "main" java.lang.RuntimeException: Couldn't lookup delegate because: Can't lookup service in the target rmi registry for an instance of org_distributeme_demo_GettingStartedService at test.anotheria.net:80
at org.distributeme.demo.generated.RemoteGettingStartedServiceStub.getDelegate(Unknown Source)
at org.distributeme.demo.generated.RemoteGettingStartedServiceStub.add(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.java.dev.moskito.core.predefined.ServiceStatsCallHandler.invoke(ServiceStatsCallHandler.java:74)
at net.java.dev.moskito.core.dynamic.MoskitoInvokationProxy.invoke(MoskitoInvokationProxy.java:165)
at $Proxy5.add(Unknown Source)
at org.distributeme.demo.test.DimeTester.test(Unknown Source)
at org.distributeme.demo.test.RemoteTest.main(Unknown Source)
Caused by: java.lang.RuntimeException: Can't lookup service in the target rmi registry for an instance of org_distributeme_demo_GettingStartedService
at org.distributeme.demo.generated.RemoteGettingStartedServiceStub.lookup(Unknown Source)
... 11 more
Caused by: java.rmi.ConnectException: Connection refused to host: 127.0.1.1; nested exception is:
java.net.ConnectException: Connection refused: 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.newCall(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
... 12 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(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 Source)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown Source)
... 17 more
How can I make the interraction work?
Still having the same issue? Check the following ...
Open your web browser and visit the web page http://test.anotheria.net/distributeme/registry/list.
The response of the web page might look like.
<?xml version="1.0"?><services><service id="org_distributeme_demo_GettingStartedService" host="127.0.1.1"/></services>
The cause of the problem is that the IP address 127.0.1.1 cannot be used for remote interraction.
To resolve just this problem do the following:
Now test the web page again http://test.anotheria.net/distributeme/registry/list.
You shoud see the following XML in response:
<?xml version="1.0"?><services><service id="org_distributeme_demo_GettingStartedService" host="10.1.13.43"/></services>
Then restart your RemoteTest client.
If you still having problems check your /etc/hosts file on Ubuntu machine and replace the line
127.0.1.1 igorlap
with the line
10.1.13.43 igorlap
The hosts file maps IP addresses to host names so in my case that was just a wrong mapping
Good luck!
My client does not want to use the standard DistributeMe registry which is located at test.anotheria.net:80.
Build distributeme.war and install it on your local tomcat.
Just use the following steps:
igor@igorlap:~/projects/dime$ cd ~/projects/dime/distributeme
igor@igorlap:~/projects/dime/distributeme$ ant -f build-registry.xml war
Buildfile: build-registry.xml
...
war:
[war] Building war: /home/igor/projects/dime/distributeme/dist/distributeme.warBUILD SUCCESSFUL
Total time: 4 seconds
Then deploy the just built distributeme.war file to webapps directory of your tomcat instance.
Start tomcat if it is not started already. Check the port number used for HTTP in the conf/server.xml file that comes with your tomcat instance. That port number and the host name or IP address where tomcat is started should be specified in the distributeme.json configuration file.
This is just an example:
{ registryContainerPort: 8080, registryContainerHost: "10.1.13.57", } |
10.1.13.57 - is the machine where tomcat server is started and distributeme.war is deployed to it. 8080 is the port number used for HTTP protocol by that tomcat instance.
Good luck!