Reputation: 11
I am in the process of developing a java web application, and am using the web framework Spark which utilizes Jetty (An http server written in java created by eclipse). Spark makes use of Jetty's embedded webserver functionality, essentially creating a Jetty instance within the app. When creating an executable jar of my application and running on windows, all is well and I can connect to my app locally through http://localhost:81 (I am using port 81). Eventually, I'd like the app to run on a linux server, but upon executing the jar on ubuntu, I am unable to connect to the app locally. I only have a moderate understanding of linux, and cannot figure out why this is happening. I am executing the command 'java -jar G2.jar &' in screen, and it seems to be executing properly. I have ensured that the JDK on ubuntu matches the version installed on my windows machine. I have been testing on an AWS ec2 ubuntu instance and an ubuntu vm, and have had no luck on either.
wget:
wget 127.0.0.1:81
--2016-10-24 21:10:24-- http://127.0.0.1:81/
Connecting to 127.0.0.1:81... failed: Connection refused.
curl:
curl 127.0.0.1:81
curl: (7) Failed to connect to 127.0.0.1 port 81: Connection refused
I have flushed iptables, and even disabled ufw with no luck. Both the ec2 instance and vm are fresh ubuntu installs. I am beginning to think the problem is within Jetty, and that it possibly requires different configuration on linux? The issue is, Spark handles the embedded Jetty instance, and I am unfamiliar with how it does so. Has anybody dealt with this type of issue before?
Upvotes: 0
Views: 1329
Reputation: 11
I fixed the issue. I figured that using the '&' at the end of the command to run the app as a background process would work fine, but guess it does not. Instead, I just used sudo without the '&' and it works now.
Upvotes: 1