tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 43683] Accessing Servlet while Reloading context gives 404 error
Date Wed, 25 Jun 2008 15:32:25 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=43683





--- Comment #18 from Joe Kislo <joe@k12s.phast.umass.edu>  2008-06-25 08:32:23 PST ---
Well that's frustrating :)  I've done some work on it today to try to narrow
down when it happens.

I've written a java program that will make the required calls to the URLs in
parallel to cause the issue.  I wrapped it in a loop, and it happened the first
time I ran it!  Then I ran it again, and let it run for 2 hours without it
happening once.

Then I restarted tomcat, and it happened first time!

So it seems to happen a lot *more* when tomcat has first started... but still
not every time.  I'm using Sun's 1.5.0_15 jvm if that somehow makes a
difference.

So I am attaching a unix shell script that will start+stop tomcat between each
test run, and my java program that does the URL calling.  You may need to tweak
a couple variables to make this work on your machine:

TestServiceDuringDestroy.sh: 
  TOMCAT_BIN_DIR - Set this to where the catalina.sh script is

TestServiceDuringDestroy.java:
  TESTCASE3_URL - Put the url to testcase3 (the one that spins cpu during init)
  RESTART_TOMCAT_URL - Put the url to restart that servlet
  RESTART_TOMCAT_BASIC_AUTH - Put in the basic authentication credentials for
the manager servlet in format username:password

With those changes... I think that will get it going for you.  The theory here
is:
while (true) {
 start tomcat
 Request the servlet
 Restart the servlet
 Request the servlet
 stop tomcat
}

When the testcase fails you'll see something like this:

Using CATALINA_BASE:   /var/tmp/tomcat/apache-tomcat-6.0.16
Using CATALINA_HOME:   /var/tmp/tomcat/apache-tomcat-6.0.16
Using CATALINA_TMPDIR: /var/tmp/tomcat/apache-tomcat-6.0.16/temp
Using JRE_HOME:       /usr/local/java
Sleeping for tomcat to start
Testcase Call 1: Requesting URL
Restart call: Requesting URL
Testcase Call 2: Requesting URL
Testcase Call 1: IOException in URL request
java.io.IOException: Server returned HTTP response code: 500 for URL:
http://localhost:8080/ServletRestartTest3/ServletRestartTest
        at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1174)
        at WebRequestThread.run(WebRequestThread.java:28)
Using CATALINA_BASE:   /var/tmp/tomcat/apache-tomcat-6.0.16
Using CATALINA_HOME:   /var/tmp/tomcat/apache-tomcat-6.0.16
Using CATALINA_TMPDIR: /var/tmp/tomcat/apache-tomcat-6.0.16/temp
Using JRE_HOME:       /usr/local/java
Sleeping for tomcat to stop


---
In the cases where it tomcat succeeds, I see this on the server side:
INFO: Waiting for 1 instance(s) to be deallocated

I do not see that when my testcase fails.

FWIW, I am using a apache-tomcat-6.0.16 binary installation, and I dropped in
lib/* and bin/*.jar from a newly compiled trunk svn checkout from yesterday
(06-24-08)

Good luck!


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message