本文介绍了IntelliJ,无法启动简单的Web应用程序:无法在localhost:1099 ping服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试按照本教程在IntelliJ中创建一个简单的Web应用程序:

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

我相信我的Tomcat安装正确,因为当我去
<$ c时我看到tomcat图片$ c> http:// localhost:8080 /

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

我已经按照所有步骤进行操作,直到它告诉我运行 index.jsp ,此时我收到错误:

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

错误:代理抛出异常:java.net .MalformedURLException:本地主机名未知:java.net.UnknownHostException:提供nodename或servname,或者不知道

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,原因:
无法在localhost ping服务器:1099

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

这个1099合作来自运行中的JMX端口的mes - >编辑配置

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

如何解决此问题?

推荐答案

要解决此问题,您需要在/ etc / hosts文件中添加您的计算机名称以指向localhost(127.0.0.1)。

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

从上面的输出中你知道你的主机名是macbook-pro。
编辑/ etc / hosts文件并在列出127.0.0.1的行尾添加该名称

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

保存文件。

现在你IntelliJ应该能够启动你的服务器了。

Now you IntelliJ should be able to start your server.

这篇关于IntelliJ,无法启动简单的Web应用程序:无法在localhost:1099 ping服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 08:38