Ahmed Adeyemi's picture

I built a new Turnkey Linux server (with Apache and MySQL) on version 17.1. After the build I put in some general configurations such as changing the host (/etc/host), the config file, and a few other general configurations to set different parameters i will be using for connection ( /usr/share/tomcat9/bin/setenv.sh). When I try to connect to the RMI port, I am getting errors that the connection is refused.

I am getting this error both from external (other servers) and from internal (the same Turnkey server). When using Turnkey Linux 14.X that I have worked with in the past and tomcat6 or tomcat7, these configurations have worked and was just wondering if anyone could provide any pointers.

 

For my "/usr/share/tomcat9/bin/setenv.sh" configuration below is what i have. This is the only aspect i am thinking would cause the issue but I could be blind as well.

export JPDA_ADDRESS=8000
export JPDA_TRANSPORT=dt_socket
export JAVA_OPTS="-Djava.rmi.server.hostname=10.121.80.55 -Xms4096m -Xmx4096m -XX:MaxPermSize=2048m"

 

I have opened port 1099 which is traditionally what is used for RMI and i can see its not opened. If i go to the old server, i built, its works fine.

Old Version turnkey-tomcat-apache-14.2-jessie-amd64

New Version: turnkey-tomcat-apache-17.1-bullseye-amd64

 

Broken Server

root@latiwoserver1 .../lib/tomcat9# curl 10.121.80.55:1099
curl: (7) Failed to connect to 10.121.80.55 port 1099: Connection refused

 

 

Old Server (Working)

root@nevicampute ~# curl 10.129.80.180:1099
curl: (52) Empty reply from server

Forum: 
Tags: 
Jeremy Davis's picture

TBH, I had to google what RMI is/was! So I don't think I'm going to be tons of help (my knowledge tends to be broad rather than deep).

From what I gather from googling, RMI allows an object running in one Java vm to invoke methods on an object running in another and is often used for debugging. So my first suggestion is to check if your server is already listening on the port you suspect. This should do the trick:

netstat -tlnp

And in the "Local Address" column, look for entries that end in ':1099' (assuming port 1099). If it's not listed there, then it definitely isn't running and probably requires configuration of some sort! If it is listed there, but is not listed as "0.0.0.0:1099" or ":::1099" (e.g. listed as "127.0.0.1:1099") then it's bound to localhost and you'll need to ensure that it's listening globally.

If you confirm that it's not available/running, then I suggest that you reboot your server then once you've logged back in, check the journal since boot:

journalctl --boot=1

Look for any error messages, especially any related to Tomcat, Java or other similar related stuff.

Beyond that, I'm not really sure... As you're likely already aware, whilst the Apache config is provided by us, the Tomcat config itself is pretty standard.

If you continue to have issues, please share more info about exactly what you are actually trying to do. If I can understand the problem and locally recreate it, I'm fairly confident that I can work it out. If not, I might at least have some ideas of where you might get help?

Ahmed Adeyemi's picture

Thanks for your response. I surprisingly stumbled into a try today. So I had been running the netstat to see what ports it’s been listening on so I realized running the command rmiregistry & allows it to begin listening on port 1099 which I am able to bypass that specific error but stumbled into another error “java.rmi.NotBoundException: base.rmi.server.controller”. I will keep chin ping away to see if I can resolve this. Essentially, I am using this servers to run multiple API request all codes using Java to process database requests and status of live call events.

Add new comment