Java Mailing List Archive

http://www.junlu.com/

Home » dev-digest.tomcat »

dev Digest 22 Jul 2010 09:13:21 -0000 Issue 5285

dev-digest-help

2010-07-22


Author LoginPost Reply

dev Digest 22 Jul 2010 09:13:21 -0000 Issue 5285

Topics (messages 107971 through 108000):

svn commit: r966177 - in /tomcat/trunk/webapps/docs/config: cluster-manager.xml cluster.xml
 107971 by: markt.apache.org

svn commit: r966178 - /tomcat/trunk/webapps/docs/config/cluster-manager.xml
 107972 by: markt.apache.org

Re: [VOTE] Release build 6.0.29
 107973 by: Konstantin Kolinko

svn commit: r966184 - in /tomcat/tc6.0.x/trunk/webapps/docs/config: cluster-manager.xml cluster.xml
 107974 by: markt.apache.org

DO NOT REPLY [Bug 49625] Tomcat doesn't send Vary consistently when gzip enabled
 107975 by: bugzilla.apache.org

svn commit: r966292 - /tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java
 107976 by: markt.apache.org

svn commit: r966293 - /tomcat/tc6.0.x/trunk/STATUS.txt
 107977 by: markt.apache.org

svn commit: r966294 - in /tomcat/tc6.0.x/trunk: ./ STATUS.txt dist.xml webapps/docs/changelog.xml
 107978 by: markt.apache.org

DO NOT REPLY [Bug 49234] JMX Descriptor Modifications
 107979 by: bugzilla.apache.org

svn commit: r966304 - in /tomcat/trunk: java/org/apache/catalina/filters/ExpiresFilter.java test/org/apache/catalina/filters/TestExpiresFilter.java webapps/docs/changelog.xml webapps/docs/config/filter.xml
 107980 by: markt.apache.org

DO NOT REPLY [Bug 49617] Fix ExpiresFilter docs (remove remaining ExpiresActive reference)
 107981 by: bugzilla.apache.org

DO NOT REPLY [Bug 49165] Enhancement - Allow %{TIME_FORMAT}t As Configuration for AccessLogValve
 107982 by: bugzilla.apache.org

DO NOT REPLY [Bug 49600] Bad exception thrown by ProxyDirContext.lookup
 107983 by: bugzilla.apache.org
 107988 by: bugzilla.apache.org
 107998 by: bugzilla.apache.org

DO NOT REPLY [Bug 49631] New: Custom DatabaseResourceProvider extension cannot get app context JNDI resources
 107984 by: bugzilla.apache.org

svn commit: r966404 - in /tomcat/trunk: java/org/apache/naming/resources/ webapps/docs/
 107985 by: markt.apache.org

svn commit: r966405 - /tomcat/trunk/test/org/apache/naming/resources/TestProxyDirContext.java
 107986 by: markt.apache.org

Re: svn commit: r965150 - in /tomcat/trunk: java/org/apache/catalina/connector/ java/org/apache/tomcat/util/net/       webapps/docs/ webapps/docs/config/
 107987 by: Mark Thomas
 107989 by: Remy Maucherat

DO NOT REPLY [Bug 49631] Custom DatabaseResourceProvider extension cannot get app context JNDI resources
 107990 by: bugzilla.apache.org
 107991 by: bugzilla.apache.org

svn commit: r966477 - /tomcat/tc6.0.x/trunk/STATUS.txt
 107992 by: kfujino.apache.org

DO NOT REPLY [Bug 49422] hudson does not work on tomcat 7.0.0 rc4
 107993 by: bugzilla.apache.org
 107994 by: bugzilla.apache.org

DO NOT REPLY [Bug 49635] New: org.apache.catalina.connector.RequestFacade has wrong implementation...
 107995 by: bugzilla.apache.org

DO NOT REPLY [Bug 49567] when starting a new thread from a startAsync Runnable, an infinite amount of doPosts is generated
 107996 by: bugzilla.apache.org

DO NOT REPLY [Bug 49635] org.apache.catalina.connector.RequestFacade has wrong implementation...
 107997 by: bugzilla.apache.org

[RESULT] [VOTE] Release build 6.0.29
 107999 by: jean-frederic clere

svn commit: r966548 - in /tomcat/trunk: java/org/apache/catalina/connector/ java/org/apache/catalina/core/ java/org/apache/coyote/http11/ test/org/apache/catalina/core/ webapps/docs/
 108000 by: markt.apache.org

Administrivia:

---------------------------------------------------------------------
To post to the list, e-mail: dev@(protected)
To unsubscribe, e-mail: dev-digest-unsubscribe@(protected)
For additional commands, e-mail: dev-digest-help@(protected)

----------------------------------------------------------------------


Attachment: dev_107971.ezm (zipped)
Author: markt
Date: Wed Jul 21 10:58:56 2010
New Revision: 966177

URL: http://svn.apache.org/viewvc?rev=966177&view=rev
Log:
Add note about message processing order.

Modified:
  tomcat/trunk/webapps/docs/config/cluster-manager.xml
  tomcat/trunk/webapps/docs/config/cluster.xml

Modified: tomcat/trunk/webapps/docs/config/cluster-manager.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/cluster-manager.xml?rev=966177&r1=966176&r2=966177&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/cluster-manager.xml (original)
+++ tomcat/trunk/webapps/docs/config/cluster-manager.xml Wed Jul 21 10:58:56 2010
@@(protected) @@
 <subsection name="org.apache.catalina.ha.session.BackupManager Attributes">
  <attributes>
   <attribute name="mapSendOptions" required="false">
-     The backup manager uses a replicated map, this map is sending and receiving messages.
-     You can setup the flag for how this map is sending messages, the default value is <code>6</code>(asynchronous).
+     The backup manager uses a replicated map, this map is sending and
+     receiving messages. You can setup the flag for how this map is sending
+     messages, the default value is <code>6</code>(asynchronous).<br/>
+     Note that if you use asynchronous messaging it is possible for update
+     messages for a session to be processed by the receiving node in a
+     different order to the order in which they were sent.
   </attribute>
  </attributes>
 </subsection>

Modified: tomcat/trunk/webapps/docs/config/cluster.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/cluster.xml?rev=966177&r1=966176&r2=966177&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/cluster.xml (original)
+++ tomcat/trunk/webapps/docs/config/cluster.xml Wed Jul 21 10:58:56 2010
@@(protected) @@
    <code>Channel.SEND_OPTIONS_ASYNCHRONOUS = 0x0008</code><br/>
    <code>Channel.SEND_OPTIONS_USE_ACK = 0x0002</code><br/>
    So to use ACK and ASYNC messaging, the flag would be <code>10 (8+2) or 0x000B</code><br/>
+    Note that if you use ASYNC messaging it is possible for update messages
+    for a session to be processed by the receiving nodes in a different order
+    to the order in which they were sent.
    </p>
  </attribute>
  <attribute name="channelStartOptions" required="false">




Attachment: dev_107972.ezm (zipped)
Author: markt
Date: Wed Jul 21 10:59:31 2010
New Revision: 966178

URL: http://svn.apache.org/viewvc?rev=966178&view=rev
Log:
Correct explanation. mapSendOptions=6 is synchronous, not asynchronous.

Modified:
  tomcat/trunk/webapps/docs/config/cluster-manager.xml

Modified: tomcat/trunk/webapps/docs/config/cluster-manager.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/cluster-manager.xml?rev=966178&r1=966177&r2=966178&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/cluster-manager.xml (original)
+++ tomcat/trunk/webapps/docs/config/cluster-manager.xml Wed Jul 21 10:59:31 2010
@@(protected) @@
   <attribute name="mapSendOptions" required="false">
    The backup manager uses a replicated map, this map is sending and
    receiving messages. You can setup the flag for how this map is sending
-     messages, the default value is <code>6</code>(asynchronous).<br/>
+     messages, the default value is <code>6</code>(synchronous).<br/>
    Note that if you use asynchronous messaging it is possible for update
    messages for a session to be processed by the receiving node in a
    different order to the order in which they were sent.




Attachment: dev_107973.ezm (zipped)
2010/7/19 jean-frederic clere <jfclere@(protected)>:
> The candidates binaries are available here:
> http://people.apache.org/~jfclere/tomcat-6/v6.0.29/
>
> According to the release process, the 6.0.29 build corresponding to the
> tag TOMCAT_6_0_29 is:
> [ ] Broken
> [ ] Alpha
> [ ] Beta
> [X] Stable
>

Best regards,
Konstantin Kolinko


Attachment: dev_107974.ezm (zipped)
Author: markt
Date: Wed Jul 21 11:31:18 2010
New Revision: 966184

URL: http://svn.apache.org/viewvc?rev=966184&view=rev
Log:
Merge cluster doc updates from trunk
- correct description for backup default
- add note about message ordering with async

Modified:
  tomcat/tc6.0.x/trunk/webapps/docs/config/cluster-manager.xml
  tomcat/tc6.0.x/trunk/webapps/docs/config/cluster.xml

Modified: tomcat/tc6.0.x/trunk/webapps/docs/config/cluster-manager.xml
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/config/cluster-manager.xml?rev=966184&r1=966183&r2=966184&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/config/cluster-manager.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/config/cluster-manager.xml Wed Jul 21 11:31:18 2010
@@(protected) @@
 <subsection name="org.apache.catalina.ha.session.BackupManager Attributes">
  <attributes>
   <attribute name="mapSendOptions" required="false">
-     The backup manager uses a replicated map, this map is sending and receiving messages.
-     You can setup the flag for how this map is sending messages, the default value is <code>6</code>(asynchronous).
+     The backup manager uses a replicated map, this map is sending and
+     receiving messages. You can setup the flag for how this map is sending
+     messages, the default value is <code>6</code>(synchronous).<br/>
+     Note that if you use asynchronous messaging it is possible for update
+     messages for a session to be processed by the receiving node in a
+     different order to the order in which they were sent.
   </attribute>
  </attributes>
 </subsection>

Modified: tomcat/tc6.0.x/trunk/webapps/docs/config/cluster.xml
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/config/cluster.xml?rev=966184&r1=966183&r2=966184&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/config/cluster.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/config/cluster.xml Wed Jul 21 11:31:18 2010
@@(protected) @@
    <code>Channel.SEND_OPTIONS_ASYNCHRONOUS = 0x0008</code><br/>
    <code>Channel.SEND_OPTIONS_USE_ACK = 0x0002</code><br/>
    So to use ACK and ASYNC messaging, the flag would be <code>10 (8+2) or 0x000B</code><br/>
+    Note that if you use ASYNC messaging it is possible for update messages
+    for a session to be processed by the receiving nodes in a different order
+    to the order in which they were sent.
    </p>
  </attribute>
  <attribute name="channelStartOptions" required="false">




Attachment: dev_107975.ezm (zipped)
https://issues.apache.org/bugzilla/show_bug.cgi?id=49625

--- Comment #1 from Ferenc Lutischan <yoursoft@(protected) ---
A test url:
http://redbot.org/?uri=http://dictzone.com/english-german-dictionary/

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


Attachment: dev_107976.ezm (zipped)
Author: markt
Date: Wed Jul 21 16:09:41 2010
New Revision: 966292

URL: http://svn.apache.org/viewvc?rev=966292&view=rev
Log:
Return copies of the URL array rather than the original. This facilitated CVE-2010-1622 although the root cause was in the Spring Framework. Returning a copy in this case seems like a good idea.

Modified:
  tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java

Modified: tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java?rev=966292&r1=966291&r2=966292&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java (original)
+++ tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java Wed Jul 21 16:09:41 2010
@@(protected)
  public URL[] getURLs() {

     if (repositoryURLs != null) {
-        return repositoryURLs;
+        return repositoryURLs.clone();
     }

     URL[] external = super.getURLs();
@@(protected)
        repositoryURLs = new URL[0];
     }

-     return repositoryURLs;
+     return repositoryURLs.clone();

  }





Attachment: dev_107977.ezm (zipped)
Author: markt
Date: Wed Jul 21 16:11:20 2010
New Revision: 966293

URL: http://svn.apache.org/viewvc?rev=966293&view=rev
Log:
Proposal

Modified:
  tomcat/tc6.0.x/trunk/STATUS.txt

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=966293&r1=966292&r2=966293&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Wed Jul 21 16:11:20 2010
@@(protected):
 http://people.apache.org/~markt/patches/2010-07-21-line-endings.patch
 +1: markt, kkolinko, jfclere
 -1:
+
+* Return a copy of the URL being used from the webapp class loader, not the
+ original.
+ http://svn.apache.org/viewvc?rev=966292&view=rev
+ +1: markt
+ -1:




Attachment: dev_107978.ezm (zipped)
Author: markt
Date: Wed Jul 21 16:14:18 2010
New Revision: 966294

URL: http://svn.apache.org/viewvc?rev=966294&view=rev
Log:
Fix line endings for Eclipse files in src distro

Modified:
  tomcat/tc6.0.x/trunk/  (props changed)
  tomcat/tc6.0.x/trunk/STATUS.txt
  tomcat/tc6.0.x/trunk/dist.xml
  tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc6.0.x/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jul 21 16:14:18 2010
@@(protected) @@
-/tomcat/trunk:601180,606992,612607,630314,640888,652744,653247,666232,673796,673820,677910,683969,683982,684001,684081,684234,684269-684270,685177,687503,687645,689402,690781,691392,691805,692748,693378,694992,695053,695311,696780,696782,698012,698227,698236,698613,699427,699634,701355,709294,709811,709816,710063,710066,710125,710205,711126,711600,712461,712467,713953,714002,718360,719119,719124,719602,719626,719628,720046,720069,721040,721286,721708,721886,723404,723738,726052,727303,728032,728768,728947,729057,729567,729569,729571,729681,729809,729815,729934,730250,730590,731651,732859,732863,734734,740675,740684,742677,742697,742714,744160,744238,746321,746384,746425,747834,747863,748344,750258,750291,750921,751286-751287,751289,751295,752323,753039,757335,757774,758249,758365,758596,758616,758664,759074,761601,762868,762929,762936-762937,763166,763183,763193,763228,763262,763298,763302,763325,763599,763611,763654,763681,763706,764985,764997,765662,768335,769979,770716,77
0809,770876,772872,776921,776924,776935,776945,777464,777466,777576,777625,778379,778523-778524,781528,781779,782145,782791,783316,783696,783724,783756,783762,783766,783863,783934,784453,784602,784614,785381,785688,785768,785859,786468,786487,786490,786496,786667,787627,787770,787985,789389,790405,791041,791184,791194,791224,791243,791326,791328,791789,792740,793372,793757,793882,793981,794082,794673,794822,795043,795152,795210,795457,795466,797168,797425,797596,797607,802727,802940,804462,804544,804734,805153,809131,809603,810916,810977,812125,812137,812432,813001,813013,813866,814180,814708,814876,815972,816252,817442,817822,819339,819361,820110,820132,820874,820954,821397,828196,828201,828210,828225,828759,830378-830379,830999,831106,831774,831785,831828,831850,831860,832214,832218,833121,833545,834047,835036,835336,836405,881396,881412,883130,883134,883146,883165,883177,883362,883565,884341,885038,885231,885241,885260,885901,885991,886019,888072,889363,889606,889716,8901
39,890265,890349-890350,890417,891185-891187,891583,892198,892341,892415,892464,892555,892812,892814,892817,892843,892887,893321,893493,894580,894586,894805,894831,895013,895045,895057,895191,895392,895703,896370,896384,897380-897381,897776,898126,898256,898468,898527,898555,898558,898718,898836,898906,899284,899348,899420,899653,899769-899770,899783,899788,899792,899916,899918-899919,899935,899949,903916,905020,905151,905722,905728,905735,907311,907513,907538,907652,907819,907825,907864,908002,908721,908754,908759,909097,909206,909212,909525,909636,909869,909875,909887,910266,910370,910442,910471,910485,910974,915226,915737,915861,916097,916141,916157,916170,917598,917633,918093,918489,918594,918684,918787,918792,918799,918803,918885,919851,919914,920025,920055,920298,920449,920596,920824,920840,921444,922010,926716,927062,927621,928482,928695,928732,928798,931709,932357,932967,935105,935983,939491,939551,940064,941356,941463,944409,944416,945231,945808,945835,945841,946686
,948057,950164,950596,950614,950851,950905,951615,953434,954435,955648,955655,956832,957130,957830,958192,960701,963868,964614
+/tomcat/trunk:601180,606992,612607,630314,640888,652744,653247,666232,673796,673820,677910,683969,683982,684001,684081,684234,684269-684270,685177,687503,687645,689402,690781,691392,691805,692748,693378,694992,695053,695311,696780,696782,698012,698227,698236,698613,699427,699634,701355,709294,709811,709816,710063,710066,710125,710205,711126,711600,712461,712467,713953,714002,718360,719119,719124,719602,719626,719628,720046,720069,721040,721286,721708,721886,723404,723738,726052,727303,728032,728768,728947,729057,729567,729569,729571,729681,729809,729815,729934,730250,730590,731651,732859,732863,734734,740675,740684,742677,742697,742714,744160,744238,746321,746384,746425,747834,747863,748344,750258,750291,750921,751286-751287,751289,751295,752323,753039,757335,757774,758249,758365,758596,758616,758664,759074,761601,762868,762929,762936-762937,763166,763183,763193,763228,763262,763298,763302,763325,763599,763611,763654,763681,763706,764985,764997,765662,768335,769979,770716,77
0809,770876,772872,776921,776924,776935,776945,777464,777466,777576,777625,778379,778523-778524,781528,781779,782145,782791,783316,783696,783724,783756,783762,783766,783863,783934,784453,784602,784614,785381,785688,785768,785859,786468,786487,786490,786496,786667,787627,787770,787985,789389,790405,791041,791184,791194,791224,791243,791326,791328,791789,792740,793372,793757,793882,793981,794082,794673,794822,795043,795152,795210,795457,795466,797168,797425,797596,797607,802727,802940,804462,804544,804734,805153,809131,809603,810916,810977,812125,812137,812432,813001,813013,813866,814180,814708,814876,815972,816252,817442,817822,819339,819361,820110,820132,820874,820954,821397,828196,828201,828210,828225,828759,830378-830379,830999,831106,831774,831785,831828,831850,831860,832214,832218,833121,833545,834047,835036,835336,836405,881396,881412,883130,883134,883146,883165,883177,883362,883565,884341,885038,885231,885241,885260,885901,885991,886019,888072,889363,889606,889716,8901
39,890265,890349-890350,890417,891185-891187,891583,892198,892341,892415,892464,892555,892812,892814,892817,892843,892887,893321,893493,894580,894586,894805,894831,895013,895045,895057,895191,895392,895703,896370,896384,897380-897381,897776,898126,898256,898468,898527,898555,898558,898718,898836,898906,899284,899348,899420,899653,899769-899770,899783,899788,899792,899916,899918-899919,899935,899949,903916,905020,905151,905722,905728,905735,907311,907513,907538,907652,907819,907825,907864,908002,908721,908754,908759,909097,909206,909212,909525,909636,909869,909875,909887,910266,910370,910442,910471,910485,910974,915226,915737,915861,916097,916141,916157,916170,917598,917633,918093,918489,918594,918684,918787,918792,918799,918803,918885,919851,919914,920025,920055,920298,920449,920596,920824,920840,921444,922010,926716,927062,927621,928482,928695,928732,928798,931709,932357,932967,935105,935983,939491,939551,940064,941356,941463,944409,944416,945231,945808,945835,945841,946686
,948057,950164,950596,950614,950851,950905,951615,953434,954435,955648,955655,956832,957130,957830,958192,960701,963868,964614,966177-966178

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=966294&r1=966293&r2=966294&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Wed Jul 21 16:14:18 2010
@@(protected):
 +1: kkolinko
 -1:

-* Correct line endings in -src.zip distribution
- http://people.apache.org/~markt/patches/2010-07-21-line-endings.patch
- +1: markt, kkolinko, jfclere
- -1:
-
* Return a copy of the URL being used from the webapp class loader, not the
 original.
 http://svn.apache.org/viewvc?rev=966292&view=rev

Modified: tomcat/tc6.0.x/trunk/dist.xml
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/dist.xml?rev=966294&r1=966293&r2=966294&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/dist.xml (original)
+++ tomcat/tc6.0.x/trunk/dist.xml Wed Jul 21 16:14:18 2010
@@(protected) @@
  <include name="**/NOTICE"/>
  <include name="**/RELEASE-NOTES"/>
  <include name="**/*.bat"/>
+   <include name="**/*.classpath"/>
  <include name="**/*.dtd"/>
  <include name="**/*.htm"/>
  <include name="**/*.html"/>
@@(protected) @@
  <include name="**/*.nsi"/>
  <include name="**/*.policy"/>
  <include name="**/*.pom"/>
+   <include name="**/*.project"/>
  <include name="**/*.properties"/>
  <include name="**/*.properties.default"/>
  <include name="**/*.sh"/>

Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=966294&r1=966293&r2=966294&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Wed Jul 21 16:14:18 2010
@@(protected) @@
<!-- Section names:
General, Catalina, Coyote, Jasper, Cluster, Webapps, Other
-->
+<section name="Tomcat 6.0.30 (jfclere)">
+ <subsection name="Other">
+   <changelog>
+    <fix>
+     Use native line endings for example Eclipse configuration files in
+     source distribution. (markt)
+    </fix>
+   </changelog>
+ </subsection>
+</section>
<section name="Tomcat 6.0.29 (jfclere)">
 <subsection name="Catalina">
  <changelog>




Attachment: dev_107979.ezm (zipped)
https://issues.apache.org/bugzilla/show_bug.cgi?id=49234

--- Comment #65 from Mark Thomas <markt@(protected) ---
(In reply to comment #64)
> Currently I am bit stuck on above. Any ideas on this?

I'd start by looking at the MBeans for the components that currently have
separate MBeans.

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


Attachment: dev_107980.ezm (zipped)
Author: markt
Date: Wed Jul 21 16:37:58 2010
New Revision: 966304

URL: http://svn.apache.org/viewvc?rev=966304&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49617
Correct the ExpiresFilter documentation after changes to the submitted patch

Modified:
  tomcat/trunk/java/org/apache/catalina/filters/ExpiresFilter.java
  tomcat/trunk/test/org/apache/catalina/filters/TestExpiresFilter.java
  tomcat/trunk/webapps/docs/changelog.xml
  tomcat/trunk/webapps/docs/config/filter.xml

Modified: tomcat/trunk/java/org/apache/catalina/filters/ExpiresFilter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/filters/ExpiresFilter.java?rev=966304&r1=966303&r2=966304&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/filters/ExpiresFilter.java (original)
+++ tomcat/trunk/java/org/apache/catalina/filters/ExpiresFilter.java Wed Jul 21 16:37:58 2010
@@(protected)
* &lt;/web-app&gt;
* </pre></code>
*
- * <h2>Configuration Parameters</h2><h3>
- * <tt>ExpiresActive</tt></h3>
- * <p>
- * This directive enables or disables the generation of the <tt>Expires</tt> and
- * <tt>Cache-Control</tt> headers by this <tt>ExpiresFilter</tt>. If set to
- * <tt>Off</tt>, the headers will not be generated for any HTTP response. If set
- * to <tt>On</tt> or <tt>true</tt>, the headers will be added to served HTTP
- * responses according to the criteria defined by the
- * <tt>ExpiresByType &lt;content-type&gt;</tt> and <tt>ExpiresDefault</tt>
- * directives. Note that this directive does not guarantee that an
- * <tt>Expires</tt> or <tt>Cache-Control</tt> header will be generated. If the
- * criteria aren&#x27;t met, no header will be sent, and the effect will be as
- * though this directive wasn&#x27;t even specified.
- * </p>
- * <p>
- * This parameter is optional, default value is <tt>true</tt>.
- * </p>
- * <p>
- * <i>Enable filter</i>
- * </p>
- *
- * <code><pre>
- * &lt;init-param&gt;
- *   &lt;!-- supports case insensitive &#x27;On&#x27; or &#x27;true&#x27; --&gt;
- *   &lt;param-name&gt;ExpiresActive&lt;/param-name&gt;&lt;param-value&gt;On&lt;/param-value&gt;
- * &lt;/init-param&gt;
- * </pre></code>
- * <p>
- * <i>Disable filter</i>
- * </p>
- *
- * <code><pre>
- * &lt;init-param&gt;
- *   &lt;!-- supports anything different from case insensitive &#x27;On&#x27; and &#x27;true&#x27; --&gt;
- *   &lt;param-name&gt;ExpiresActive&lt;/param-name&gt;&lt;param-value&gt;Off&lt;/param-value&gt;
- * &lt;/init-param&gt;
- * </pre></code>
+ * <h2>Configuration Parameters</h2>
*
* <h3>
* <tt>ExpiresByType &lt;content-type&gt;</tt></h3>
@@(protected)
* <tt>max-age</tt> directive of the <tt>Cache-Control</tt> header),</li>
* <li>the response status code is not excluded by the directive
* <tt>ExpiresExcludedResponseStatusCodes</tt>,</li>
- * <li>The <tt>Content-Type</tt> of the response matches one of the types
+ * <li>the <tt>Content-Type</tt> of the response matches one of the types
* defined the in <tt>ExpiresByType</tt> directives or the
* <tt>ExpiresDefault</tt> directive is defined.</li>
* </ol>
@@(protected)
* <code><pre>
* Mar 26, 2010 2:01:41 PM org.apache.catalina.filters.ExpiresFilter init
* FINE: Filter initialized with configuration ExpiresFilter[
- *   active=true,
*   excludedResponseStatusCode=[304],
*   default=null,
*   byType={

Modified: tomcat/trunk/test/org/apache/catalina/filters/TestExpiresFilter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/filters/TestExpiresFilter.java?rev=966304&r1=966303&r2=966304&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/filters/TestExpiresFilter.java (original)
+++ tomcat/trunk/test/org/apache/catalina/filters/TestExpiresFilter.java Wed Jul 21 16:37:58 2010
@@(protected)
          "modification plus 5 hours 3 minutes");
     filterDef.addInitParameter("ExpiresByType image/jpg", "A10000");
     filterDef.addInitParameter("ExpiresByType video/mpeg", "M20000");
-     filterDef.addInitParameter("ExpiresActive", "Off");
     filterDef.addInitParameter("ExpiresExcludedResponseStatusCodes",
          "304, 503");


Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=966304&r1=966303&r2=966304&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Wed Jul 21 16:37:58 2010
@@(protected) @@
     disabled by default. Based on a patch by Yair Lenga. (markt)
    </add>
    <add>
-     <bug>48998</bug>: Add the ExpiresFilter, a port of the httpd mod_expires
-     module. Patch provided by Cyrille Le Clerc. (markt)
+     <bug>48998</bug>, <bug>49617</bug>: Add the ExpiresFilter, a port of the
+     httpd mod_expires module. Patch provided by Cyrille Le Clerc. (markt)
    </add>
    <fix>
     <bug>49030</bug>: When initializing/starting/stopping connectors and

Modified: tomcat/trunk/webapps/docs/config/filter.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/filter.xml?rev=966304&r1=966303&r2=966304&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/filter.xml (original)
+++ tomcat/trunk/webapps/docs/config/filter.xml Wed Jul 21 16:37:58 2010
@@(protected)
  <tt>max-age</tt> directive of the <tt>Cache-Control</tt> header),</li>
  <li>the response status code is not excluded by the directive
  <tt>ExpiresExcludedResponseStatusCodes</tt>,</li>
-   <li>The <tt>Content-Type</tt> of the response matches one of the types
+   <li>the <tt>Content-Type</tt> of the response matches one of the types
  defined the in <tt>ExpiresByType</tt> directives or the
  <tt>ExpiresDefault</tt> directive is defined.</li>
  </ol>
@@(protected)
&lt;/init-param&gt;
      </source>
      <p>
-      Note that this directive only has effect if <tt>ExpiresActive On</tt> has
-      been specified. It overrides, for the specified MIME type <i>only</i>, any
+      It overrides, for the specified MIME type <i>only</i>, any
      expiration date set by the <tt>ExpiresDefault</tt> directive.
      </p>
      <p>
@@(protected)
org.apache.catalina.filters.ExpiresFilter.level = FINE
  </source>
  <p>
-   Sample of initialization log message :
+   Sample of initialization log message:
  </p>
 
  <source>
Mar 26, 2010 2:01:41 PM org.apache.catalina.filters.ExpiresFilter init
FINE: Filter initialized with configuration ExpiresFilter[
- active=true,
excludedResponseStatusCode=[304],
default=null,
byType={
@@(protected)
  </source>
  <p>
  Sample of per-request log message where <tt>ExpiresFilter</tt> adds an
-   expiration date
+   expiration date:
  </p>
 
  <source>
@@(protected)
  </source>
  <p>
  Sample of per-request log message where <tt>ExpiresFilter</tt> does not add
-   an expiration date
+   an expiration date:
  </p>
 
  <source>




Attachment: dev_107981.ezm (zipped)
https://issues.apache.org/bugzilla/show_bug.cgi?id=49617

Mark Thomas <markt@(protected):

      What   |Removed              |Added
----------------------------------------------------------------------------
        Status|NEW                 |RESOLVED
     Resolution|                   |FIXED
     OS/Version|                   |All

--- Comment #2 from Mark Thomas <markt@(protected) ---
Patch applied and will be in 7.0.1 onwards.

Many thanks.

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


Attachment: dev_107982.ezm (zipped)
https://issues.apache.org/bugzilla/show_bug.cgi?id=49165

--- Comment #5 from Mark Thomas <markt@(protected) ---
(In reply to comment #4)

Thanks for the patch. I have reviewed it and have the following comments:
1. It uses a mix of tabs and spaces for indenting. Only spaces should be used.
2. Log messages should use the StringManager to provide i18n support.
3. Setting currentDate in the AccessDateStruct serves no purpose
4. Same for currentDateString
5. DateAndTimeElementVolumeTest can probably be added to the existing
Benchmarks test.

Out of curiosity, if you remove the code that manages the only creating the
date once a second entirely and use a date format that does not include millis,
what is the performance like? I'm wondering if we can just remove that code
entirely.

If you can update the patch, I'll take another look. With the issues above
fixed it should be ready to apply.

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


Attachment: dev_107983.ezm (zipped)
https://issues.apache.org/bugzilla/show_bug.cgi?id=49600

--- Comment #1 from Mark Thomas <markt@(protected) ---
The gain by using notFoundException is in GC. It prevents exception objects
being created for resources that don't exist. I agree it could be static (final
too).

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


Attachment: dev_107988.ezm (zipped)
https://issues.apache.org/bugzilla/show_bug.cgi?id=49600

Mark Thomas <markt@(protected):

      What   |Removed              |Added
----------------------------------------------------------------------------
        Status|NEW                 |RESOLVED
     Resolution|                   |FIXED

--- Comment #2 from Mark Thomas <markt@(protected) ---
Thanks for the test case. I kept the "not Found" test (with a minor
modification" but not the strack trace test.

The returned exceptions have been made consistent for 7.0.x and will be
included in 7.0.1 onwards.

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


Attachment: dev_107998.ezm (zipped)
https://issues.apache.org/bugzilla/show_bug.cgi?id=49600

--- Comment #3 from Marc Guillemot <mguillemot@(protected) ---
Can you explain why GC gain are considered at this special place in detriment
of a correct exception?

For me if GC gain is an argument, then there are so many other places in Tomcat
where it should apply. This starts with the BaseDirContext.lookup that you've
fixed to address the "not Found" point of this case.

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


Attachment: dev_107984.ezm (zipped)
https://issues.apache.org/bugzilla/show_bug.cgi?id=49631

      Summary: Custom DatabaseResourceProvider extension cannot get
            app context JNDI resources
      Product: Tomcat 6
      Version: 6.0.28
      Platform: PC
    OS/Version: Windows NT
       Status: NEW
      Severity: normal
      Priority: P2
     Component: Catalina
    AssignedTo: dev@(protected)
    ReportedBy: matt.helgren@(protected)


I've written a custom extension to the DatabaseResourceProvider that allows our
application to store some subset of files in the database. In order to get a
db connection I'm trying to lookup a datasource via JNDI:

  private Connection getConnection() throws SQLException, NamingException {  
    Context initContext = new InitialContext();
    System.out.println("here");
    DataSource ds =
(DataSource)initContext.lookup("java:/comp/env/"+JDBC_SYSTEM_JNDI);
    return ds.getConnection();
  }

I've found that in some cases it does get the datasource and in others it
throws a namingexception that the resource was not found. I debugged it out
and found that in certain cases it works if the resources is being requested
through a servlet or JSP call but when its a direct request for a static file
such as an image or CSS file it fails. In those failing cases I've found that
its getting the server naming context and not the web app context.

More digging into the tomcat naming stuff showed that the way it determines the
naming context to use is derived by the current threads class loader. Looks
like the class loader is not getting replaced with the web apps class loader in
the case of static resource serving.

Could something be added to make sure the class loader for the thread is always
updated to the current web app class loader before calling into the DirContext
classes?

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


Attachment: dev_107985.ezm (zipped)
Author: markt
Date: Wed Jul 21 20:30:53 2010
New Revision: 966404

URL: http://svn.apache.org/viewvc?rev=966404&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49600
Return a consistent exception for 'Not Found' resources.

Modified:
  tomcat/trunk/java/org/apache/naming/resources/BaseDirContext.java
  tomcat/trunk/java/org/apache/naming/resources/FileDirContext.java
  tomcat/trunk/java/org/apache/naming/resources/ProxyDirContext.java
  tomcat/trunk/java/org/apache/naming/resources/WARDirContext.java
  tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/naming/resources/BaseDirContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/BaseDirContext.java?rev=966404&r1=966403&r2=966404&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/resources/BaseDirContext.java (original)
+++ tomcat/trunk/java/org/apache/naming/resources/BaseDirContext.java Wed Jul 21 20:30:53 2010
@@(protected);
import javax.naming.Context;
import javax.naming.Name;
import javax.naming.NameClassPair;
+import javax.naming.NameNotFoundException;
import javax.naming.NameParser;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
@@(protected)
     }
     
     // Really not found
-     throw new NamingException(sm.getString("resources.notFound", name));
+     throw new NameNotFoundException(
+           sm.getString("resources.notFound", name));
  }

  /**
@@(protected)
     }

     // Really not found
-     throw new NamingException(sm.getString("resources.notFound", name));
+     throw new NameNotFoundException(
+           sm.getString("resources.notFound", name));
  }


@@(protected)
     }
     
     // Really not found
-     throw new NamingException(sm.getString("resources.notFound", name));
+     throw new NameNotFoundException(
+           sm.getString("resources.notFound", name));
  }

  /**

Modified: tomcat/trunk/java/org/apache/naming/resources/FileDirContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/FileDirContext.java?rev=966404&r1=966403&r2=966404&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/resources/FileDirContext.java (original)
+++ tomcat/trunk/java/org/apache/naming/resources/FileDirContext.java Wed Jul 21 20:30:53 2010
@@(protected);
import javax.naming.Binding;
import javax.naming.NameAlreadyBoundException;
import javax.naming.NameClassPair;
+import javax.naming.NameNotFoundException;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.OperationNotSupportedException;
@@(protected)
     File file = file(name);

     if (file == null)
-        throw new NamingException
-           (sm.getString("resources.notFound", name));
+        throw new NameNotFoundException(
+             sm.getString("resources.notFound", name));

     if (!file.delete())
        throw new NamingException
@@(protected)
     File file = file(oldName);

     if (file == null)
-        throw new NamingException
+        throw new NameNotFoundException
          (sm.getString("resources.notFound", oldName));

     File newFile = new File(base, newName);
@@(protected)
     File file = file(name);

     if (file == null)
-        throw new NamingException
+        throw new NameNotFoundException
          (sm.getString("resources.notFound", name));

     return new NamingContextEnumeration(list(file).iterator());

Modified: tomcat/trunk/java/org/apache/naming/resources/ProxyDirContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/ProxyDirContext.java?rev=966404&r1=966403&r2=966404&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/resources/ProxyDirContext.java (original)
+++ tomcat/trunk/java/org/apache/naming/resources/ProxyDirContext.java Wed Jul 21 20:30:53 2010
@@(protected)
  public static final String HOST = "host";


+   /**
+   * Immutable name not found exception.
+   */
+   protected static final NameNotFoundException NOT_FOUND_EXCEPTION =
+     new ImmutableNameNotFoundException();
+
+
  // ----------------------------------------------------------- Constructors


@@(protected)
  /**
   * The string manager for this package.
   */
-   protected static final StringManager sm = StringManager.getManager(Constants.Package);
+   protected static final StringManager sm =
+     StringManager.getManager(Constants.Package);


  /**
@@(protected)


  /**
-   * Immutable name not found exception.
-   */
-   protected NameNotFoundException notFoundException =
-     new ImmutableNameNotFoundException();
-
-
-   /**
   * Non cacheable resources.
   */
  protected String[] nonCacheable = { "/WEB-INF/lib/", "/WEB-INF/classes/" };
@@(protected)
     CacheEntry entry = cacheLookup(name.toString());
     if (entry != null) {
        if (!entry.exists) {
-           throw notFoundException;
+           throw NOT_FOUND_EXCEPTION;
        }
        if (entry.resource != null) {
          // Check content caching.
@@(protected)
     CacheEntry entry = cacheLookup(name);
     if (entry != null) {
        if (!entry.exists) {
-           throw notFoundException;
+           throw NOT_FOUND_EXCEPTION;
        }
        if (entry.resource != null) {
          return entry.resource;
@@(protected)
     CacheEntry entry = cacheLookup(name.toString());
     if (entry != null) {
        if (!entry.exists) {
-           throw notFoundException;
+           throw NOT_FOUND_EXCEPTION;
        }
        return entry.attributes;
     }
@@(protected)
     CacheEntry entry = cacheLookup(name);
     if (entry != null) {
        if (!entry.exists) {
-           throw notFoundException;
+           throw NOT_FOUND_EXCEPTION;
        }
        return entry.attributes;
     }

Modified: tomcat/trunk/java/org/apache/naming/resources/WARDirContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/WARDirContext.java?rev=966404&r1=966403&r2=966404&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/resources/WARDirContext.java (original)
+++ tomcat/trunk/java/org/apache/naming/resources/WARDirContext.java Wed Jul 21 20:30:53 2010
@@(protected);
import javax.naming.InvalidNameException;
import javax.naming.Name;
import javax.naming.NameClassPair;
+import javax.naming.NameNotFoundException;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.OperationNotSupportedException;
@@(protected)
        return new NamingContextEnumeration(list(entries).iterator());
     Entry entry = treeLookup(name);
     if (entry == null)
-        throw new NamingException
+        throw new NameNotFoundException
          (sm.getString("resources.notFound", name));
     return new NamingContextEnumeration(list(entry).iterator());
  }

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=966404&r1=966403&r2=966404&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Wed Jul 21 20:30:53 2010
@@(protected) @@
     default timeout configurable using the <code>asyncTimeout</code>
     attribute on the connector. (pero/markt)
    </fix>
+    <fix>
+     <bug>49600</bug>: Make exceptions returned by the
+     <code>ProxyDirContext</code> consistent for resources that weren't found
+     by checking the <code>DirContext</code> or the cache. Test case based on
+     a patch provided by Marc Guillemot. (markt)
+    </fix>
  </changelog>
 </subsection>
 <subsection name="Jasper">




Attachment: dev_107986.ezm (zipped)
Author: markt
Date: Wed Jul 21 20:31:30 2010
New Revision: 966405

URL: http://svn.apache.org/viewvc?rev=966405&view=rev
Log:
Test case for https://issues.apache.org/bugzilla/show_bug.cgi?id=49600
Based on a patch by Marc Guillemot

Added:
  tomcat/trunk/test/org/apache/naming/resources/TestProxyDirContext.java  (with props)

Added: tomcat/trunk/test/org/apache/naming/resources/TestProxyDirContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/naming/resources/TestProxyDirContext.java?rev=966405&view=auto
==============================================================================
--- tomcat/trunk/test/org/apache/naming/resources/TestProxyDirContext.java (added)
+++ tomcat/trunk/test/org/apache/naming/resources/TestProxyDirContext.java Wed Jul 21 20:31:30 2010
@@(protected) @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.naming.resources;
+
+import javax.naming.NameNotFoundException;
+
+import org.apache.catalina.core.StandardContext;
+import org.apache.catalina.startup.Tomcat;
+import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.naming.resources.ProxyDirContext;
+
+/**
+ * Unit test for the {@(protected)}.
+ * @author Marc Guillemot
+ * @version $Revision: $
+ */
+public class TestProxyDirContext extends TomcatBaseTest {
+
+   /**
+   * lookup doesn't always throw the same exception.
+   */
+   public void testLookupException() throws Exception {
+     Tomcat tomcat = getTomcatInstance();
+    
+     // Must have a real docBase - just use temp
+     StandardContext ctx = (StandardContext)
+        tomcat.addContext("/", System.getProperty("java.io.tmpdir"));
+     ctx.setCacheTTL(500);
+     tomcat.start();
+    
+     try {
+        ctx.getResources().lookup("/WEB-INF/web.xml");
+        fail();
+     }
+     catch (final NameNotFoundException e) {
+        // as expected
+     }
+     Thread.sleep(600); // see ProxyDirContext.cacheTTL
+     try {
+        ctx.getResources().lookup("/WEB-INF/web.xml");
+        fail();
+     }
+     catch (final NameNotFoundException e) {
+        // as expected
+     }
+   }
+}

Propchange: tomcat/trunk/test/org/apache/naming/resources/TestProxyDirContext.java
------------------------------------------------------------------------------
  svn:eol-style = native




Attachment: dev_107987.ezm (zipped)
On 21/07/2010 10:47, Remy Maucherat wrote:
> On Wed, 2010-07-21 at 11:18 +0200, Rainer Jung wrote:
>> IMHO for any serious application of async the developer will need to
>> adjust the timeout.
>
> I am responsible for the fact that setting the timeout is separate, as I
> did not understand how it was meaningful in most cases to have it be
> anything other than the usual timeout set by the connector.
>
> I am impressed with the creativity that has been displayed so far on the
> async API implementation in Tomcat 7, so I guess that arbitrary 10s
> value goes along fine with that.

I take it that this means you think there is room for simplification.
I'm still trying to get my head around the Async implementation so if
you have any pointers on how it could be simplified, they would be much
appreciated.

Mark




Attachment: dev_107989.ezm (zipped)
On Wed, 2010-07-21 at 21:36 +0100, Mark Thomas wrote:
> I take it that this means you think there is room for simplification.
> I'm still trying to get my head around the Async implementation so if
> you have any pointers on how it could be simplified, they would be much
> appreciated.

Ok, so for this particular topic, the argument I gave to the expert
group to avoid having to specify a timeout every time was that the
connector timeout was a decent default. This did convince enough people.
I don't see how putting another specific constant is a good idea here.

Rémy




Attachment: dev_107990.ezm (zipped)
https://issues.apache.org/bugzilla/show_bug.cgi?id=49631

--- Comment #1 from Matt <matt.helgren@(protected) ---
Created an attachment (id=25793)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=25793)
stack trace

This is a stack trace for the request that fails to find the jndi context
entry.

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


Attachment: dev_107991.ezm (zipped)
https://issues.apache.org/bugzilla/show_bug.cgi?id=49631

--- Comment #2 from Matt <matt.helgren@(protected) ---
Looking into this a bit more I noticed that when the JNDI lookup fails, its
calling my FileDirContext without having gone through the default servlet (see
attached stack trace).  Looks like CoyoteAdapter.postParseRequest ends up
probing for the file. I also noticed that since the file is not found it
causes the ProxyDirContext to cache that the file does not exist for a period
of time which might be causing the CoyoteAdpater to then not find the file
subsequently through the default servlet.

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


Attachment: dev_107992.ezm (zipped)
Author: kfujino
Date: Thu Jul 22 01:45:20 2010
New Revision: 966477

URL: http://svn.apache.org/viewvc?rev=966477&view=rev
Log:
vote

Modified:
  tomcat/tc6.0.x/trunk/STATUS.txt

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=966477&r1=966476&r2=966477&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Thu Jul 22 01:45:20 2010
@@(protected):
* Return a copy of the URL being used from the webapp class loader, not the
 original.
 http://svn.apache.org/viewvc?rev=966292&view=rev
- +1: markt
+ +1: markt, kfujino
 -1:




Attachment: dev_107993.ezm (zipped)
https://issues.apache.org/bugzilla/show_bug.cgi?id=49422

Kohsuke Kawaguchi <kk@(protected):

      What   |Removed              |Added
----------------------------------------------------------------------------
        Status|RESOLVED             |REOPENED
     Resolution|INVALID              |

--- Comment #4 from Kohsuke Kawaguchi <kk@(protected) ---
I'm the developer of Hudson, and I'm not sure if I agree with the conclusion.

In the servlet 3.0 spec section 10.10, one of the examples reads:

A request URI of /catalog/products/ will be passed to the "default" servlet,
if any. If no "default" servlet is mapped, the request may cause a 404 not
found, may cause a directory listing including shop.jsp and register.jsp, or
may cause other behavior defined by the container. See Section 12.2,
"Specification of Mappings" for the definition of "default" servlet.

This is with the following contents in the WAR:

/foo/index.html
/foo/default.jsp
/foo/orderform.html
/foo/home.gif
/catalog/default.jsp
/catalog/products/shop.jsp
/catalog/products/register.jsp

The "default" servlet defined in section 12.2 is the servlet with
url-pattern="/", which in our case is "Stapler".

In Hudson, we don't have /index.html nor /index.jsp. So I expect the same logic
to dispatch the request to the default servlet, instead of 404.

To put this another way, while the section 10.10 says the following, it
shouldn't be interpreted that the container can really do whatever it wants ---
otherwise it doesn't explain why the above /catalog/products/ would map to the
default servlet. It should be interpreted that the default servlet be
consulted:

If no matching welcome file is found in the manner described, the container
may
handle the request in a manner it finds suitable. For some configurations
this may
mean returning a directory listing or for others returning a 404 response.

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


Attachment: dev_107994.ezm (zipped)
https://issues.apache.org/bugzilla/show_bug.cgi?id=49422

Bill Barker <billbarker@(protected):

      What   |Removed              |Added
----------------------------------------------------------------------------
        Status|REOPENED             |RESOLVED
     Resolution|                   |INVALID

--- Comment #5 from Bill Barker <billbarker@(protected) ---
Mark is correct with his reading of the Servlet 3.0 spec. The default web.xml
includes "index.jsp" in the welcome-file list. This pattern is also mapped to
the JspServlet. As a result, Tomcat is required to pass the request to
JspServlet by the spec. The Tomcat developers have a long history of resisting
this change to the spec, but it is there now, and Tomcat has to follow it.

Other than what Mark has suggested above, another possibility is for Hudson to
include a welcome-file in their web.xml for, say, index.hds, which is suffix
mapped to their default servlet.

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


Attachment: dev_107995.ezm (zipped)
https://issues.apache.org/bugzilla/show_bug.cgi?id=49635

      Summary: org.apache.catalina.connector.RequestFacade has wrong
            implementation...
      Product: Tomcat 7
      Version: 7.0.0
      Platform: PC
       Status: NEW
      Severity: normal
      Priority: P2
     Component: Connectors
    AssignedTo: dev@(protected)
    ReportedBy: den04304@(protected)


I can't run a below code.

@WebServlet(urlPatterns={"/async"}, asyncSupported=true)
public class AsyncServlet extends HttpServlet {
  private static final long serialVersionUID = 1L;
  protected void doGet(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException {
    AsyncContext context = request.startAsync(request, response);

    context.start(new Runnable() {
       @Override
       public void run() {
          System.out.println("async!!");
       }
    });
  }
}

It occur java.lang.StackOverflowError.

java.lang.StackOverflowError
  at
org.apache.catalina.connector.RequestFacade.startAsync (RequestFacade.java:963)
  at
org.apache.catalina.connector.RequestFacade.startAsync (RequestFacade.java:963)
  at
org.apache.catalina.connector.RequestFacade.startAsync (RequestFacade.java:963)
.
.
.

So, I think that org.apache.catalina.connector.RequestFacade has wrong
implementation.I show part of source code in RequestFacade line number is 961
to 964.

public AsyncContext startAsync(ServletRequest request, ServletResponse
response)
  throws IllegalStateException {
  return request.startAsync(request, response);
}

I think it should have "this." before "request" next "return".

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


Attachment: dev_107996.ezm (zipped)
https://issues.apache.org/bugzilla/show_bug.cgi?id=49567

Mark Thomas <markt@(protected):

      What   |Removed              |Added
----------------------------------------------------------------------------
          CC|                   |den04304@(protected)

--- Comment #6 from Mark Thomas <markt@(protected) ---
*** Bug 49635 has been marked as a duplicate of this bug. ***

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


Attachment: dev_107997.ezm (zipped)
https://issues.apache.org/bugzilla/show_bug.cgi?id=49635

Mark Thomas <markt@(protected):

      What   |Removed              |Added
----------------------------------------------------------------------------
        Status|NEW                 |RESOLVED
     Resolution|                   |DUPLICATE
     OS/Version|                   |All

--- Comment #1 from Mark Thomas <markt@(protected) ---
The analysis is wrong but there is an issue. The root cause is the same as the
duplicate where a fix is currently being worked on.

*** This bug has been marked as a duplicate of bug 49567 ***

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


Attachment: dev_107999.ezm (zipped)
On 07/19/2010 06:33 PM, jean-frederic clere wrote:
> The candidates binaries are available here:
> http://people.apache.org/~jfclere/tomcat-6/v6.0.29/
>
> According to the release process, the 6.0.29 build corresponding to the
> tag TOMCAT_6_0_29 is:
> [ ] Broken
> [ ] Alpha
> [ ] Beta
> [X] Stable
>

We have >=3 +1 Binding Votes, so I will go ahead with the
release process...

Thx to all!


Attachment: dev_108000.ezm (zipped)
Author: markt
Date: Thu Jul 22 09:12:18 2010
New Revision: 966548

URL: http://svn.apache.org/viewvc?rev=966548&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49567
Better handling of calls to complete() from a separate thread.
There are still a handful of TODOs around this which will follow shortly but I'm committing this since it passes the unit tests and the Servlet TCK (with BIO)

Modified:
  tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
  tomcat/trunk/java/org/apache/catalina/connector/Request.java
  tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java
  tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java
  tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java
  tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java?rev=966548&r1=966547&r2=966548&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java Thu Jul 22 09:12:18 2010
@@(protected)
          //configure settings for timed out
          asyncConImpl.setTimeoutState();
        }
-        if (status==SocketStatus.ERROR || status==SocketStatus.STOP || status==SocketStatus.DISCONNECT) {
+        if (status==SocketStatus.ERROR || status==SocketStatus.DISCONNECT) {
          AsyncContextImpl asyncConImpl = (AsyncContextImpl)request.getAsyncContext();
          //TODO SERVLET3 - async
          //configure settings for timed out

Modified: tomcat/trunk/java/org/apache/catalina/connector/Request.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Request.java?rev=966548&r1=966547&r2=966548&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/Request.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Request.java Thu Jul 22 09:12:18 2010
@@(protected)
     }
     
     return (asyncContext.getState()==AsyncContextImpl.AsyncState.DISPATCHING ||
-           asyncContext.getState()==AsyncContextImpl.AsyncState.DISPATCHING_RUNNABLE ||
          asyncContext.getState()==AsyncContextImpl.AsyncState.TIMING_OUT ||
          asyncContext.getState()==AsyncContextImpl.AsyncState.STARTED   ||
          asyncContext.getState()==AsyncContextImpl.AsyncState.ERROR_DISPATCHING ||

Modified: tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java?rev=966548&r1=966547&r2=966548&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java Thu Jul 22 09:12:18 2010
@@(protected)
public class AsyncContextImpl implements AsyncContext {
 
  public static enum AsyncState {
-     NOT_STARTED, STARTED, DISPATCHING, DISPATCHING_RUNNABLE, DISPATCHED,
-     COMPLETING, COMPLETING_RUNNABLE, TIMING_OUT, ERROR_DISPATCHING
+     NOT_STARTED, STARTED, DISPATCHING, DISPATCHED, COMPLETING, TIMING_OUT,
+     ERROR_DISPATCHING
  }
 
  private static final Log log = LogFactory.getLog(AsyncContextImpl.class);
@@(protected)
        AtomicBoolean dispatched = new AtomicBoolean(false);
        request.getCoyoteRequest().action(ActionCode.ACTION_ASYNC_COMPLETE,dispatched);
        if (!dispatched.get()) doInternalComplete(false);
-     } else if (state.compareAndSet(AsyncState.DISPATCHING_RUNNABLE,
-           AsyncState.COMPLETING_RUNNABLE)) {
-        // do nothing
     } else {
        throw new IllegalStateException("Complete not allowed. Invalid state:"+state.get());
     }
@@(protected)
        log.debug("AsyncContext Start Called["+state.get()+"; "+request.getRequestURI()+"?"+request.getQueryString()+"]", new DebugException());
     }

-     if (state.compareAndSet(AsyncState.STARTED, AsyncState.DISPATCHING_RUNNABLE) ||
-        state.compareAndSet(AsyncState.DISPATCHED, AsyncState.DISPATCHING_RUNNABLE)) {
-        // TODO SERVLET3 - async
-        final ServletContext sctx = getServletRequest().getServletContext();
-        Runnable r = new Runnable() {
-           public void run() {
-             //TODO SERVLET3 - async - set context class loader when running the task.
-             try {
-                
-                run.run();
-             }catch (Exception x) {
-                log.error("Unable to run async task.",x);
-             }
-           }
-        };
-        this.dispatch = r;
-        AtomicBoolean dispatched = new AtomicBoolean(false);
-        request.getCoyoteRequest().action(ActionCode.ACTION_ASYNC_DISPATCH, dispatched );
-        if (!dispatched.get()) {
-           try {
-             doInternalDispatch();
-           }catch (ServletException sx) {
-             throw new RuntimeException(sx);
-           }catch (IOException ix) {
-             throw new RuntimeException(ix);
-           }
-        }
+     if (state.get() == AsyncState.STARTED) {
+        // TODO SERVLET3 - async - set context class loader when running the
+        // task.
+        // final ServletContext sctx = getServletRequest().getServletContext();
+        // TODO - Use a container thread without creating a memory leak
+        // Execute the runnable using a container thread from the
+        // Connector's thread pool
+        // request.getConnector().getProtocolHandler().getExecutor().execute(run);
+        Thread t = new Thread(run);
+        t.start();
     } else {
        throw new IllegalStateException("Dispatch not allowed. Invalid state:"+state.get());
     }
@@(protected)

  public boolean isStarted() {
     return (state.get() == AsyncState.STARTED ||
-           state.get() == AsyncState.DISPATCHING ||
-           state.get() == AsyncState.DISPATCHING_RUNNABLE);
+           state.get() == AsyncState.DISPATCHING);
  }

  public void setStarted(Context context) {
@@(protected)
          listener.fireOnTimeout(event);
          listenerInvoked = true;
        }
-        if (!listenerInvoked) {
-           ((HttpServletResponse)servletResponse).setStatus(500);
+        if (listenerInvoked) {
+           // Listener should have called complete
+           if (state.get() != AsyncState.NOT_STARTED) {
+             ((HttpServletResponse)servletResponse).setStatus(500);
+             doInternalComplete(true);
+           }
+        } else {
+           // No listeners, container calls complete
+           doInternalComplete(false);
        }
-        doInternalComplete(true);
     } else if (this.state.compareAndSet(AsyncState.ERROR_DISPATCHING, AsyncState.COMPLETING)) {
        log.debug("ON ERROR!");
        boolean listenerInvoked = false;
@@(protected)
             dispatch = null;
          }
        }
-     } else if (this.state.get() == AsyncState.DISPATCHING_RUNNABLE) {
-        if (this.dispatch!=null) {
-           try {
-             dispatch.run();
-           } catch (RuntimeException x) {
-             doInternalComplete(true);
-             if (x.getCause() instanceof ServletException) throw (ServletException)x.getCause();
-             if (x.getCause() instanceof IOException) throw (IOException)x.getCause();
-             else throw new ServletException(x);
-           } finally {
-             dispatch = null;
-           }
-           if (this.state.compareAndSet(AsyncState.COMPLETING_RUNNABLE,
-                AsyncState.COMPLETING)) {
-             doInternalComplete(false);
-           } else if (this.state.get() == AsyncState.DISPATCHING_RUNNABLE) {
-             doInternalComplete(true);
-             throw new IllegalStateException(
-                   "Failed to call dispatch() or complete() after start()");
-           }
-        }
     } else if (this.state.get()==AsyncState.COMPLETING) {
        doInternalComplete(false);
     } else {

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java?rev=966548&r1=966547&r2=966548&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java Thu Jul 22 09:12:18 2010
@@(protected)
     } else if (async) {
        return SocketState.LONG;
     } else {
+        recycle();
        if (!keepAlive) {
-           recycle();
          return SocketState.CLOSED;
        } else {
          return SocketState.OPEN;

Modified: tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java?rev=966548&r1=966547&r2=966548&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java (original)
+++ tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java Thu Jul 22 09:12:18 2010
@@(protected);

import java.io.IOException;

+import javax.servlet.AsyncContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@@(protected);
import org.apache.catalina.Wrapper;
import org.apache.catalina.startup.Tomcat;
import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.tomcat.util.buf.ByteChunk;

public class TestAsyncContextImpl extends TomcatBaseTest {

@@(protected)
     tomcat.start();
     
     // Call the servlet once
-     getUrl("http://localhost:" + getPort() + "/");
+     ByteChunk bc = getUrl("http://localhost:" + getPort() + "/");
+     assertEquals("OK", bc.toString());
+
+
+     assertEquals("1false2true3true4true5false", servlet.getResult());
+   }
+  
+   public void testBug49567() throws Exception {
+     // Setup Tomcat instance
+     Tomcat tomcat = getTomcatInstance();
+    
+     // Must have a real docBase - just use temp
+     Context ctx =
+        tomcat.addContext("/", System.getProperty("java.io.tmpdir"));
+
+     Bug49567Servlet servlet = new Bug49567Servlet();
+    
+     Wrapper wrapper = Tomcat.addServlet(ctx, "servlet", servlet);
+     wrapper.setAsyncSupported(true);
+     ctx.addServletMapping("/", "servlet");
+    
+     tomcat.start();
+    
+     // Call the servlet once
+     ByteChunk bc = getUrl("http://localhost:" + getPort() + "/");
+     assertEquals("OK", bc.toString());

     assertEquals("1false2true3true4true5false", servlet.getResult());
  }
 
+   public void testAsyncStartNoComplete() throws Exception {
+     // Setup Tomcat instance
+     Tomcat tomcat = getTomcatInstance();
+    
+     // Minimise pauses during test
+     tomcat.getConnector().setAttribute(
+           "connectionTimeout", Integer.valueOf(3000));
+    
+     // Must have a real docBase - just use temp
+     Context ctx =
+        tomcat.addContext("/", System.getProperty("java.io.tmpdir"));
+
+     AsyncStartNoCompleteServlet servlet =
+        new AsyncStartNoCompleteServlet();
+    
+     Wrapper wrapper = Tomcat.addServlet(ctx, "servlet", servlet);
+     wrapper.setAsyncSupported(true);
+     ctx.addServletMapping("/", "servlet");
+    
+     tomcat.start();
+    
+     // Call the servlet the first time
+     ByteChunk bc1 = getUrl("http://localhost:" + getPort() +
+           "/?echo=run1");
+     assertEquals("OK-run1", bc1.toString());
+
+     // Call the servlet the second time with a request parameter
+     ByteChunk bc2 = getUrl("http://localhost:" + getPort() +
+           "/?echo=run2");
+     assertEquals("OK-run2", bc2.toString());
+   }
+  
+   public void testAsyncStartWithComplete() throws Exception {
+     // Setup Tomcat instance
+     Tomcat tomcat = getTomcatInstance();
+    
+     // Must have a real docBase - just use temp
+     Context ctx =
+        tomcat.addContext("/", System.getProperty("java.io.tmpdir"));
+
+     AsyncStartWithCompleteServlet servlet =
+        new AsyncStartWithCompleteServlet();
+    
+     Wrapper wrapper = Tomcat.addServlet(ctx, "servlet", servlet);
+     wrapper.setAsyncSupported(true);
+     ctx.addServletMapping("/", "servlet");
+    
+     tomcat.start();
+    
+     // Call the servlet once
+     ByteChunk bc = getUrl("http://localhost:" + getPort() + "/");
+     assertEquals("OK", bc.toString());
+   }
+  
  private static class Bug49528Servlet extends HttpServlet {

     private static final long serialVersionUID = 1L;
@@(protected)
                Thread.sleep(1000);
                result.append('4');
                result.append(req.isAsyncStarted());
+                resp.setContentType("text/plain");
+                resp.getWriter().print("OK");
                req.getAsyncContext().complete();
                result.append('5');
                result.append(req.isAsyncStarted());
             } catch (InterruptedException e) {
-                // TODO Auto-generated catch block
-                e.printStackTrace();
+                result.append(e);
+             } catch (IOException e) {
+                result.append(e);
             }
          }
        });
@@(protected)
        req.getMethod();
     }
  }
+
+   private static class Bug49567Servlet extends HttpServlet {
+
+     private static final long serialVersionUID = 1L;
+    
+     private StringBuilder result = new StringBuilder();
+    
+     public String getResult() {
+        return result.toString();
+     }
+
+     @Override
+     protected void doGet(final HttpServletRequest req,
+           final HttpServletResponse resp)
+           throws ServletException, IOException {
+        
+        result.append('1');
+        result.append(req.isAsyncStarted());
+        req.startAsync();
+        result.append('2');
+        result.append(req.isAsyncStarted());
+        
+        req.getAsyncContext().start(new Runnable() {
+           @Override
+           public void run() {
+             Thread t = new Thread(new Runnable() {
+                @Override
+                public void run() {
+                   try {
+                     result.append('3');
+                     result.append(req.isAsyncStarted());
+                     Thread.sleep(1000);
+                     result.append('4');
+                     result.append(req.isAsyncStarted());
+                     resp.setContentType("text/plain");
+                     resp.getWriter().print("OK");
+                     req.getAsyncContext().complete();
+                     result.append('5');
+                     result.append(req.isAsyncStarted());
+                   } catch (InterruptedException e) {
+                     result.append(e);
+                   } catch (IOException e) {
+                     result.append(e);
+                   }
+                }
+             });
+             t.start();
+           }
+        });
+        // Pointless method call so there is somewhere to put a break point
+        // when debugging
+        req.getMethod();
+     }
+   }
+  
+   private static class AsyncStartNoCompleteServlet extends HttpServlet {
+
+     private static final long serialVersionUID = 1L;
+    
+     @Override
+     protected void doGet(final HttpServletRequest req,
+           final HttpServletResponse resp)
+           throws ServletException, IOException {
+        
+        String echo = req.getParameter("echo");
+        AsyncContext actxt = req.startAsync();
+        resp.setContentType("text/plain");
+        resp.getWriter().print("OK");
+        if (echo != null) {
+           resp.getWriter().print("-" + echo);
+        }
+        // Speed up the test by reducing the timeout
+        actxt.setTimeout(1000);
+     }
+   }
+
+   private static class AsyncStartWithCompleteServlet extends HttpServlet {
+
+     private static final long serialVersionUID = 1L;
+    
+     @Override
+     protected void doGet(final HttpServletRequest req,
+           final HttpServletResponse resp)
+           throws ServletException, IOException {
+        
+        AsyncContext actxt = req.startAsync();
+        resp.setContentType("text/plain");
+        resp.getWriter().print("OK");
+        actxt.complete();
+     }
+   }
+
}

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=966548&r1=966547&r2=966548&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Thu Jul 22 09:12:18 2010
@@(protected) @@
     rather than an empty string. (markt)
    </fix>
    <fix>
-     <bug>49528</bug>: Ensure AsyncContext.isAsyncStarted() returns the
-     correct value after AsyncContext.start(). Tomcat implements this
-     using an internal dispatch that requires slightly different treatment
-     from a standard dispatch to ensure the correct value is returned.
-     (markt)
+     <bug>49528</bug>, <bug>49567</bug>: Ensure that
+     <code>AsyncContext.isAsyncStarted()</code> returns the correct value
+     after <code>AsyncContext.start()</code> and that if
+     <code>AsyncContext.complete()</code> is called on a separate thread that
+     it is handled correctly. (markt)
    </fix>
    <fix>
     <bug>49530</bug>: Contexts and Servlets not stopped when Tomcat is shut



©2008 junlu.com - Jax Systems, LLC, U.S.A.