WebApp debugging with Tomcat

I've been trying to get WebApp debugging working with 638. Seems the
configuration is very sensitive.

1. Looks like IDEA only reads server.xml, web.xml, etc, from
%IDEA_HOME%\config\tomcat. I have a custom server.xml for different version
of our applications which reside in different directories. (i.e.
\app\Ver1\conf\server.xml and \app\Ver2\conf\server.xml) I set my working
directory to the Ver1 or Ver2 directory, and when I start up Tomcat, it
automatically finds the appropriate server.xml. Each server.xml is
customized to point the context path="" to the correct docBase. With the
WebApp support in IDEA, I can only have one server.xml. Is it possible to
define a server.xml path and a working directory path for a webapp config?

2. It looks like the WEB-INF\web.xml files is being read in ok, but I'm not
sure yet.

3. Why won't it use the classpath as I have defined in my project with
required libraries and source/output paths? It seems like the only way I
would be able to get everything working is if I changed my output path to
WEB-INF\classes, moved all my jars into WEB-INF\lib, etc. I strongly prefer
not to do this, because it means a lot of re-configuration. I think that the
web-app config should just inherit the classpath from the project. It works
with Tomcat when I start it up as a normal Debug Application.

4. How can I set jvm properties? I have a few -Dparameters that I need
defined for my webapp to work, but there is no VM parameters box for
WebApps.

Ian.


3 comments
Comment actions Permalink

Hello Ian,

Thanks for your valuable feedback.

There are some changes in this area in #642 (will be available soon):
1. It is possible to setup a path to tomcat config files per
RunConfiguration. By default CATALINA_HOME/conf is used.
In general, IDEA wil now use only user-specified config files
(server.xml, web.xml etc)
2. It is possible to include project classpath to Tomcat's classpath
3. Added text field for specifying VM parameters
4. The WebApp you intend to debug can be associated with any of the Contexts
defined in the specified "server.xml" file. This association is done
directly in Run/Debug dialog.

Any comments and suggestions are welcome
--

Best regards,
Eugene Zhuravlev
JetBrains, Inc, http://www.intellij.com
"Develop with pleasure!"

"Ian Zabel" <izabel@cirqit.com> wrote in message
news:ahrpv2$vk9$1@is.intellij.net...

I've been trying to get WebApp debugging working with 638. Seems the
configuration is very sensitive.

>

1. Looks like IDEA only reads server.xml, web.xml, etc, from
%IDEA_HOME%\config\tomcat. I have a custom server.xml for different

version

of our applications which reside in different directories. (i.e.
\app\Ver1\conf\server.xml and \app\Ver2\conf\server.xml) I set my working
directory to the Ver1 or Ver2 directory, and when I start up Tomcat, it
automatically finds the appropriate server.xml. Each server.xml is
customized to point the context path="" to the correct docBase. With the
WebApp support in IDEA, I can only have one server.xml. Is it possible to
define a server.xml path and a working directory path for a webapp config?

>

2. It looks like the WEB-INF\web.xml files is being read in ok, but I'm

not

sure yet.

>

3. Why won't it use the classpath as I have defined in my project with
required libraries and source/output paths? It seems like the only way I
would be able to get everything working is if I changed my output path to
WEB-INF\classes, moved all my jars into WEB-INF\lib, etc. I strongly

prefer

not to do this, because it means a lot of re-configuration. I think that

the

web-app config should just inherit the classpath from the project. It

works

with Tomcat when I start it up as a normal Debug Application.

>

4. How can I set jvm properties? I have a few -Dparameters that I need
defined for my webapp to work, but there is no VM parameters box for
WebApps.

>

Ian.

>
>


0
Comment actions Permalink

Thanks! You've addressed all my issues.

I am having a new problem now, though. It's the Context path. I can't define the context path as blank. In my server.xml, my application's context is defined as path="". But, in the webapp configuration, if I leave the Application context path field empty, I get this error when starting: "Context path for the web application not configured. Update your Run Configuration" and then "Failed to obtain startup parameters from a web server integration".

How can I define my web app to run in tomcat's ROOT context?

0
Comment actions Permalink

Requesting a follow up...

Will it be possible to define the Context path as a blank? My webapp runs in the / context.

Thanks,
Ian.

0

Please sign in to leave a comment.