Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
214 views
in Technique[技术] by (71.8m points)

java - Tomcat in Idea. war exploded: Server is not connected. Deploy is not available

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.

I use TomCat 7.0.27

Idea 12.1.6

on Opensuse 12.2

My tomcat HOME folder is /usr/share/tomcat

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.

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

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

I changed to

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

All other steps are done in accordance to tutorial.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

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

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

the corrected version:

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

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

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

and corrected:

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

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...