Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

tunneling rmi

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have an apache sever started on http://IP1:8000/ and a tomcat server stated on http://IP1:8080/ . this servers are integrated with JK2. in the server tomacat the servelethandler of the sun is configureted. also
i have a RMI server strated in the machine with IP1:1099.
the code of the server is
try {
HelloImpl1 obj = new HelloImpl1();
Naming.rebind("//IP1:1099/HelloServer", obj);
System.out.println("HelloServer bound in registry");
}
In other hand, a client is started on other worlsation with IP2. the code of this client is:
try {
RMISocketFactory.setSocketFactory(new sun.rmi.transport.proxy.RMIHttpToCGISocketFactory());
Hello obj = (Hello) Naming.lookup("//141.115.8.53:1009/HelloServer");
message = obj.sayHello();
System.out.println(message);
}
my problem is when I execute the code of the customer, I have the following errors:
java.net.ConnectException: Connection refused
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.newCall(UnicastRef.java:313)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Naming.java:84)
at HelloClient.main(HelloClient.java:85)
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:452)
at java.net.Socket.connect(Socket.java:402)
at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
at sun.net.www.http.HttpClient.New(HttpClient.java:339)
at sun.net.www.http.HttpClient.New(HttpClient.java:320)
at sun.net.www.http.HttpClient.New(HttpClient.java:315)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:512)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:489)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:560)
at sun.rmi.transport.proxy.HttpSendSocket.writeNotify(HttpSendSocket.java:138)
at sun.rmi.transport.proxy.HttpSendSocket.<init>(HttpSendSocket.java:86)
at sun.rmi.transport.proxy.RMIHttpToCGISocketFactory.createSocket(RMIHttpToCGISocketFactory.java:27)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
... 6 more


sorry for my english and thanks for youe reponses
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the code in your client copied directly?



The port number isn't correct - it should be 1099 if you are trying to connect to the RMI server directly, or 8000 if you are trying to test out RMI-HTTP tunnelling through Apache.
 
Could you hold this kitten for a sec? I need to adjust this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic