Tomcat in Ideas. the war exploded: the server is not connected. Deployment Unavailable

I try this tutorial . I created a new project and started it. TomCat started, but then nothing happened. I can open manually in the browser http://localhost:8080 and see the TomCat home page. This means that the server can be started. However, I cannot open index.jsp. Here is my screen after starting: screenshot As you can see, the project is running, but there is no information about the transferred environment variables. No magazines.

I am using TomCat 7.0.27

Idea 12.1.6

on Opensuse 12.2

My home folder is tomcat /usr/share/tomcat

There was a problem: The idea could not copy the conf files from / usr / share / tomcat / conf to / home / loco / .IntelliJIdea12 / system / tomcat // conf. I ran chmod 777 * in /usr/share/tomcat and the problem gone.

I also changed the way TomCat starts. This is the default value.

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

I changed to

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

All other steps are performed in accordance with the manual.

+44
java intellij-idea tomcat
Nov 23 '13 at 15:07
source share
12 answers

The problem occurs when a script in a set of tomcat startup scripts (most often setenv.sh / setenv.bat ) overrides the JAVA_OPTS environment JAVA_OPTS , not 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 setenv.sh that will break:

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

fixed version:

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

Similar lines of lines from the windows setenv.bat file:

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

and fixed:

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

If you are just starting tomcat from IDEA, you can do as others suggested and remove the line from your setenv script and put the jvm parameters in the IDEA start configuration.

+55
Mar 04 '15 at 23:46
source share

I fixed this by deleting my setenv.bat in $ CATALINA_HOME / bin. Here were the settings inside:

 set JAVA_OPTS=-server -Xmx768m -XX:MaxPermSize=256M 

I no longer need these options, so I just deleted the file. As prule's answer says, you can move these parameters to the Intellij Run configuration. After deleting the file, the deployment worked fine inside IntelliJ.

edit: for a better answer on why this works, check out the answer below . In addition, using your method, you can save your setenv.sh/setenv.bat, which is useful if you are not only starting Tomcat from IntelliJ IDEA.

+28
Apr 02 '14 at 19:33
source share

Removing setenv.sh from $CATALINA_HOME/bin also worked for me. I am running tomcat7 / Ubuntu / IntelliJ 12

With setenv.sh in the bin folder, when running inside IJ I see in the logs:

 /usr/local/tomcat/apache-tomcat-7.0.52/bin/catalina.sh run [2014-07-28 02:41:39,274] Artifact TomcatDebug:war exploded: Server is not connected. Press 'Deploy' to start deployment. Jul 28, 2014 2:41:40 PM org.apache.catalina.core.AprLifecycleListener init odonovanj@ubuntuj:/usr/local/tomcat/apache-tomcat-7.0.52$ sudo netstat -tulpn|grep 2928 tcp6 0 0 :::8080 :::* LISTEN 2928/java tcp6 0 0 127.0.0.1:8005 :::* LISTEN 2928/java tcp6 0 0 :::8009 :::* LISTEN 2928/java 

After deleting it in the logs, I see: INFO: starting the server in 76 ms. Connected to the server [2014-07-28 02: 44: 35,847] Artifact TomcatDebug: the war exploded: the artifact is deployed, wait ... [2014-07-28 02: 44: 36,512] TomcatDebug artifact: war exploded: artifact successfully deployed

 odonovanj@ubuntuj:/usr/local/tomcat/apache-tomcat-7.0.52$ sudo netstat -tulpn|grep 2346 tcp6 0 0 :::8080 :::* LISTEN 2346/java tcp6 0 0 :::50044 :::* LISTEN 2346/java tcp6 0 0 127.0.0.1:8005 :::* LISTEN 2346/java tcp6 0 0 :::8009 :::* LISTEN 2346/java tcp6 0 0 :::1099 :::* LISTEN 2346/java tcp6 0 0 :::52268 :::* LISTEN 2346/java 

setenv.sh seems to have overridden $JAVA_OPTS , interfering with JNDI running on port 1099.

+4
Jul 28 '14 at
source share

I am not very versed in the theory of this, but I have the same error. After waiting a bit, I received a message:

Error deploying artifact. See the server log for details.

I found a log file that I supposedly meant: “Tomcat localhost.log,” and there was a stack trace for “NoClassDefFoundError” and “ClassNotFoundException”. I did a Maven update and "Rebuild Project" and it did the trick.

+2
Apr 01 '14 at 3:55
source share
 file->project structure->Project SDK 

then reconfigure the SDK.

It really solved my problem.

+2
03 Sep '15 at 15:14
source share

(3.2) Set JRE_HOME or JAVA_HOME (required)

These variables are used to indicate the location of the Java Runtime Environment or the Java Development Kit that is used to run Tomcat.

The JRE_HOME variable is used to indicate the location of the JRE. The JAVA_HOME variable is used to indicate the location of the JDK.

Using JAVA_HOME provides access to some additional startup options that are not allowed when using JRE_HOME.

If JRE_HOME and JAVA_HOME are specified, JRE_HOME is used.

+1
Apr 04 '15 at 22:53
source share

I had this problem when I set JAVA_OPTS to catalina.bat. Removing this meant that tomcat started and deployed as expected. JAVA_OPTS values ​​can be set in the Intellij Run configuration.

0
Feb 20 '14 at 2:37
source share

I had this problem with Tomcat 7.0.27. I upgraded to Tomcat 8.0.21 and it fixed my problem :)

0
Sep 02 '15 at 11:33
source share

I encounter this problem when I try to import a project from eclipse into IDEA.

There is no setter.sh in $CATALINA_HOME/bin . The Project Structure and Run Configuration settings in IDEA look fine, the entire project works fine in eclipse, but shows this error in IDEA.

My solution: delete the .idea folder, re-import the whole project. I do not know what the exact cause of this problem is, but it works for me.

Now the log looks like this:

 /Library/Tomcat/bin/catalina.sh run [2015-09-22 12:40:57,906] Artifact bookstore:war exploded: Server is not connected. Deploy is not available. XXXXXX Connected to server [2015-09-22 12:40:58,848] Artifact bookstore:war exploded: Artifact is being deployed, please wait... XXXXXX [2015-09-22 12:41:07,862] Artifact bookstore:war exploded: Artifact is deployed successfully [2015-09-22 12:41:07,863] Artifact bookstore:war exploded: Deploy took 9,015 milliseconds 
0
Sep 22 '15 at 2:45
source share

A simple way is to change the port number in this file:

 -Dcom.sun.management.jmxremote.port=1099 

Pay attention to the port, by default 1099, but when using JMX it can be changed by you or by someone, so just change the port, it will be fine, there is no need to delete it from the bin folder of the tomcat file.

0
Apr 11 '16 at 7:41
source share

Another reason if your tomcat path contains a space or '(', this error will also occur. Please rename your tomcat path.

0
Jun 28 '17 at 2:09 on
source share

If you changed the /etc/hosts , you need to add the localhost YOU_USER_NAME line localhost YOU_USER_NAME to it.

0
Jul 15 '17 at 7:51
source share



All Articles