Trying to run my app with IntelliJ 13 and Apache tomcat 7.0.42. JDK1.6
Always getting the error Artifact app:war exploded: Server is not connected. Deploy is
Please check this answer posted by Christian and also read that thread. Tomcat deployment issue via IntelliJ
Simply try removing setenv.sh in $CATALINA_HOME/bin
In my case, Intellij IDEA doesn't support run tomcat8 installed from linux repositories. /usr/share/tomcat/bin/catalina.sh start (not support) /usr/share/tomcat/bin/catalina.sh run (supported)
Only tomcat8 installed from official website. I tried with distribution downloaded from http://tomcat.apache.org/download-80.cgi. So I got successful results.
The reason is in the catalina.sh file from linux distribution, where there isn't "run" command. But in the tomcat downloaded there is "run" command. catalina.sh_InstalledFromLinuxRepository
tomcat-7.0-doc RUNNING
(3.2) Set JRE_HOME or JAVA_HOME (required)
These variables are used to specify location of a Java Runtime Environment or of a Java Development Kit that is used to start Tomcat.
The JRE_HOME variable is used to specify location of a JRE. The JAVA_HOME variable is used to specify location of a JDK.
Using JAVA_HOME provides access to certain additional startup options that are not allowed when JRE_HOME is used.
If both JRE_HOME and JAVA_HOME are specified, JRE_HOME is used.
I had this issue today and it wasn't due to setenv.sh as discussed on the other thread. In the end it was an issue with $CATALINA_BASE/conf/server.xml.
For some reason in our server.xml we were using a custom engine name for example
<Engine name="custom-value" defaultHost="localhost">
I tried again with a clean server.xml from tomcat 7.0.57 and the artifact deployed perfectly. After trial and error it came down to this one line.
Changing engine name to 'Catalina' as shown below value fixed our issue and allowed our exploded artifact to deploy using our customised server.xml
<Engine name="Catalina" defaultHost="localhost">
If you are seeing this issue try a clean server.xml and work backwards from there.
Do you set JAVA_OPTS anywhere in Tomcat bat/sh files? If you do, make sure to keep previous values also - IDEA seems to use those to specify some connection options to Tomcat. E.g. in .sh files do
JAVA_OPTS="<your new stuff> $JAVA_OPTS"
instead of just
JAVA_OPTS=<your new stuff>
P.S. Same answer as this actually: https://stackoverflow.com/a/28867346/307295