Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8175845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:55:20+00:00 2026-06-06T22:55:20+00:00

When I test an RMI client and server with the class files it works

  • 0

When I test an RMI client and server with the class files it works without any issue on two different machines. Now when I do the same thing with a jar the client fails to connect to the RMIRegistry on the server. Then when I test with the jar on the same machine, the client can connect to the server (even over the network ip and not localhost).

I suspect this has something to do with the RMI registry, but i’m a total novice at RMI, so I have no clue…

I create an RMIRegistry like so:

rmiregistry = LocateRegistry.createRegistry(ServiceConstraints.REGISTRY_PORT);
rmiService = (RmiSubjectService) UnicastRemoteObject.exportObject(this,
                    ServiceConstraints.REGISTRY_PORT);
rmiregistry.rebind("RmiService", rmiService);

The client connects like this:

remoteService = (RmiSubjectService) Naming.lookup("/" + host + ":"+ port + "/RmiService");

The error I get on the client when running with a jar:

java.rmi.ConnectException: Connection refused to host: 192.168.2.132; nested exception is:
        java.net.ConnectException: Connection timed out: 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)
        at java.rmi.Naming.lookup(Unknown Source)
        at ch.uzh.ifi.group10.client.Client.subscribe(Client.java:148)
        at ch.uzh.ifi.group10.client.Client.main(Client.java:242)
        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 org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoa
der.java:58)
Caused by: java.net.ConnectException: Connection timed out: 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 S
ource)
        at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown S
ource)
        ... 13 more
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T22:55:21+00:00Added an answer on June 6, 2026 at 10:55 pm

    The problem did turn out to be the network. Specifically it was that I didn’t realize that my firewall was blocking the socket, so I could not connect.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to add test functionality for RMI connection (checking if the server on
I followed this step for configuration http://jmeter.apache.org/usermanual/remote-test.html The 2 machines are on same subnet.
I am looking for an opensource/free load testing tool to test applications over RMI.
test.c: int main() { return 0; } I haven't used any flags (I am
class Test { public static void main(String[] args) throws Exception { Test t =
Test Driven Development (TDD) and its benefits are well defined. The same can be
test = Array.new test[0] = foo works fine test[] = foo returns an error.
#test is the selector for id=test .test is the selector for class=test but how
test RandomNumberGenerator rng; cout << rng() << endl; header class RandomNumberGenerator { public: unsigned
I'm having a problem sending java.util.Date objects over RMI, to and from machines in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.