Fix for Race Condition in init() - Tomcat 3.2b6

2000-10-28 Thread robin

Hi,

In Tomcat 3.2b6 there's a race condition during servlet init - if a second
request arrives while a servlet is still in its init method from its first
request, the ServletWrapper will create another instance of the servlet and
pass the new request to it without calling init, in violation of the
servlets API.  Obviously this only affects certain servlets under certain
scenarios.  It causes parts of my application to lock up sometimes.

Here's a patchfile for
jakarta-tomcat/src/share/org/apache/tomcat/core/Handler.java which fixes the
problem cleanly.

This bug has been reported in Bugrat for release 3.1, and I've tried to
report it for 3.2b6, but unfortunately BugRat is performing very badly at
the moment (Iocking up frequently), and has some serious HCI problems (i.e.
if you miss out a mandatory field in the report form and have to go back to
fix it, your entries are lost.)  It's taken me longer to try (without
success) to report the bug properly than it did to come up with the fix.

Anyway, I'm not a mailing list subscriber though I did check the archive to
see if there was reference to this problem.  So feel free to contact me
directly.  I hope the patch helps.

-Robin Barooah
[EMAIL PROTECTED]


--- Copy of Handler.javaMon Oct  9 06:07:00 2000
+++ Handler.javaSat Oct 28 19:57:49 2000
@@ -238,20 +238,22 @@
  */
 public void service(Request req, Response res) 
 {
-   if( ! initialized ) {
-   try {
-   init();
-   if ( ! initialized )
+   synchronized( this ) {
+   if( ! initialized ) {
+   try {
+   init();
+   if ( ! initialized )
return; // return if still not initialied
-   } catch( Exception ex ) {
-   initialized=false;
-   if( ex instanceof ClassNotFoundException ) {
-   contextM.handleStatus( req, res, 404);
+   } catch( Exception ex ) {
+   initialized=false;
+   if( ex instanceof ClassNotFoundException ) {
+   contextM.handleStatus( req, res, 404);
+   return;
+   }
+   context.log("Exception in init  " + ex.getMessage(), ex );
+   contextM.handleError( req, res, ex );
return;
}
-   context.log("Exception in init  " + ex.getMessage(), ex );
-   contextM.handleError( req, res, ex );
-   return;
}
}
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Tomcat v Resin

2001-06-13 Thread Robin Mousley

I'm not sure whether this is an appropriate list to post this to but...

I've been hearing quite a bit about Resin and its proponents claim greater
performance and functionality.

I'd be grateful for some opinions.

Thanks


Robin Mousley

G r a p e v i n e  I n t e r a c t i v e ( P t y )  L t d
Grapevine House
Steenberg Office Park
Silverwood Close
Tokai
7945
South Africa

Phone: +27-21-702-
Cell: +27-83-326-5165
Fax: +27-21-702-3334

-Original Message-
From: vikram [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 13, 2001 12:26 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: mapping folder in tomcat

Dear sir,
I am working in a web hosting co. where I have to install and configure
tomcat server in windows2000.I could install tomcat server and run it
successfully but now I am facing a big problem that I have to give ftp
access to my clients so I have to mapping client folder from tomcat server.
I have IIS but when I read its configure notes
(in-process-howto.html,tomcat-iis-howto.html), it is really very ambigues
notes and ultimatilly I could not success to mapping and configure tomcat
with IIS for mapping.Can you write me any clear process how can I mapping
other folder from of tomcat with IIS or without IIS, I have to restrect to
do not install other server software.I think I have clear my position.If u
can help me I will be greatfull to u.

Sir I have to done that ASAP..

Thanks in advance..

With regards.

Vikram mishra([EMAIL PROTECTED])