File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes tomat 4.1 or 5 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "tomat 4.1 or 5" Watch "tomat 4.1 or 5" New topic

tomat 4.1 or 5

doug parker
Ranch Hand

Joined: Oct 26, 2004
Posts: 30
I am able to make a choice btwn tomcat 4.1 and 5 for our project. I have worked with 4.1 for over a year and am familiar with it, no experience with 5. Are there any good reasons to switch over to 5? Are most of the changes 'under the hood' or do i have to re-learn configuration?

Is there any performance benchmarks of tomcat 4.1 vs 5 running the same app on the same hardware?
Jayesh Lalwani
Ranch Hand

Joined: Nov 05, 2004
Posts: 502
The biggest reason is tomcat 5 support JSP2.0, whereas tomcat 2.1 supports JSP1.2. So, if you are planning to use the enhanced support for Custom tag libraris and/or EL, you need to go with Tomcat 5
Dark Vachor

Joined: Oct 13, 2004
Posts: 14
Both Tomcat versions are buggy and slow to start, with wrong / misleading messages, are wrong stack traces on errors/exceptions. Both versions forces you to use their crappy and slow log4j package.
My choice would be the last version, as you'll probably have better support, and you'll likely have no configuration problems.
One thing handy in 5 is in the TOMCAT_HOME/conf/Catalina/localhost (why da f**** did they put an upper "C" ?) directory to receive contexts. But you do not have to use it.

Cheers !
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

I'd like to take this moment to address what was said:

Originally posted by Dark Vachor:
Both Tomcat versions are buggy...

Both versions (4.1.31 and the soon to be released 5.0.30) do pretty much 99.99% of what they're supposed to do, and they do it very well. What bugs would you be stumbling across?

...and slow to start,...
On my WinXPsp2 box with 1GB of memory and a 3GHz processor, Tomcat 5.0.28 starts up with 12 (simple) applications in about 3.5 seconds. Oh yes... that's a painfully slow startup. Get a bigger box, or start looking at your applications.

... with wrong / misleading messages,
Such as?

are wrong stack traces on errors/exceptions.
I've known the 'root cause' of an exception to be frustratinginly buried. Sometimes this is the fault of how the app is programmed (I know, I've done my share of obscuring). I've never known tomcat to throw the *wrong* exception.

Both versions forces you to use their crappy and slow log4j package.
Simply not true. Tomcat 4.x uses commons-logging, and Tomcat 5.x uses even more commons-logging. You needn't have log4j anywhere, it doesn't *force* you to use anything. log4j is pretty much *the* logging framework, it's not "theirs" (as in, not tomcat's) and it's hardly slow. commons-logging is another discussion.

Interestingly enough...
My choice would be the last version, as you'll probably have better support, and you'll likely have no configuration problems.
While it's true, most tomcat-dev type people prefer to answer questions about 5.x, rather than old 4.x stuff, both are very well understood and in wide use. And Tomcat 5.x did change a number of aspects of its configuration, so if there's one version that might actually give you configuration trouble, it would be the latest.
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13028
I am using both Tomcat 4.1.30 and 5.0.27 - I find them very stable and quick to start (if you don't load them down with load-on-startup servlets and give the the right amount of memory).
The stack traces I get during development make sense to me - of couse you do have to design your applications to throw useful exceptions.
My sites on 4.1.30 run for weeks with no problems, so I don't know where "Dark Vachor" gets his objections.
I agree. Here's the link:
subject: tomat 4.1 or 5
It's not a secret anymore!