Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ, can't start simple web application: Unable to ping server at localhost:1099

I'm trying to make a simple web app in IntelliJ by following this tutorial: http://wiki.jetbrains.net/intellij/Creating_a_simple_Web_application_for_Tomcat_in_IntelliJ_IDEA_12

I believe my Tomcat is installed correctly since I see the tomcat pictures when I go to http://localhost:8080/

I've followed all the steps up until the part it tells me to run index.jsp, at which point I get the error:

Error: Exception thrown by the agent : java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException: nodename nor servname provided, or not known 

I see this in the log:

Application Server was not connected before run configuration stop, reason:            Unable to ping server at localhost:1099 

This 1099 comes from the JMX port in Run -> Edit Configurations.

How do I fix this?

like image 866
Popcorn Avatar asked Sep 28 '13 16:09

Popcorn


People also ask

How do I run a web app locally in IntelliJ?

From the main menu, select View | Open in Browser. Use the browser popup in the top right part of the editor window. Click the browser button to open the web server file URL, or Shift+Click it to open the local file URL.

Does IntelliJ have embedded Tomcat?

Which version of IntelliJ are you using? FYI, you can run Jetty from within IntelliJ, then later deploy to Tomcat. For a preconfigured example, try a Vaadin starter web app, choosing the "Plain Java Servlet" flavor.

How do I run a client server program in IntelliJ?

To launch the server, right-click on the class containing the main() method and select "run". Likewise for the client. When you do this, each program is added to IntelliJ's run configurations (a dropdown list to the left of the green arrow on IntelliJ's button bar).


Video Answer


1 Answers

To fix this you need add your machine name in the /etc/hosts file to point to localhost(127.0.0.1).

You can find your machine name by running the following command:

$ hostname macbook-pro 

From the output above you know your hostname is "macbook-pro". Edit "/etc/hosts" file and add that name at the end of line that lists 127.0.0.1

127.0.0.1 localhost macbook-pro 

Save the file.

Now you IntelliJ should be able to start your server.

like image 78
bond Avatar answered Sep 20 '22 02:09

bond