Apache's Jakarta-Tomcat Server Explained 91
Ellen writes "Apache's Jakarta-Tomcat server is an open source, Java-based Web application container that was created to run Servlet and JavaServer Page (JSP) web applications. In O'Reilly Network's "Using Tomcat" series, author James Goodwill previously has explained how to install and configure Tomcat. His latest article provides in-depth information about how to deploy it.
Read "Deploying Web Appliactions to Tomcat"
goatse.cx link... (Score:1)
Re:goatse.cx link... (Score:1)
Is aquiring more java skills wise? (Score:1)
tomcat is hmmm buggy (Score:1)
Relevant links (Score:3)
Bad Start (Score:1)
The article begins "One way to learn to deployment Tomcat web applications is to explain fully the steps required to deploy a Tomcat web application manually."
What kind of English is that? I don't usually nitpick over grammar, but when there is stuff like that going on in the first paragraph I have to wonder if the rest is worth reading.
Need XML expertise? crism consulting [maden.org]
Use JRun (Score:1)
Re:Bad Start (Score:1)
Re:Since Hemos wont post it (Score:1)
Re:Since Hemos wont post it (Score:1)
i prefer Resin... (Score:4)
Re:Benchmarks, Please. (Score:1)
ouch.. (Score:2)
is this gonna hurt?
I'm bored (Score:1)
Re:Is aquiring more java skills wise? (Score:1)
ohmygosh! an epiphany! (Score:2)
"In order to live free and happily, you must sacrifice boredom. It is not always an easy sacrifice."
I'm serious - this is a sign. I need to ween myself from slashdot.
--
Tomcat vs. Apache Jserv (Score:2)
This year, I was looking to develop another servlet app. I saw that Jserv is no longer under development, and has been "replaced" by Tomcat. Holy crap! what a reversal of fortune. It wouldn't install, the configuration is so complex that a degree in advanced illogic is necessary, it's unstable, and it doesn't have the feature set that a two-year-old version of Jserv had. In short, it's completely unusable. But, because Jserv isn't in the development path any more, that wasn't a good long-term option either. We ended up abandoning Java entirely as an option, since we didn't have time to evaluate other engines.
I'm kind of hoping that Tomcat dies a fiery death. Maybe then someone will go back and resurrect Jserv.
I've had a pretty good experience with it (Score:1)
JServ served its purpose. Tomcat is the next step (Score:3)
Abandoning Tomcat isn't the answer, and to be frank, it just isn't going to happen. Yes, the 3.x codebase of Tomcat had no shortage of issues, which is just one reason 4.x is a rather substantial fork from it. It's unfortunate there has been a lapse between JServ and a stable Tomcat, but it's only a matter of time (Brief, we hope) before 4.x leaves the beta stage and provides a stable Apache module interface.
Re:Bad Start (Score:1)
JSP & Servlets are only part of the problem (Score:5)
How you embed a couple of variables into the HTML is a complete non-issue. PHP, Perl, JSP, servlets, ASP, they are all fast ENOUGH and in all of those, it's easy enough for anyone to do. It's completely irrelevant anyway if the response time is 0.1 or 0.3 seconds, even if that's a 3x difference. Even if one technology would mean you have to get 3 servers instead of just one, hardware is so much cheaper than developer time that it's still worth it. There are *major* sites running all of those technologies I mentioned above, which is proof enough that they all scale and the fact that there are supporters for each also proves that for different people, different technologies are differently suitable.
The real "problem" is how to separate logic well into "something else" and have that "something else" communicate to the front end layer (the ASP, JSP, PHP, Perl etc.) the results so that you don't end up with a back filled with HTML where you should only have logic. Also, how does that back end scale *conceptually* as the application grows more complex? Is it a pile of spaghetti code or does the technology / language promote good design? How does it integrate with existing systems and databases?
100 line "benchmarks" don't answer those questions and the myriad of clueless Slashdot posts from people who have never actually done anything more than a "hello world" will also not answer the questions.
Now here comes the controvercial part; in my experience, Java is miles ahead of the rest (ASP + COM is about on par if you are working on something that just has to run on an NT server) when it comes to real world application development. The main reason is that the front end and back end communication is so great. JSP is clearly a better model than servlets as the front end should be as purely HTML as possible. The fact that JSP allows you to make up your own tags and map them to Java code also makes it really easy to do more complex stuff - all tag based (this is why Cold Fusion is so popular among non-techies).
Still, JSP compiles into Java servlets, which is a great model from a programmer point of view (one instance, one thread per request etc.) so you get the best of both worlds - clean HTML and a great programming model. Also, since a Java servlet is a normal Java class, your can build an application out of it really easily and use all the stuff you would normally use - EJB, Corba, RMI, JDBC, etc.
The object oriented (sorry, object based) nature of Java also promotes good application design so that you don't end up with a huge "MyPortal.cgi" Perl script with 50000 lines of code and HTML, all mixed up into one big mess.
That Java is "running" and that only new threads are created for the requests also gives you the benefit that you can do things like caching in-memory between requests etc. really easily. This again makes it possible to employ all kinds of techniques for speeding up sites, bypassing database queries for often-requested stuff etc.
This is just my point of view though. I'm sure others consider Perl a better alternative and have a lot of reasons to back it up. I'm sure they can list a lot of technologies that I didn't know of (Perl related I mean) that lets them do basically the same things that I just described above. This doesn't bother me at all - quit the opposite. What bothers me is that Slashdot (and IBM) posts idiot stories about "comparisons" that don't mean anything since the real problem is not in the front end.
That's all.. My rant is over..
Re:Tomcat vs. Apache Jserv (Score:4)
Actually, JServ is being resurrected (sort of), as Tomcat 4.0.
The Tomcat project hit a serious stumbling block when Sun contributed the code for Java Web Server, which became Tomcat 3.x. Development pretty much stopped, waiting for them to turn over the code, which turned out to be of very disappointing quality. Early 3.x releases of Tomcat were very shaky, and has given the project a bad rep. A lot of work has gone into improving the 3.x line, which is getting pretty damned solid with recent releases (3.2.x).
The original plans of the JServ team for its next release, Catalina, have been resurrected and are in beta as Tomcat 4.0.
It's a shame that the earlier releases have given the project a bad rep. It's a useful case study for open source projects, and also a good demonstration that commercial code is not always better than open source code. Since they don't let you see what goes on inside the kitchen, you assume it's a professionally run operation with great sanitation and QA, but
Resin: Loved it so much I bought the license (Score:2)
(Disclaimer: Not a paid endorsement.)
-jhp
Why this article is just... wrong. (Score:3)
<p>Don't use Tomcat in anything but a development environment, or to test things against the standard implementation. There are many free and non-free alternatives available.
<p>The whole point of the J2EE standards is that the techniques that you can use to deploy an application on Tomcat should work on <i>any</i> J2EE compliant servlet container. The webapp filesystem layout Tomcat uses, which is explained in this article, is really just a Sun standard available on most modern java application servers.
<p>Charles Miller
--
Wow, I seem to do this every five or six posts. (Score:1)
Smeg.
Don't ever post when you've just woken up.
--
Re:i prefer Resin... (Score:1)
Tomcat, while not the worst of the lot, is pretty bad. In Tomcat 3.1, which was the stable version for months and months, the ability to use RequestDispatcher.include() to include other content was utterly broken, with no fix in sight. That didn't give me a very favorable impression, even more so after reporting the bug on the devlist and getting no replies or even confirmation that they knew about the problem.
After testing against Resin for a year, my opinion is that it's absolutely the best basic servlet container out there, and it even offers quite a bit more. Other products offer other features, such as clustering & HA, but the technology behind them isn't nearly as clean or as elegant as that in Resin. Nor are they anywhere close in speed--the author of Resin worked for Sun performance tuning web software for Solaris.
In the end, forget Tomcat, it's another victim of open source; buy Resin--it's cheap, superior, and deserves to come out on top.
Resin (Score:1)
Re:Is aquiring more java skills wise? (Score:3)
A good Java programmer (or any good programmer) will have little difficulty moving to another language.
So in short, if you are still wondering whether Java is worth the trouble for you, I strongly suggest you either start learning Java or pick up one of the many alternatives (C++, smalltalk, whatever).
Re:JSP & Servlets are only part of the problem (Score:2)
It's object based, based on python (also OO) and also supports multiple inheritance, which is very handy for factoring you application into small components (classes), which "lend" their specific capabilites to your application's objects via mixin classes. This is very nice to seperate "orthogonal" capabilites into different locations (classes).
You get all the facilites of java you mentioned above with zope.
A good overview about the theoretical aspects of zope (and more) can be found at http://www.dieter.handshake.de/pyprojects/zope/bo
Re:JSP & Servlets are only part of the problem (Score:2)
Re:Tomcat vs. Apache Jserv (Score:1)
Mmmmmm Sevlets and JSP.... Mmmmm tasty.... Get those servlets doing some data retrieval and those JSP's doing some XML parsing and you got yourself the most amazing platform ever... Mmmmmm...
Now if only it had an EJB container...
Re:Tomcat vs. Apache Jserv = Orionserver (Score:1)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~ the real world is much simpler ~~
Re:tomcat is hmmm buggy (Score:2)
Thats funny. I'm using 3.2.1 and it works great here. None of the problems you describe have surfaced. It provides servlets/jsp/cocoon pages for a medium sized university (where I work).
In the least it is much faster than our perl cgi scripts.
Re:Information on creating a java bot required (Score:1)
Not a direct link I'm afraid, but check out the "realated sites" on JESS [sandia.gov] which is an experts system shell. There were some agent pages there.
Also for basic stuff you might want to check some pages about general agent programming from an AI standpoint.
Why is it so complicated and slow (and unstable) (Score:1)
Recently a friend suggested I install a free download of OrionServer (www.orionserver.com [orionserver.com]) because it was easy and is also an EJB container and all that stuff. I was skeptical, but damn --- it installed and configured in 3 steps: 1=Download, 2=Unzip, 3=Run orion.java. (Their tutorial is 1 paragraph.) Why isn't Tomcat clean enough to install & configure like that?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~ the real world is much simpler ~~
Re:Is aquiring more java skills wise? (Score:1)
It sounds like you want your employer to pay for your Java training (in the guise of re-writing something that works).
We used to call this a "resume enhancing task."
Re:Use JRun (Score:1)
Re:Is aquiring more java skills wise? (Score:1)
Re:Tomcat vs. Apache Jserv (Score:1)
Re:Tomcat vs. Apache Jserv (Score:1)
it's quite stable, extremely well engineered, and may just be my favorite container... (still a few things that i'm not entirely sold on, but the rationale is starting to sink in)
cheers.
Peter
Tomcat is not full-fledged product! (Score:1)
When it comes to deployment on a "serious" scale, use a commercial J2EE-compliant AppServer, such as Sybase' EAS, WebLogic, WebSphere, iPlanet, etc.
If you have to use Tomcat in production, you can improve it yourself or pay someone to do it for you - it's Open Source!
3 links (Score:1)
How python can be used with your existing JVM [google.com]
Java and Python Side by side [twistedmatrix.com]
The story of a java program turned into a python program [twistedmatrix.com]
Your millage may vary
Tomcat (Score:4)
Re:Is aquiring more java skills wise? (Score:1)
Actually, it does say something about Java itself, as opposed to the overall market downturn. Java turned out to be a failure on the client and most places that had been designing those awful and slow Java user interfaces are now getting decent work done using Macromedia tools.
Cheers,
Surprised (Score:4)
What you're seeing here is what happens when people who are spending their company's money and meeting their company's deadlines need a solution. The best thing about tomcat is it's free software. That matters very much if you're trying to create something wonderful. It matters less if you're building something that your boss told you to.
d
"Why aren't they out arresting dope dealers?" --Carmella Soprano, on being pulled over for a speeding ticket.
Tomcat: not all that bad (Score:3)
I didn't find Tomcat all that difficult to set up, once I threw the instructions away. When I first attempted to install Tomcat, I spent hours picking through instructions on what to change in httpd.conf (to get servlet requests on port 80 directed by Apache to Tomcat), what to change in Tomcat's server.xml, and any other number of configuration files. If anything, I found the instructions to be misleading - on just looking at the config files and using some common sense, I didn't find it all that difficult to set up. Especially considering that a quick Google search on whatever startup error you get almost always turns up some kind of e-mail list correspondance with someone also having had the problem, and someone else presenting a solution.
In addition to this, you can just run the Tomcat startup script ([install_dir]/bin/tomcat.sh), and Tomcat will begin listening for requests on port 8080 out of the box, which I found was easiest if quick and easy setup was the goal. It's only really in redirecting port 80 stuff to Tomcat that things get tricky.
On the performance / stability issue, I've not found Tomcat to be inferior to any other servlet environment, in almost every respect. It is true that sometimes it would have to be restarted when only simple modifications had been made to a web app to get the modifications to deploy, and these cases never seemed to be consistent with any particular environmental state, but I didn't find that this occured with enough frequency to be considered a great problem (not that the problem shouldn't be fixed in any case).
But yeah - I've not had the chance to see it being used yet in a non-development environment, but my experiences with Tomcat would not dissuade me from recommending it to someone looking for a reasonable free servlet environment.
Re:Why is it so complicated and slow (and unstable (Score:1)
It is small and very easy to install and configure. It can easily be embedded in a larger Java application, allowing a Web interface to be added "after the fact."
Re:Tomcat vs. Apache Jserv = Resin (Score:1)
Re:tomcat is hmmm buggy (Score:1)
It's documented, but hey it's much easier to complain about a bug than to read the docs, right...
Re:Tomcat vs. Apache Jserv (Score:1)
Rather than asking somebody else to ressurect Jserv, why don't you do it yourself?
This is not intended as a flame or criticism, but merely an observation of how opensource/free software developement is supposed to work.
Not quite (Score:2)
One Word: Resin (Score:1)
Re:Why is it so complicated and slow (and unstable (Score:1)
Resin: agreed & here's the link. . . (Score:3)
I'm a JavaNewbie, but I installed Resin in very little time and have it up and running on a beige Mac G3 LinuxPPC box. Now I'm looking into installing and configuring servlets (like those found at CoolServlets [coolservlets.com]). I'm one of the people who hated Java because it was slow, but don't blame the language for the client-side problems. This URL says it all better than I could: http://www.davidreilly.com/java/java_network_progr amming/#6. [davidreilly.com]
If you are a newbie like me and interested in learning more about Java/Servlets/etc. you'll find lots of links at my blog: Brainspatter [blogspot.com].
Curious__George
Re:Benchmarks, Please (here you go) (Score:1)
I'm also interested in investigating Enhydra [enhydra.org].
For more info on Java servlet tutorials, ect. check out my blog: Brainspatter [blogspot.com]
Curious__George
Run JSP/Servlets on Mac OS X with Resin: (Score:2)
Resin [caucho.com] beats the pants off Tomcat according to third party benchmarks [orionserver.com].
Curious__George
Re:Benchmarks, Please. (Score:2)
Re:Surprised (Score:2)
I'm using Tomcat as a servlet engine for a virtual community that's making a comeback after its previous home was shut down, and, in three months of heavy development and testing of some pretty complex server code, I have found exactly one bug in Tomcat itself...and that only when I finally got integration with Apache via mod_jk working. (Which, incidentally, wasn't too difficult, once I actually sat down and decided to do it.) And upgrading from Tomcat 3.2.1 to 3.2.2b3 fixed that, once I'd found the bug reference in Apache's Bugzilla database for Tomcat (dated two months ago).
For the moment, the performance has been adequate for our needs; having Apache as a front end for static images and such helps. I'll be interested to see what happens with that when the 3.3 and 4.0 Tomcat versions come out. If it becomes a real problem, we can always look at Jetty later, but, for now, I see no reason to change.
One of my big goals for the community's new server was that it be "open source right down to the metal," and Tomcat is a big part of that.
Eric
--
Re:Tomcat vs. Apache Jserv (Score:2)
I'm pretty pleased with Allaire [allaire.com]'s JRun [allaire.com]; I use it to serve an application that gets a half-million hits a day without problems. It's pretty zippy; on a single-processor PIII 800 MHz box we could serve two or three times the traffic we handle now. And they offer a free developer version, so it's well worth trying out if Tomcat doesn't meet your needs.
Re:i prefer Resin...--c'mon, now (Score:1)
Don't question the /. orthodoxy without a little elaboration, boss.
Re:Bad Start (Score:1)
Grammatical errors in your reply:
Hypocrite, take first the beam out of thine own eye, and then thou shalt see clearly to take out the mote that [is] in thy brother's eye.
Humph.
~
Oh, perl does have its advantages (Score:1)
I otherwise agree 100% that some Slashdot readers are generally ignorant that B**w*lf is not the be-all and end-all of scalability, and that wooden frames, while suitable for houses, are unseen in very tall buildings.
-jhp
Re:JSP & Servlets are only part of the problem (Score:1)
While I fit into the category ...the myriad of clueless Slashdot posts from people who have never actually done anything more than a "hello world"..., the opinion I'm forming based on all of the "Mine Is More Gooder" posts is that, as with playing music, the quality of the final product has more to do with the musician than the instrument in question.
Guess when I move to the web front-end of my project I'll rummage around the Linux distribution and see which of these groovy tools irritates the least. Or gaff them all off and do my own high speed, low drag unit in C++.
Re:Tomcat vs. Apache Jserv -- mod_jk (Score:1)
apache jserv is now more or less handled by the mod_jk [apache.org]. the beauty of it all is that you can still have apache to do the usual stuff, and then use tomcat to handle JSP files. mod_jk looks at the request coming into the webserver, and if it qualifies (e.g. index.jsp), it will redirect the request to the tomcat running, independent of the apache server. AFAIK, that's what apache-jserv does. it's not great, but it makes everyone happy..
and no, it's quite alive and well.. and rewritten from scratch.
Re:JSP & Servlets are only part of the problem (Score:2)
1) Java - Perl
2) Servlets - mod_perl
3) JSP - Mason
I will not comment on (1) and (2), but Mason has some advantages over JSP. Just couple of features:
- Mason components are real components, you can invoke them, passing the arguments, unlike awkward JSP include mechanism
- Mason components have the init section, where you can put all the initialization stuff, and the args section, where you define all the arguments expected by the component and their default values
- Page caching mechanism is superior to JSP
I agree about the separation of business logic and presentation logic - it's very important, indeed. However, you are not getting it for free with Java/JSP. In either case, be it Java or Perl, it's responsibility of programmers and not the feature of framework (EJBs provide such a feature, but that's another issue).
Re:JSP & Servlets are only part of the problem (Score:1)
BTW, the getInitParameter() is a very good example that shows the difference. Do you need to call getInitParameter (or whatever) from within your C or Java functions to get the arguments?
JSP is a spec not a product, true. So what? Control over the cache parameters is not the part of that JSP spec. I can control the behaviour of cache using Mason function calls - for example, set cache expiration by time, by condition, by explicit action. In case of JSP, it's all controlled by the app server, and from my experience - current JSP sever implementations (I'm using Tomcat and IBM WebSphere at work) are less flexible than mod_perl/Mason combination.
Re:JSP & Servlets are only part of the problem (Score:2)
It can be extended and scripted in many ways, INCLUDING servlets and JSP's. It has its own XML interpreter, can embed Perl, Pike (it's written in Pike, there have been articles on Pike here on
PLUS it has bandwidth management capabilites (very fine-tuneable and extendable), can do on-the-fly graphics generation and blah blah blah.
There's a (commercial) package for it that does extensive template-ization and presentation/application separation and kicks ass as a web content management solution.
Just try it, it's only a download/compile away.
Resin Kicks JRun's Butt! (Score:2)
Re:JSP & Servlets are only part of the problem (Score:1)
Mason sees each page as a set of components. For example, header component, then a table, where each row is a table_row component, then footer component. Lets' say, to render each table_row, we need x, y, z arguments. So, in the appropriate point of the table template you put table_row(x,y,z). One should not wrap this thingy as a Java bean (or Perl module), beacuse it belongs to presentation layer, and it has some serious disadvantages to put any style- or presentation-related information in the Java (or Perl) code. Of course, this component approach is not specific to perl/Mason. We (or any other big site) are doing the same thing with JSP includes too, it's just not as clean and less convenient when working with a team of frontend/backend developers.
Your remark about the number of independent vendors developing for Mason is correct and points to big Java/JSP advantage, indeed. Because of all the hype about Java, it's gained the critical mass and now we have all kinds of great App Servers, development tools, third-party components etc. A lot of good books, too. Also, it's much easier to find Java/servlet/JSP programmers than Perl/mod_perl/Mason programmers.
BTW, all these factors are the reason we're currently porting a huge site from Perl/Mason to Java/EJB/JSP. I have somewhat mixed feelings about that. For small sites, I think mod_perl/Mason is a very good solution. But for big sites, Java/JSP is probably the way to go, mostly because of ease of language / teamwork organization / good development tools.
Resin? Bah! (Score:1)
Victor
Re:Benchmarks, Please (here you go) (Score:1)
Re:Tomcat vs. Apache Jserv (Score:1)
Re:Incorrect: Trolling Not Pro-Microsoft Enough (Score:1)
Re:Benchmarks, Please (here you go) (Score:1)
Re:Benchmarks, Please. (Score:1)
Re:Bad Start (Score:2)
Need XML expertise? crism consulting [maden.org]
Re:Is aquiring more java skills wise? (Score:1)
So keep using JServ (Score:1)
apt-get install jserv
still works for me.
Re:Is aquiring more java skills wise? (Score:1)
Can't argue with you. Even though the demand for Java is going down, mainly because of the client-side realities, being proficient in Java is a good thing to see on a résumé for reasons beyond simply knowing the specific language.
Cheers,
Problem #1: Java Code Too Tempting (Score:1)
In The Problems with JSP [servlets.com], Jason Hunter, author of the O'Reilly servlets book, paints a different picture from yours about how well JSP serves to make the front end "as purely HTML as possible." Apparently it's quite common for JSP programmers to break the clean separation you describe.
Such non-separation is totally understandable. There are times in a product development cycle when you want to do quick prototyping, and it's convenient to put code right there in the JSP. Problem is, once it gets in it's hard to get out. You have to come up with a class hierarchy and wrap an object and method around the code that you cut out of the JSP. This is doable, but not convenient.
Generally projects have to choose up front whether to go with a rapid prototyping tool like PHP or a strictly structured environment like WebMacro. Or they can go with JSP and have some release management structure in which coding standards are enforced.
Alternatively, they could use BRL [sourceforge.net] for rapid prototyping. If the project grows to require more code separation, it's easy to wrap a procedure definition around code cut from a page, then put that definition in sitedefs.scm. You can make use of all kinds of Java objects as well, though you're encouraged to keep Java-specific code out of individual pages. BRL is not intended to be Java-specific, although the current implementation is.
Re:Tomcat vs. Apache Jserv (Score:1)
Once more time I find that java developers don't give a damn about the sistem they are running on, it a nightmare for administrators, but is the easy way for them.
I really HATE java.
Re:Is aquiring more java skills wise? (Score:1)
Re:Bad Start (Score:1)
~
Re:Is aquiring more java skills wise? (Score:1)
Perl, Tcl, Python, Lisp/Scheme, Korn shell (only 1/2 kidding),
Re:Bad Start (Score:2)
Need XML expertise? crism consulting [maden.org]
Re:tomcat is hmmm buggy (Score:1)
Molasses (Score:1)
MySQL is less than Oracle (Score:1)
-Calin
That's odd, (Score:1)
Re:Resin? Bah! (Score:1)
Re:Resin? Bah! (Score:1)
I don't want to learn a new language to do XSLT transformations, I want to use what works everywhere. I design, write and deploy my own classes. I write my own JSPs, I don't need web designers (in my vanity site anyway), and the good ones love JSP it they are well done (have you heard about taglibs?), in my experience. YMMV, of course
Nowadays most major servlet engines come with their own implementation of JAXP or what-have-you, and no one (but resin's) prevent xalan from working. You may have to explicitly tell what parser you want to use, which shouldn't be a problem anyway since it's not an uncommon thing to do. Try to do a search on google on xalan+resin and then tell me I should be grateful
Victor