Tomcat help

ockky

Senior member
Jul 29, 2004
735
0
71
anyone know of a tutorial site or two that explains how to load classes whilst Tomcat is already running?

other than not being able to load classes dynamically, Tomcat is doing just fine, i'd just really like to figure this out so that i can quit wasting time shutting the server down, and then booting it back up.

thanks for any leads
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
You're talking about being able to test new code? The manager webapp lets you redeploy a webapp (http://tomcat.apache.org/tomcat-5.5-doc/manager-howto.html ). It's dead simple once you figure out how to login (I can fill you in on that too). Not quite as fast as reloading single classes, but it's much better than doing the whole server.

There are also ant tasks for doing this automatically. I usually have that built into the "deploy" target in my build scripts so that any time I compile, everything gets automatically updated on the running server.

Another alternative is using netbeans (or I think eclipse can do it this these days too) to integrate with tomcat so you don't even have to do a rebuild cycle to redeploy. Then you might be somewhat limited in what version of tomcat you can use, but hopefully if it's just for development purposes, it won't matter too much.
 

ockky

Senior member
Jul 29, 2004
735
0
71
well, i found my problem, i'm using hibernate and apparently it's causing ruckus so /shrug, guess i'm s.o.l
 

Argo

Lifer
Apr 8, 2000
10,045
0
0
What IDE are you using? Most IDEs that integrate with tomcat (IntelliJ Idea for example) have a hot deploy feature, which juts bounces the tomcat's classloader, causing it effectively to reload all the classes.

As far as hibernate goes, it shouldn't affect anything, don't think hibernate really has anything that would prevent tomcat classloader from restarting. In the past, I've had this problem with JNI libraries.
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
There's no reason why hibernate should cause problems as far as I can see. I've used it with my build script redeploy and no problems. What are you using for your db connection pooling?