Any plans to speed up webapp debugging?

In 3.x its quite painful compared to jbuilder. jbuilder will build into
a webapp directory that mirrors the war file and starts tomcat to point
to that directory. Then when you edit a file and recompile, tomcat
automagically reloads the file into the running webapp. Very fast.

With idea, you have stop tomcat, restart tomcat, relogin to the webapp,
then get back to where you were. This orders of magnitude more overhead
than jbuilder.

Am I missing something, or does everyone just put with this?

6 comments

With idea, you have stop tomcat, restart tomcat, relogin to the webapp,
then get back to where you were. This orders of magnitude more overhead
than jbuilder.


The feature of reloading modified classes is provided by Tomcat. So if Tomcat is configured to reload classes, it will (see
server.xml configuration).

--

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


0

Tomcat will only reload classes in the WEB-INF/classes directory. We
have the project checkbox set to include the project classpath [in the
webapp config dialog]. But the compiler output for the class files is
not WEB-INF/classes in our project. Is that the problem? Do we need to
change our compiler output path to be in webapps/WEB-INF/classes?


Eugene Zhuravlev wrote:
>>With idea, you have stop tomcat, restart tomcat, relogin to the webapp,
>>then get back to where you were. This orders of magnitude more overhead
>>than jbuilder.


The feature of reloading modified classes is provided by Tomcat. So if Tomcat is configured to reload classes, it will (see
server.xml configuration).

--

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


0

Tomcat will only reload classes in the WEB-INF/classes directory. We
have the project checkbox set to include the project classpath [in the
webapp config dialog]. But the compiler output for the class files is
not WEB-INF/classes in our project. Is that the problem? Do we need to
change our compiler output path to be in webapps/WEB-INF/classes?


Yes, I think this is the problem. Tomcat loads webapp's classes with its own classloader. When your classes are included in Tomcat's
classpath, they are loaded by the classloader, that loaded Tomcat itself and reloading functionality is not available. Class HotSwap
is planned for Aurora, but now you may configure compiler output path to point to WEB-INF/classes so that the classes will be loaded
by "proper" classloader.

--

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


0

Here's a tip, I found tomcat to be slow and difficult to deal with until I stripped it down to its basics.

First of all, forget about the webapp stuff, you don't need it (I don't think - I haven't had a need to do JSP debugging and I'm not sure how it's affected by this), just run tomcat as a regular java application.

- create a library with tomcat/bin/bootstrap.jar, plus all the libs in server/lib and common/lib, and include that in your project
- make a new application:
main class: org.apache.catalina.startup.Bootstrap
VM params: -Dcatalina.base=. -Dcatalina.home=.
Program parameters: start
- you need a conf directory, with a catalina.policy file and a server.xml file (there's a ton of crap you can strip out of server.xml)
- you need a WEB-INF directory with a web.xml file, with your classes compiled to WEB-INF/classes

This got my startup time down near zero, and more to the point, I have a good feel for what's going on under the hood in tomcat - what's necessary and what's unnecessary (as you can see, most of it is unnecessary for development).

-Steve

0

We are running a similar setup with resin.
Re-compiling JSP pages is no problem at all.

0

Agreed, Resin is the easiest of all, and the reloading support means you almost never have to bounce it (whereas Tomcat's reloading support is pretty limited - resin detects changes in your source files and automatically compiles, or reloads the app if it senses changes in your config files).

My resin java application:

Main class: com.caucho.server.http.HttpServer
VM Params: -Dresin.home=.

then I have a conf directory with resin.conf inside. I specify all my servlet mappings, etc, in there, and I don't even have a WEB-INF directory or web.xml. Awesome product.

0

Please sign in to leave a comment.