I am trying to build, deploy and debug my webapp inside intellij.
I have setup my tomcat using this answer and I was able to get the server running. The issue is th
In my case, this problem was due to a JAVA_OPTS variable defined in catalina.bat (or catalina.sh).
I only commented the first line of catalina.bat and everything started working. Here is the line :
set "JAVA_OPTS=-Xmx1024M -XX:MaxPermSize=512m -Djava.util.logging.config.file=logging.properties -Djava.net.preferIPv4Stack=true"
To comment, put rem
in front of it. rem
is the way to comment a line in windows .bat files.
I suppose that this line conflicts with IntelliJ JAVA_OPTS settings. In fact, IntelliJ tries to set a port on tomcat to use as a debugger, but the catalina.bat JAVA_OPTS variable deleted this setting.
(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.
Another possible reason could be that you manually run a standalone Wildfly apps server and copy your packages manually in its deployment
folder.
In this case Intellij tries to run Wildfly (even if you have stopped your manually run Wildfly) and to copy app's package for deployment. But there is already such a package in deployment folder
.
Remove myapp.ear
or myapp.war
from .../wildfly/standalone/deployments/
and Run or Debug from Intellij.
After setting my IntelliJ configuration to run the latest version of Tomcat that I was running in the background my problem was resolved.
I had the exact same error in my IntelliJ 14 while I had a setup and was working on another machine. While the source of the issue can differ, in my case here was the root cause:
I basically had two different versions of Tomcat Installed on my machine. Tomcat 8 was running in the background on port 8090 and despite of setting my debugger instance port to be 8091 it was giving me the following error:
Server is not connected. Deploy is not available.
and The following warnings:
1:21:18 PM It is possible to bind and connect to localhost:8091 at the same time - application server will probably compete with some other software on the port
1:32:39 PM Application Server was not connected before run configuration stop, reason: Unable to ping server at localhost:1099
After setting my IntelliJ configuration to run the latest version of Tomcat that I was running in the background my problem was resolved.
Hint: Running applications in debug mode can slow them down a fair bit. I usually have two instances running. One in debug mode and one in normal mode in two different ports. This way I can have a normal instance of my web application as well as a debugger instance for more in depth investigations.
Hope this helps.
I meet this problem when try to import a project from eclipse to IDEA.
My solution is, delete the .idea
folder, re-import the whole project. I don't know what's the accurate cause of this problem, but is works for me.
Now the log looks like that:
/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