Vivek Chopra

Author
+ Follow
since Sep 18, 2000
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Vivek Chopra

Rafael,

PermGen space errors sometimes occur if you run multiple Web applications in single Tomcat instance, or if your application loads up a lot of classes. The JVM allocates a 64MB memory chunk for the permanent generation heap, which is the heap that holds objects such as classes and methods. When this space gets exceeded, you start getting the PermGen space errors. You would need to increase this setting: Use the -XX:MaxPermSize option in Sun�s JDK to increase the permanent generation heap space. The place to set this would be to edit your catalina.sh/.bat file and add it to the JAVA_OPTS environment variable.

PermGen errors can also occur if a web application is repeatedly 'hot deployed' in an running Tomcat instance. There as a Tomcat 5.5 bug on this (see http://issues.apache.org/bugzilla/show_bug.cgi?id=40679 ), which is supposedly fixed.

- Vivek

[ October 03, 2007: Message edited by: Vivek Chopra ]
[ October 03, 2007: Message edited by: Vivek Chopra ]
17 years ago
Scott,

The book has two chapters on Performance, one that covers Performance testing, including setting up a test plan and running tests using the Jakarta JMeter framework. The second performance chapter deals with how to go about tuning your web application, including where to look for performance bottlenecks and general best practices.

A detailed table of contents for the book is at
http://media.wiley.com/product_data/excerpt/10/04717536/0471753610-1.pdf - this should give you an idea about what is covered.

Thanks,

- Vivek
[ October 03, 2007: Message edited by: Vivek Chopra ]
17 years ago
Subodh,

One typical use case for virtual hosting is when you use hosting services run by ISPs.

Many small businesses do not need, or cannot afford, the cost of running a Web site hosted on a dedicated server or a cluster of servers, and hiring IT engineers to maintain them. Therefore they go for 'shared' hosting plans at ISPs, and these ISPs run multiple Web sites on a single server machine- or even on the same web server instance. Running of more than one Web site on one server is called virtual hosting. As you would have seen from the Wikipedia link, these can be implemented in two ways- IP or name based; each with its own advantages and disadvantages.

Thanks,

- Vivek
17 years ago
Vedhas,

Tomcat 6 supports the latest Servlet/JSP specifications i.e. Servlet 2.5, JSP 2.1. Other than that there are a number of changes, such as performance and memory optimizations, faster and more scalable Connectors (such as the 'native' APR Connector and the NIO Connector) and an improved clustering implementation.

More on what's changed in Tomcat 6 is at http://tomcat.apache.org/whichversion.html and in the individual README files with each Tomcat distribution.

Regarding how this book compares to 'Core Servlets', this book doesn�t cover web application development using Tomcat- there are a lot of other good books that fulfill this need. We believe in doing one thing well, and we focus on the administration aspects of Tomcat - Tomcat configuration, performance tuning, system security, and deployment architecture.

Thanks,

- Vivek
17 years ago
Jothi,

Our book covers Tomcat configuration, performance tuning, system security, and deployment architecture. This book doesn�t cover web application development using Tomcat- there are a lot of other good books that fulfill this need. We do cover Tomcat internals too, but not to the level of explaining how to write a JSP/servlet container from scratch.

- Vivek
17 years ago
That is a great answer Ben.

To second what you said, some reasons for using a Web server to front Tomcat include stability (Web servers such as Apache are typically a lot more robust), Clustering and load balancing (the JK Connector has a good support for clustered Tomcat configurations) and support for legacy applications.

Performance used to be one of the reasons for selecting a Web server frontend, but this largely depends on the nature of your Web application. If your application has mainly dynamic content � i.e., servlets and JSPs � you will not see a significant performance difference by using Apache or IIS as a Web front to Tomcat. In fact, performance might decrease because an extra layer needs to be traversed by incoming requests. However, you may get improved performance if your Web application has a lot of static content, use of SSL etc. - although SSL performance too is not a real issue with Tomcat 6, due to its use of the APR Connector.

I don�t have performance benchmarks for Tomcat 6 and an Apache httpd front end, but I can point you to those for Tomcat 5.5, if this helps:

http://cvs.apache.org/~woolfel/benchmark_summary.doc
http://cvs.apache.org/~woolfel/benchmark_summary.sxw
http://cvs.apache.org/~woolfel/tc_results.html

- Vivek
17 years ago
Announcing the release of a new book Beginning JavaServer Pages (Wrox
Press) [http://www.wrox.com/WileyCDA/WroxTitle/productCd-076457485X.html]

JavaServer Pages (JSP) is a cross-platform language that generates dynamic Web pages and uses XML-like tags written in Java to create content. With its latest release, version 2.0, JSP has become an even more powerful tool that beginners often find challenging to learn. This book provides you with an accessible introduction to JSP.

Packed with real-world code examples and in-depth case studies accompanied by fully working applications, this book introduces the many new features of JSP 2.0 while emphasizing good Web development practices. Along the way, you'll examine how JSP interacts with other Enterprise Java technologies and you'll be challenged to apply your new JSP programming skills to real-world projects.

What you will learn from this book ?

* JSP fundamentals, including JSP syntax and directives, JSP Expression Language, Tag libraries, and techniques for testing and debugging
* How to create dynamic content that is formatted and stylized on the fly, integrating Cascading Style Sheets (CSS) and JavaScript elements
* Developing multilingual websites with JSP
* How JSP interacts with other Enterprise Java technologies
* Ways to use JSP with Web frameworks, such as Struts, Spring, WebWork, and JavaServer Faces, and persistence frameworks, such as Hibernate, to build real-world Web applications
* Software design methodologies and developer tools such as Ant, jUnit, jMeter, CVS, and more
* How to use the right tools, design patterns and frameworks effectively, and where appropriate, for developing web applications

Who this book is for ?

This book is for novice programmers who have basic programming experience either in Java or a Web scripting language and want to become fluent in JSP.
19 years ago
I agree with you- and apparently so did the Tomcat 4.1 developers! The manager application in Tomcat 4.1 allows manager commands to be run from an ant script.
You can now use ant to build, install and then reload a web application. This allows for a very integrated develop-deploy-test cycle and is discussed in some length in the book. See the "Managing Applications with Ant" section in the sample chapter.
http://www.wrox.com/books/sample-chapters/SampleChapter_1861007736.pdf
The uses of ant in conjuntion with Tomcat is discussed in more detail in a later chapter in the book.
- Vivek

Originally posted by Garrett Smith:
One of the most annoying things about servlet development is that it is very time consuming.
Stop server, modify class file, run ant, start server.

Garrett

21 years ago
The reloadable attribute is very useful while developing application. In a production environment, you would want to turn it off as it has a performance hit.
- Vivek

Originally posted by Bruce Jin:

Sometimes Tomcat dies when it sees bad server.xml.
Try this:
<Context path="/report" docBase="c:\mrc\webapps\report" debug="0"
reloadable="true" />

21 years ago
Gary,
If you are looking for a short tutorial on deploying a servlet/web application, I can point you to the application developer's tutorial on the Tomcat web site (http://jakarta.apache.org/tomcat/tomcat-4.1-doc/appdev/index.html). For a more detail treatment, such as tuning the configuration for performance etc., buy the book!
- Vivek

Originally posted by Gary Rather:
What would be needed for me to look for in a book.
The same info that can be found in the tomcat docs , but a bit of spoon feeding to me.
When I first started using JSERV , then Tomcat many moons ago the most confusing is the first time geting it up and running.
As a beginner with the server I would love to have
a set up given to me to get my servlet running.
Just take me through the steps, deployment directory structure.
where do I put my HelloWorld.class
What do I set to get it to work in a standalone tomcat
How do I get it to work with apache.
=====================
Then as I get my app running need more intimate knowledge memory usuage setting, what and how do I know what my app or apps is using, what to set .
======================
All this available in the Tomcat docs for sure but it is hard to find. If the book had a good index and examples it is well worth the money

21 years ago
Hello Ryan,
The books covers Tomcat connectors extensively.
Tomcat's Connectors are like rabbits- there are so many of them, and they keep on multiplying :-) We have five chapters dealing with connectors- both the HTTP Connectors (HTTP/1.0, 1.1, Coyote HTTP) as well as the Web Server Connectors (mod_jk, mod_jk2, mod_webapp). Apache integrated with Tomcat is a fairly popular combination. We do cover this, as well as look at the other Web servers (e.g. IIS).
The 'Apache' in the title is a reference to Apache project, not the Apache HTTP server+Tomcat combination.
- Vivek

Originally posted by Ryan Bailey:
Hi Vivek and Welcome,
From the title of this book I assume Apache is Integrated with Tomcat? Does this book cover what versions to use as well as how to integrate the two? This is something I know a lot of people have tried to do (including myself ) for efficiency reasons.
Thanks for your time,
Ryan

21 years ago
I would like to add to Chanoch's comments. Yes, we have concentrated on Tomcat 4.0. However, you would also find a fair amount of coverage on 4.1- especially in the chapter dealing with Manager configuration (Tomcat 4.1.x has a new UI for this) and in the chapter(s) dealing with the HTTP Connectors.
- Vivek

Originally posted by chanoch wiggers:

the book mainly concentrates on 4.0 since that aws stable and out at the time and 4.1 was still in beta. Although there are many good things about .1, many companies would not trust it because it hasnt been out long enough for them so it seemed to be right to be more focussed - the 3.x lines we almost entirely ignored because trying to cover both would have made for a very large book, 50% of which would be useless to most people because the two generations are so different and most people deal with only one.


[ October 29, 2002: Message edited by: Vivek Chopra ]
21 years ago
Hello Carl,
Thanks for the opportunity.
Chanoch Wiggers, who is a co-author of this book seems to be around answering questions too. Hello Chanoch!
- Vivek

Originally posted by Carl Trusiak:
This week we are giving away four copies the Book "Professional Apache Tomcat".
And the best part... the Author, Vivek Chopra, will be online to answer your questions!
Thanks to the people at Wrox for the Books!

21 years ago
Hello Siva,
You can find the topic list at the Wrox web site (http://www.wrox.com/books/1861007736.htm). The book covers versions 3.x, 4.0.x and 4.1.x. It is targetted towards Tomcat administrators, and people interested in its installation and configuration. There are a lot of books in the market that focus on java/servlet programming and web applications, and very few on Tomcat's configuration details. Hopefully, our book can help fill that gap.
- Vivek

Originally posted by Siva Ram:
Hi,
What are the topics covered in this book ??
Is it deals with the latest version of tomcat 4.1.12 Stable & 4.0.5 ???
Have u kept any sample topics for ref.
Regards,
Siva Ram

21 years ago