Tomcat在Idea中。战争爆炸:服务器没有连接。部署不可用 [英] Tomcat in Idea. war exploded: Server is not connected. Deploy is not available

查看:321
本文介绍了Tomcat在Idea中。战争爆炸:服务器没有连接。部署不可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试 tutoial 。我创建了新项目并运行它。
TomCat开始了,但后来什么也没发生。我可以在浏览器 http:// localhost:8080 中手动打开并查看TomCat主页。这意味着服务器可以启动。但是我无法打开index.jsp。这是我开始后的屏幕:
截图
正如您所看到的,项目正在运行,但没有关于传递的环境变量的信息。
没有日志。

I'm trying this tutoial. I created new project and ran it. TomCat started, but then nothing happened. I can manually open in browser http://localhost:8080 and see the TomCat home page. It means server can be started. However I can't open index.jsp. Here is my screen after start: screenshot As you can see the project is running, but no info about passed environment variables. No logs.

我使用TomCat 7.0.27

I use TomCat 7.0.27

Idea 12.1.6

Idea 12.1.6

on Opensuse 12.2

on Opensuse 12.2

我的tomcat HOME文件夹是 / usr / share / tomcat

My tomcat HOME folder is /usr/share/tomcat

出现问题:
Idea无法将/ usr / share / tomcat / conf中的conf文件复制到/ home / loco / .IntelliJIdea12 /系统/ Tomcat的// CONF。
我在 / usr / share / tomcat中执行了 chmod 777 * ,问题就解决了。

There was a problem: Idea couldn't copy conf files from /usr/share/tomcat/conf to /home/loco/.IntelliJIdea12/system/tomcat//conf. I executed chmod 777 * in /usr/share/tomcat and the problem gone.

我也改变了TomCat的启动方式。
这是默认值

Also I changed the way how TomCat is started. It was default value

/usr/share/tomcat/bin/catalina.sh run

我改为

/usr/share/tomcat/bin/catalina.sh start

所有其他步骤均按照教程。

All other steps are done in accordance to tutorial.

推荐答案

当tomcat启动脚本中的一个脚本时出现问题(最常见的是 setenv.sh / setenv.bat )覆盖 JAVA_OPTS 环境变量,不包括原始值。 IDEA设置 JAVA_OPTS 告诉tomcat在1099上侦听状态和部署等事件的JMX请求。

The issue happens when a script in the tomcat startup set of scripts (most commonly setenv.sh / setenv.bat) override the JAVA_OPTS environment variable without including the original value. IDEA sets JAVA_OPTS to tell tomcat to listen on 1099 for JMX requests for things like status and deployments.

示例来自 setenv.sh 的一行将破坏:

An example of a line from a setenv.sh that will break:

export JAVA_OPTS="-XX:MaxPermSize=512m -Xmx1024m"

更正后的版本:

export JAVA_OPTS="$JAVA_OPTS -XX:MaxPermSize=512m -Xmx1024m"

来自windows的相同示例行 setenv.bat 文件:

The same example lines from a windows setenv.bat file:

set JAVA_OPTS=-XX:MaxPermSize=512m -Xmx1024m

并更正:

set JAVA_OPTS=%JAVA_OPTS% -XX:MaxPermSize=512m -Xmx1024m

如果您只在IDEA中运行tomcat,您可以像其他人一样建议并从中删除​​该行setenv 脚本并将jvm选项放在IDEA运行配置中。

If you only run tomcat from within IDEA, you can do as other have suggested and remove the line from your setenv script and put the jvm options inside the IDEA run configuration.

这篇关于Tomcat在Idea中。战争爆炸:服务器没有连接。部署不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆