Problems with IntelliJ 12 and Tomcat 7

I can't get Tomcat 7 running inside IntelliJ 12.  I'm running on OSX mountain lion.

I've successfully installed Tomcat because I can get the default Tomcat start page by running
> user$ bin/catalina.sh run
in terminal and then opening a browser for localhost:8080

However when I run from inside IntelliJ I get nothing.
The output window appears to show that the server has started successfullly, but the browser just hangs on localhost:8080

Here's what the output window shows.

/usr/local/tomcat-7.0.34/bin/catalina.sh run
Jan 23, 2013 11:29:14 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: .:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
Jan 23, 2013 11:29:15 AM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jan 23, 2013 11:29:15 AM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Jan 23, 2013 11:29:15 AM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 363 ms
Jan 23, 2013 11:29:15 AM org.apache.catalina.core.StandardService startInternal INFO: Starting service Catalina
Jan 23, 2013 11:29:15 AM org.apache.catalina.core.StandardEngine startInternal INFO: Starting Servlet Engine: Apache Tomcat/7.0.34
Jan 23, 2013 11:29:15 AM org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["http-bio-8080"]
Jan 23, 2013 11:29:15 AM org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jan 23, 2013 11:29:15 AM org.apache.catalina.startup.Catalina start INFO: Server startup in 24 ms Connected to server
Jan 23, 2013 11:29:25 AM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory /usr/local/tomcat-7.0.34/webapps/manager
9 comments
Comment actions Permalink

Any luck with finding a resolution ? I have the same problem - Tomcat gets stuck at the deploying step within IntelliJ but starts fine from the command line.

0
Comment actions Permalink

Check your welcome-file tag.When you run tomcat 7 using IntelliJ Idea you can't see Tomcat's web page but you can access the tomcat manager and your application.

0
Comment actions Permalink

Hi Scott,

I'm running IDEA 12 and Mountain Lion with no problems - even with remote debugging Tomcat.

Have you looked at all your Tomcat log files to make sure the application you're loading isn't throwing exceptions?

If you're not loading an application, but just trying to set up Tomcat, then maybe post back the exact set of steps, in IDEA, you're doing so others can better understand and advise.

---

If I create a web project with Tomcat 7 called "deleteme" (for testing) and then hit the ">" button, I get a blank http://localhost:8080/ screen (which is expected since I have no content).

However, the app deployed fine as shown from the output window:

Mar 10, 2013 9:00:53 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /Users/mork/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
Mar 10, 2013 9:00:53 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Mar 10, 2013 9:00:53 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Mar 10, 2013 9:00:53 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 578 ms
Mar 10, 2013 9:00:53 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Mar 10, 2013 9:00:53 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.34
Mar 10, 2013 9:00:53 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Mar 10, 2013 9:00:53 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Mar 10, 2013 9:00:53 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 37 ms
Connected to server
[2013-03-10 09:00:53,640] Artifact deleteme:war exploded: Artifact is being deployed, please wait...
[2013-03-10 09:00:54,251] Artifact deleteme:war exploded: Artifact is deployed successfully
Mar 10, 2013 9:01:03 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /Users/mork/Library/apache-tomcat-7.0.34/webapps/manager

0
Comment actions Permalink

Shankar,

I am not sure how is it relevant to your case, but I can't see "Artifact is being deployed, please wait..." message in the original log from topic starter.
If you have the same symptom, please ensure that you have specified some artifacts for deployment at "Deployment" tab of run config.
(Note that IDEA displays warning in this case in the runconfig window, respecting this and other warnings is generally a good idea :)).

Also, when Tomcat is started from IDEA, the default Tomcat start page is not expected to be shown.
Instead application context URL (again, specified in deployment tab) should be opened when IDEA will recognize artifact as successfully deployed.

Hope that helps,
Regards,
Michael

0
Comment actions Permalink

I am seeing exact same behavior on Windows with Tomcat 6.0.35. This worked fine before upgrade to 12.

C:\Apache\apache-tomcat-6.0.35\bin\catalina.bat run
[2013-05-03 11:25:38,203] Artifact myWar:war exploded: Server is not connected. Deploy is not available.

Using CATALINA_HOME:   "C:\Apache\apache-tomcat-6.0.35"
Using CATALINA_TMPDIR: "C:\Apache\apache-tomcat-6.0.35\temp"
Using JRE_HOME:        "C:\Program Files\Java\jdk1.6.0_25"
Using CLASSPATH:       "C:\Apache\apache-tomcat-6.0.35\bin\bootstrap.jar"
May 3, 2013 11:25:39 AM org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.22.
May 3, 2013 11:25:39 AM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [false], sendfile [true], accept filters [false], random [true].
May 3, 2013 11:25:40 AM org.apache.coyote.http11.Http11AprProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
May 3, 2013 11:25:40 AM org.apache.coyote.ajp.AjpAprProtocol init
INFO: Initializing Coyote AJP/1.3 on ajp-8009
May 3, 2013 11:25:40 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1788 ms
May 3, 2013 11:25:41 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
May 3, 2013 11:25:41 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.35
May 3, 2013 11:25:41 AM org.apache.coyote.http11.Http11AprProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
May 3, 2013 11:25:41 AM org.apache.coyote.ajp.AjpAprProtocol start
INFO: Starting Coyote AJP/1.3 on ajp-8009
May 3, 2013 11:25:41 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 844 ms
May 3, 2013 11:25:51 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory manager

0
Comment actions Permalink

Installed new Tomcat 7 and things work fine again.

0
Comment actions Permalink

Dmirty,

If IDEA is unable to connect to the Tomcat (there's no 'Connected to server' message in console),
then a popup with the error message (duplicated in the Event log tool window) should appear after Stop button press.

If you still have a problem with Tomcat 6.0.x, please post the error messsage here or in the new youtrack.
Also, please attach the produced idea.log (Help -> Show log in ...)

Regards,
Michael

0
Comment actions Permalink

I also had this. Cost me a day to figure it out.
You have probably changed the catalina.sh like I did.

I added this:

JAVA_OPTS="-Djava.awt.headless=true -Dfile.encoding=UTF-8
-server -Xms1536m -Xmx1536m
-XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m
-XX:MaxPermSize=256m -XX:+DisableExplicitGC"



when I run tomcat 7 command line there is no problem, but when I'm running it in Intellij...
0
Comment actions Permalink

Derk,

I recently answered the questions about passing the options to tomcat in YouTrack's, guess it may be worth duplicating it in forum to make it better discoverable.
So: (copied from http://youtrack.jetbrains.com/issue/IDEA-100977#comment=27-450069):

Currently, in the released versions of IDEA, Tomcat integration passes VM options to the server instance with the JAVA_OPTS environment variable.
So, in your setenv.sh you should append a text to JAVA_OPTS instead of overwriting it.

For instance, if you have in your setenv.sh a definition like:
JAVA_OPTS="-Dname=value"
it will break the IDEA integration until you change it with :
JAVA_OPTS="$JAVA_OPTS -Dname=value"

However, this behavior is about to be changed next EAP, because we are going to change the environment variable used by IDEA Tomcat integration from JAVA_OPTS to CATALINA_OPTS.

If we push this change, since next EAP you will be able to freely override JAVA_OPTS but will need to append to CATALINA_OPTS (if you want to affect it in your setenv.sh). I would recommend to blindly append to both variables for now, I don;t see how it may hurt you anyway

The comment at http://youtrack.jetbrains.com/issue/IDEA-100977#comment=27-450449 may also be of help if you want to pass different set of the options when running the same Tomcat instance from within IDEA and separately.

Regards,
Michael

0

Please sign in to leave a comment.