问题

在我们配置好Tomcat之后去执行,会出现Unable to connect to the localhost:1099这个问题,这个问题是因为我们运行的是本地的代码而不是远程的代码,所以在配置tomcat的时候需要选择local而不是remote。

Error:Unable to connect to the localhost:1099_war包

方案

1.编辑tomcat的配置

Error:Unable to connect to the localhost:1099_war包_02


2.将之前配置好的tomcat进行移除

Error:Unable to connect to the localhost:1099_tomcat_03


3.然后点击添加,找到Tomcat,选择Local即可。

注:如果是运行本地的代码需要选择Local如果运行远程的代码需要选择Remote

Error:Unable to connect to the localhost:1099_jvm_04


4.添加完之后在对应的配置jdk和war包什么的就可以了。