DO NOT REPLY [Bug 47505] Http Session Null issue
https://issues.apache.org/bugzilla/show_bug.cgi?id=47505 Konstantin Kolinko changed: What|Removed |Added Status|NEW |RESOLVED Resolution||INVALID --- Comment #3 from Konstantin Kolinko 2009-07-10 00:18:07 PST --- Already asked AND answered on users@ http://markmail.org/message/pv3qdg2xjhtqok3p You absolutely cannot access an (Http)ServletRequest object instance once the request processing has been completed. That is not allowed. -- 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-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 47505] Http Session Null issue
https://issues.apache.org/bugzilla/show_bug.cgi?id=47505 --- Comment #4 from gkiran1...@gmail.com 2009-07-10 02:22:21 PST --- Then why it is working fine weblogic. -- 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-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 47505] Http Session Null issue
https://issues.apache.org/bugzilla/show_bug.cgi?id=47505 --- Comment #5 from gkiran1...@gmail.com 2009-07-10 02:23:02 PST --- Then why it is working fine in weblogic. -- 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-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 47505] Http Session Null issue
https://issues.apache.org/bugzilla/show_bug.cgi?id=47505 --- Comment #6 from Mark Thomas 2009-07-10 02:51:53 PST --- You got lucky. If you do something outside of the specs and it happens to work with one container, there is no guarantee it will work with any other container. -- 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-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r792862 - /tomcat/trunk/java/org/apache/catalina/core/StandardWrapper.java
Author: markt Date: Fri Jul 10 10:10:18 2009 New Revision: 792862 URL: http://svn.apache.org/viewvc?rev=792862&view=rev Log: Needs to be volatile as it is used in double checked locking Modified: tomcat/trunk/java/org/apache/catalina/core/StandardWrapper.java Modified: tomcat/trunk/java/org/apache/catalina/core/StandardWrapper.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardWrapper.java?rev=792862&r1=792861&r2=792862&view=diff == --- tomcat/trunk/java/org/apache/catalina/core/StandardWrapper.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/StandardWrapper.java Fri Jul 10 10:10:18 2009 @@ -135,7 +135,7 @@ /** * The (single) initialized instance of this servlet. */ -protected Servlet instance = null; +protected volatile Servlet instance = null; /** - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r792863 - /tomcat/trunk/java/org/apache/catalina/connector/RequestFacade.java
Author: markt Date: Fri Jul 10 10:13:11 2009 New Revision: 792863 URL: http://svn.apache.org/viewvc?rev=792863&view=rev Log: Fix infinite loop. Spotted by GSOC student Xie Xiaodong. Modified: tomcat/trunk/java/org/apache/catalina/connector/RequestFacade.java Modified: tomcat/trunk/java/org/apache/catalina/connector/RequestFacade.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/RequestFacade.java?rev=792863&r1=792862&r2=792863&view=diff == --- tomcat/trunk/java/org/apache/catalina/connector/RequestFacade.java (original) +++ tomcat/trunk/java/org/apache/catalina/connector/RequestFacade.java Fri Jul 10 10:13:11 2009 @@ -1004,7 +1004,7 @@ public void login(String username, String password) throws ServletException { -login(username, password); +request.login(username, password); } public void logout() throws ServletException { - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r792871 - in /tomcat: container/tc5.5.x/webapps/docs/ jasper/tc5.5.x/src/share/org/apache/jasper/compiler/
Author: markt Date: Fri Jul 10 10:29:40 2009 New Revision: 792871 URL: http://svn.apache.org/viewvc?rev=792871&view=rev Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=37084 Port of fix for 46471 that also fixes this JspC compilation issue Modified: tomcat/container/tc5.5.x/webapps/docs/changelog.xml tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/compiler/ImplicitTagLibraryInfo.java tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/compiler/JspUtil.java tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/compiler/ParserController.java tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/compiler/TagFileProcessor.java tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java Modified: tomcat/container/tc5.5.x/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/webapps/docs/changelog.xml?rev=792871&r1=792870&r2=792871&view=diff == --- tomcat/container/tc5.5.x/webapps/docs/changelog.xml (original) +++ tomcat/container/tc5.5.x/webapps/docs/changelog.xml Fri Jul 10 10:29:40 2009 @@ -221,6 +221,10 @@ 36923: Parse deactivated EL expressions correctly. (markt) +37084: Fix JspC compilation with Ant when compiling JSPs that +use a custom taglib. (markt/kkolinko) + + 37515: Add options for Java 1.6 and 1.7 to the JDT compiler. (markt) Modified: tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/compiler/ImplicitTagLibraryInfo.java URL: http://svn.apache.org/viewvc/tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/compiler/ImplicitTagLibraryInfo.java?rev=792871&r1=792870&r2=792871&view=diff == --- tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/compiler/ImplicitTagLibraryInfo.java (original) +++ tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/compiler/ImplicitTagLibraryInfo.java Fri Jul 10 10:29:40 2009 @@ -17,6 +17,7 @@ package org.apache.jasper.compiler; +import java.net.URL; import java.util.*; import javax.servlet.jsp.tagext.FunctionInfo; import javax.servlet.jsp.tagext.TagLibraryInfo; @@ -123,9 +124,11 @@ TagInfo tagInfo = null; try { tagInfo = TagFileProcessor.parseTagFileDirectives(pc, - shortName, - path, - this); +shortName, +path, +(URL) pc.getJspCompilationContext().getTagFileJarUrls( +).get(path), +this); } catch (JasperException je) { throw new RuntimeException(je.toString()); } Modified: tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/compiler/JspUtil.java URL: http://svn.apache.org/viewvc/tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/compiler/JspUtil.java?rev=792871&r1=792870&r2=792871&view=diff == --- tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/compiler/JspUtil.java (original) +++ tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/compiler/JspUtil.java Fri Jul 10 10:29:40 2009 @@ -851,10 +851,31 @@ * * @return Fully-qualified class name of the tag handler corresponding to * the given tag file path + * + * @deprecated Use {...@link #getTagHandlerClassName(String, String, + * ErrorDispatcher) + * See https://issues.apache.org/bugzilla/show_bug.cgi?id=46471 */ public static String getTagHandlerClassName(String path, ErrorDispatcher err) throws JasperException { +return getTagHandlerClassName(path, null, err); +} + +/** + * Gets the fully-qualified class name of the tag handler corresponding to + * the given tag file path. + * + * @param path + *Tag file path + * @param err + *Error dispatcher + * + * @return Fully-qualified class name of the tag handler corresponding to + * the given tag file path + */ +public static String getTagHandlerClassName(String path, String urn, +ErrorDispatcher err) throws JasperException { String className = null; int begin = 0; @@ -880,20 +901,29 @@ className = "org.apache.jsp.tag.web."; begin = index + WEB_INF_TAGS.length(); } else { - index = path.indexOf(META_INF_TAGS); - if (index != -1) { - className = "org.apache.jsp.tag.meta."; - begin = index + META_INF_TAGS.length(); - } else
DO NOT REPLY [Bug 37084] JspC from ant fails on JSPs that use custom taglib
https://issues.apache.org/bugzilla/show_bug.cgi?id=37084 Mark Thomas changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED --- Comment #17 from Mark Thomas 2009-07-10 03:30:20 PST --- This has been fixed in 5.5.x and will be included in 5.5.28 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. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r792872 - in /tomcat/container/tc5.5.x: modules/cluster/src/share/org/apache/catalina/cluster/tcp/mbeans-descriptors.xml webapps/docs/changelog.xml
Author: markt Date: Fri Jul 10 10:32:14 2009 New Revision: 792872 URL: http://svn.apache.org/viewvc?rev=792872&view=rev Log: NEEDINFO - bug 39997: JSVC and APR do not work together for HTTPS connector https://issues.apache.org/bugzilla/show_bug.cgi?id=39997 Modified: tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/tcp/mbeans-descriptors.xml tomcat/container/tc5.5.x/webapps/docs/changelog.xml Modified: tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/tcp/mbeans-descriptors.xml URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/tcp/mbeans-descriptors.xml?rev=792872&r1=792871&r2=792872&view=diff == --- tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/tcp/mbeans-descriptors.xml (original) +++ tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/tcp/mbeans-descriptors.xml Fri Jul 10 10:32:14 2009 @@ -1236,6 +1236,10 @@ domain="Catalina" group="Valve" type="org.apache.catalina.cluster.tcp.ReplicationValve"> + http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/webapps/docs/changelog.xml?rev=792872&r1=792871&r2=792872&view=diff == --- tomcat/container/tc5.5.x/webapps/docs/changelog.xml (original) +++ tomcat/container/tc5.5.x/webapps/docs/changelog.xml Fri Jul 10 10:32:14 2009 @@ -317,6 +317,10 @@ 36574: Fix broken PDFs. (markt) +39603: Admin app only showed ROOT web application when +clustering was enabled. (markt) + + 47032: Fix /status/all in Manager webapp when using the PersistentManager. (markt) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 39603] admin application does not display contexts under host when in a Tomcat cluster
https://issues.apache.org/bugzilla/show_bug.cgi?id=39603 Mark Thomas changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED --- Comment #5 from Mark Thomas 2009-07-10 03:32:47 PST --- This has been fixed in 5.5.x and will be included in 5.5.28 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. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r792874 - /tomcat/current/tc5.5.x/STATUS.txt
Author: markt Date: Fri Jul 10 10:34:01 2009 New Revision: 792874 URL: http://svn.apache.org/viewvc?rev=792874&view=rev Log: Remove applied fixes Modified: tomcat/current/tc5.5.x/STATUS.txt Modified: tomcat/current/tc5.5.x/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/current/tc5.5.x/STATUS.txt?rev=792874&r1=792873&r2=792874&view=diff == --- tomcat/current/tc5.5.x/STATUS.txt (original) +++ tomcat/current/tc5.5.x/STATUS.txt Fri Jul 10 10:34:01 2009 @@ -25,12 +25,6 @@ PATCHES PROPOSED TO BACKPORT: [ New proposals should be added at the end of the list ] -* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=37084 - https://issues.apache.org/bugzilla/attachment.cgi?id=23861 - Port of fix for 46471 that also fixes this JspC compilation issue - +1: markt, kkolinko, fhanik - -1: - * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=38743 Warn if the user tries to set an invalid property. Port of http://svn.apache.org/viewvc?view=rev&revision=565464 @@ -87,12 +81,6 @@ +1: markt, fhanik -1: -* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=39603 - Admin app fails when used in a cluster - https://issues.apache.org/bugzilla/attachment.cgi?id=23950 - +1: markt, fhanik, kkolinko - -1: - * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=39637 AJP connectors do not handle certificate chains Patch by Patrik Schnellmann - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: svn commit: r792872 - in /tomcat/container/tc5.5.x: modules/cluster/src/share/org/apache/catalina/cluster/tcp/mbeans-descriptors.xml webapps/docs/changelog.xml
Konstantin Kolinko wrote: > 2009/7/10 : >> Author: markt >> Date: Fri Jul 10 10:32:14 2009 >> New Revision: 792872 >> >> URL: http://svn.apache.org/viewvc?rev=792872&view=rev >> Log: >> NEEDINFO - bug 39997: JSVC and APR do not work together for HTTPS connector >> https://issues.apache.org/bugzilla/show_bug.cgi?id=39997 >> >> Modified: >> >> tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/tcp/mbeans-descriptors.xml >>tomcat/container/tc5.5.x/webapps/docs/changelog.xml >> >> (...) >> >> +39603: Admin app only showed ROOT web application when >> +clustering was enabled. (markt) >> + >> + > > The svn:log message of this commit does not make sense for me. I > suppose it is a copy-paste error. Yeah Subclipse put its own message in. Thought I replaced it. Obviously not. I'll fix the log message. Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: svn commit: r792872 - in /tomcat/container/tc5.5.x: modules/cluster/src/share/org/apache/catalina/cluster/tcp/mbeans-descriptors.xml webapps/docs/changelog.xml
2009/7/10 : > Author: markt > Date: Fri Jul 10 10:32:14 2009 > New Revision: 792872 > > URL: http://svn.apache.org/viewvc?rev=792872&view=rev > Log: > NEEDINFO - bug 39997: JSVC and APR do not work together for HTTPS connector > https://issues.apache.org/bugzilla/show_bug.cgi?id=39997 > > Modified: > > tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/tcp/mbeans-descriptors.xml > tomcat/container/tc5.5.x/webapps/docs/changelog.xml > > (...) > > + 39603: Admin app only showed ROOT web application when > + clustering was enabled. (markt) > + > + The svn:log message of this commit does not make sense for me. I suppose it is a copy-paste error. Best regards, Konstantin Kolinko - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn propchange: r792872 - svn:log
Author: markt Revision: 792872 Modified property: svn:log Modified: svn:log at Fri Jul 10 11:57:09 2009 -- --- svn:log (original) +++ svn:log Fri Jul 10 11:57:09 2009 @@ -1,2 +1,2 @@ -NEEDINFO - bug 39997: JSVC and APR do not work together for HTTPS connector -https://issues.apache.org/bugzilla/show_bug.cgi?id=39997 +Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=39603 +Admin app fails when used in a cluster - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r792945 - /tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java
Author: markt Date: Fri Jul 10 13:27:01 2009 New Revision: 792945 URL: http://svn.apache.org/viewvc?rev=792945&view=rev Log: Servlet DTD and JSP spec are both quite clear that a is a resource relative to the root of the web application Modified: tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java Modified: tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java?rev=792945&r1=792944&r2=792945&view=diff == --- tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java (original) +++ tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java Fri Jul 10 13:27:01 2009 @@ -507,11 +507,6 @@ String taglibs[] = context.findTaglibs(); for (int i = 0; i < taglibs.length; i++) { String resourcePath = context.findTaglib(taglibs[i]); -// FIXME - Servlet 2.4 DTD implies that the location MUST be -// a context-relative path starting with '/'? -if (!resourcePath.startsWith("/")) { -resourcePath = "/WEB-INF/" + resourcePath; -} if (log.isTraceEnabled()) { log.trace(" Adding path '" + resourcePath + "' for URI '" + taglibs[i] + "'"); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r792954 - in /tomcat/trunk/java/org/apache: catalina/startup/TldConfig.java jasper/compiler/TldLocationsCache.java
Author: markt Date: Fri Jul 10 13:52:14 2009 New Revision: 792954 URL: http://svn.apache.org/viewvc?rev=792954&view=rev Log: Add new jar to TLD exclusion list Modified: tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java tomcat/trunk/java/org/apache/jasper/compiler/TldLocationsCache.java Modified: tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java?rev=792954&r1=792953&r2=792954&view=diff == --- tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java (original) +++ tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java Fri Jul 10 13:52:14 2009 @@ -103,6 +103,7 @@ noTldJars.add("jasper-jdt.jar"); noTldJars.add("jsp-api.jar"); noTldJars.add("servlet-api.jar"); +noTldJars.add("tomcat-api.jar"); noTldJars.add("tomcat-coyote.jar"); noTldJars.add("tomcat-dbcp.jar"); // i18n JARs Modified: tomcat/trunk/java/org/apache/jasper/compiler/TldLocationsCache.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/TldLocationsCache.java?rev=792954&r1=792953&r2=792954&view=diff == --- tomcat/trunk/java/org/apache/jasper/compiler/TldLocationsCache.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/TldLocationsCache.java Fri Jul 10 13:52:14 2009 @@ -131,6 +131,7 @@ noTldJars.add("jasper-jdt.jar"); noTldJars.add("jsp-api.jar"); noTldJars.add("servlet-api.jar"); +noTldJars.add("tomcat-api.jar"); noTldJars.add("tomcat-coyote.jar"); noTldJars.add("tomcat-dbcp.jar"); // i18n JARs - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r792969 - in /tomcat/trunk/modules/jdbc-pool: build.xml doc/jdbc-pool.xml
Author: fhanik Date: Fri Jul 10 15:03:43 2009 New Revision: 792969 URL: http://svn.apache.org/viewvc?rev=792969&view=rev Log: Add manifest to binary JAR Fix XML error in doc Modified: tomcat/trunk/modules/jdbc-pool/build.xml tomcat/trunk/modules/jdbc-pool/doc/jdbc-pool.xml Modified: tomcat/trunk/modules/jdbc-pool/build.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/build.xml?rev=792969&r1=792968&r2=792969&view=diff == --- tomcat/trunk/modules/jdbc-pool/build.xml (original) +++ tomcat/trunk/modules/jdbc-pool/build.xml Fri Jul 10 15:03:43 2009 @@ -77,9 +77,11 @@ + + @@ -107,7 +109,7 @@ - + Modified: tomcat/trunk/modules/jdbc-pool/doc/jdbc-pool.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/doc/jdbc-pool.xml?rev=792969&r1=792968&r2=792969&view=diff == --- tomcat/trunk/modules/jdbc-pool/doc/jdbc-pool.xml (original) +++ tomcat/trunk/modules/jdbc-pool/doc/jdbc-pool.xml Fri Jul 10 15:03:43 2009 @@ -693,7 +693,7 @@ We build the JDBC pool code with 1.6, but it is backwards compatible down to 1.5 for runtime environment. For unit test, we use 1.6 and higher Other examples of Tomcat configuration for JDBC usage can be found http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html";>in the Tomcat documentation. -Building is pretty simple. The pool has a dependency on tomcat-juli.jar and in case you want the SlowQueryReportJmx +Building is pretty simple. The pool has a dependency on tomcat-juli.jar and in case you want the SlowQueryReportJmx javac -classpath tomcat-juli.jar \ -d . \ - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 47507] New: tomcat-users.xml is rewritten and made world-readable on startup (!)
https://issues.apache.org/bugzilla/show_bug.cgi?id=47507 Summary: tomcat-users.xml is rewritten and made world-readable on startup (!) Product: Tomcat 5 Version: 5.5.23 Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: Catalina AssignedTo: dev@tomcat.apache.org ReportedBy: tutu...@gmail.com The file tomcat-users.xml, which may/does contain password information, is made world-readable on startup, perhaps as a side effect of being rewritten. The rewriting itself seems like a bug (why is this being done?), but chmod'ing the file to be world-readable is a serious security problem. -- 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-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r792996 - /tomcat/trunk/java/org/apache/catalina/startup/WebRuleSet.java
Author: markt Date: Fri Jul 10 15:53:59 2009 New Revision: 792996 URL: http://svn.apache.org/viewvc?rev=792996&view=rev Log: Correct location of taglib element varies with spec version. WebRuleSet was using 2.3 and earlier location. Update it to a) support 2.4 and later as well as 2.3 and earlier b) complain if taglib definition location is not consistent with declared spec version. Modified: tomcat/trunk/java/org/apache/catalina/startup/WebRuleSet.java Modified: tomcat/trunk/java/org/apache/catalina/startup/WebRuleSet.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/WebRuleSet.java?rev=792996&r1=792995&r2=792996&view=diff == --- tomcat/trunk/java/org/apache/catalina/startup/WebRuleSet.java (original) +++ tomcat/trunk/java/org/apache/catalina/startup/WebRuleSet.java Fri Jul 10 15:53:59 2009 @@ -301,11 +301,20 @@ new Class[] { Integer.TYPE }); digester.addCallParam(prefix + "web-app/session-config/session-timeout", 0); +// Taglibs pre Servlet 2.4 +digester.addRule(prefix + "web-app/taglib", new TaglibLocationRule(false)); digester.addCallMethod(prefix + "web-app/taglib", "addTaglib", 2); digester.addCallParam(prefix + "web-app/taglib/taglib-location", 1); digester.addCallParam(prefix + "web-app/taglib/taglib-uri", 0); +// Taglibs Servlet 2.4 onwards +digester.addRule(prefix + "web-app/jsp-config/taglib", new TaglibLocationRule(true)); +digester.addCallMethod(prefix + "web-app/jsp-config/taglib", +"addTaglib", 2); +digester.addCallParam(prefix + "web-app/jsp-config/taglib/taglib-location", 1); +digester.addCallParam(prefix + "web-app/jsp-config/taglib/taglib-uri", 0); + digester.addCallMethod(prefix + "web-app/welcome-file-list/welcome-file", "addWelcomeFile", 0); @@ -925,5 +934,32 @@ contextService.setServiceqnameLocalpart(localpart); contextService.setServiceqnameNamespaceURI(namespaceuri); } + } +/** + * A rule that checks if the taglib element is in the right place. + */ +final class TaglibLocationRule extends Rule { + +final boolean isServlet24OrLater; + +public TaglibLocationRule(boolean isServlet24OrLater) { +this.isServlet24OrLater = isServlet24OrLater; +} + +@Override +public void begin(String namespace, String name, Attributes attributes) +throws Exception { +Context context = (Context) digester.peek(digester.getCount() - 1); +// If we have a public ID, this is not a 2.4 or later webapp +boolean havePublicId = (context.getPublicId() != null); +// havePublicId and isServlet24OrLater should be mutually exclusive +if (havePublicId == isServlet24OrLater) { +throw new IllegalArgumentException( +"taglib definition not consistent with specification version"); +} +} + + +} \ No newline at end of file - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 47507] tomcat-users.xml is rewritten and made world-readable on startup (!)
https://issues.apache.org/bugzilla/show_bug.cgi?id=47507 Mark Thomas changed: What|Removed |Added Status|NEW |RESOLVED Resolution||INVALID --- Comment #1 from Mark Thomas 2009-07-10 08:59:17 PST --- Use the readonly option and/or fix the umask for the user running Tomcat. Further help and advice is available from the Tomcat users list. -- 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-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r793002 - in /tomcat/trunk/modules/jdbc-pool: doc/ java/org/apache/tomcat/jdbc/pool/ java/org/apache/tomcat/jdbc/pool/jmx/
Author: fhanik Date: Fri Jul 10 16:02:57 2009 New Revision: 793002 URL: http://svn.apache.org/viewvc?rev=793002&view=rev Log: Add documentation and clarification around JMX Modified: tomcat/trunk/modules/jdbc-pool/doc/jdbc-pool.xml tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSource.java tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/jmx/ConnectionPool.java tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/jmx/ConnectionPoolMBean.java Modified: tomcat/trunk/modules/jdbc-pool/doc/jdbc-pool.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/doc/jdbc-pool.xml?rev=793002&r1=793001&r2=793002&view=diff == --- tomcat/trunk/modules/jdbc-pool/doc/jdbc-pool.xml (original) +++ tomcat/trunk/modules/jdbc-pool/doc/jdbc-pool.xml Fri Jul 10 16:02:57 2009 @@ -120,6 +120,19 @@ pool as a JNDI resource, are used to configure a data source as a bean. + + + The connection pool object exposes an MBean that can be registered. + In order for the connection pool object to create the MBean, the flag jmxEnabled has to be set to true. + This doesn't imply that the pool will be registered with an MBean server, merely that the MBean is created. + In a container like Tomcat, Tomcat itself registers the DataSource with the MBean server, the + org.apache.tomcat.jdbc.pool.DataSource object will then register the actual + connection pool MBean. + If you're running outside of a container, you can register the DataSource yourself under any object name you specify, + and it propagates the registration to the underlying pool. + + + To provide a very simple switch to and from commons-dbcp and tomcat-jdbc-pool, Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java?rev=793002&r1=793001&r2=793002&view=diff == --- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java (original) +++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java Fri Jul 10 16:02:57 2009 @@ -43,6 +43,10 @@ import org.apache.juli.logging.LogFactory; /** + * Implementation of simple connection pool. + * The ConnectionPool uses a {...@link PoolProperties} object for storing all the meta information about the connection pool. + * As the underlying implementation, the connection pool uses {...@link java.util.concurrent.BlockingQueue} to store active and idle connections. + * A custom implementation of a fair {...@link FairBlockingQueue} blocking queue is provided with the connection pool itself. * @author Filip Hanik * @version 1.0 */ @@ -139,6 +143,7 @@ * @throws SQLException */ public Future getConnectionAsync() throws SQLException { +//we can only retrieve a future if the underlying queue supports it. if (idle instanceof FairBlockingQueue) { Future pcf = ((FairBlockingQueue)idle).pollAsync(); return new ConnectionFuture(pcf); @@ -148,9 +153,11 @@ } /** - * Borrows a connection from the pool + * Borrows a connection from the pool. If a connection is available (in the idle queue) or the pool has not reached + * {...@link PoolProperties#maxActive maxActive} connections a connection is returned immediately. + * If no connection is available, the pool will attempt to fetch a connection for {...@link PoolProperties#maxWait maxWait} milliseconds. * @return Connection - a java.sql.Connection/javax.sql.PooledConnection reflection proxy, wrapping the underlying object. - * @throws SQLException + * @throws SQLException - if the wait times out or a failure occurs creating a connection */ public Connection getConnection() throws SQLException { //check out a connection @@ -161,7 +168,7 @@ /** * Returns the name of this pool - * @return String + * @return String - the name of the pool */ public String getName() { return getPoolProperties().getPoolName(); @@ -178,6 +185,7 @@ /** * Returns the pool properties associated with this connection pool * @return PoolProperties + * */ public PoolProperties getPoolProperties() { return this.poolProperties; @@ -185,7 +193,7 @@ /** * Returns the total size of this pool, this includes both busy and idle connections - * @return int + * @return int - number of established connections to the database */ public int getSize() { return size.get(); @@ -193,7 +
DO NOT REPLY [Bug 47507] tomcat-users.xml is rewritten and made world-readable on startup (!)
https://issues.apache.org/bugzilla/show_bug.cgi?id=47507 tutu...@gmail.com changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|INVALID | --- Comment #2 from tutu...@gmail.com 2009-07-10 09:25:01 PST --- Thank you for the quick response. The 'readonly' option seems to solve my problem. It would be handy to have it mentioned on this page: http://tomcat.apache.org/tomcat-5.5-doc/realm-howto.html With respect to the umask suggestion, this seems inadequate. If tomcat really wants to rewrite this file, it should be rewritten with permissions no looser than the original permissions. I'd call this a serious security 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. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r793017 - in /tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool: ConnectionPool.java PooledConnection.java
Author: fhanik Date: Fri Jul 10 16:25:14 2009 New Revision: 793017 URL: http://svn.apache.org/viewvc?rev=793017&view=rev Log: Added some comments and more thread safety around the size of the pool Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PooledConnection.java Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java?rev=793017&r1=793016&r2=793017&view=diff == --- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java (original) +++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java Fri Jul 10 16:25:14 2009 @@ -450,7 +450,7 @@ //=== -// CONNECTION POOLING IMPL +// CONNECTION POOLING IMPL LOGIC //=== /** @@ -471,6 +471,7 @@ if (jmxPool!=null) { jmxPool.notify(org.apache.tomcat.jdbc.pool.jmx.ConnectionPool.NOTIFY_ABANDON, trace); } +//release the connection release(con); //we've asynchronously reduced the number of connections //we could have threads stuck in idle.poll(timeout) that will never be notified @@ -490,10 +491,10 @@ try { con.lock(); if (con.release()) { +//counter only decremented once size.addAndGet(-1); } } finally { - con.unlock(); } } @@ -518,9 +519,9 @@ while (true) { if (con!=null) { +//configure the connection and return it PooledConnection result = borrowConnection(now, con); -//validation might have failed, in which case null is returned -//should not happen anymore +//null should never be returned, but was in a previous impl. if (result!=null) return result; } @@ -529,15 +530,22 @@ //atomic variable - a connection can become idle while we are creating //a new connection if (size.get() < getPoolProperties().getMaxActive()) { -size.addAndGet(1); -return createConnection(now, con); +//atomic duplicate check +if (size.addAndGet(1) > getPoolProperties().getMaxActive()) { +return createConnection(now, con); +} else { +//if we got here, two threads passed through the first if +size.decrementAndGet(); +} } //end if //calculate wait time for this iteration long maxWait = wait; +//if the passed in wait time is -1, means we should use the pool property value if (wait==-1) { maxWait = (getPoolProperties().getMaxWait()<=0)?Long.MAX_VALUE:getPoolProperties().getMaxWait(); } + long timetowait = Math.max(0, maxWait - (System.currentTimeMillis() - now)); waitcount.incrementAndGet(); try { @@ -614,10 +622,13 @@ protected PooledConnection borrowConnection(long now, PooledConnection con) throws SQLException { //we have a connection, lets set it up + +//flag to see if we need to nullify boolean setToNull = false; try { con.lock(); if (!con.isDiscarded() && !con.isInitialized()) { +//attempt to connect con.connect(); } if ((!con.isDiscarded()) && con.validate(PooledConnection.VALIDATE_BORROW)) { Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PooledConnection.java URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PooledConnection.java?rev=793017&r1=793016&r2=793017&view=diff == --- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PooledConnection.java (original) +++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PooledConnection.java Fri Jul 10 16:25:14 2009 @@ -85,7 +85,7 @@ /** * Set to true if this connection has been discarded by the pool */ -private boolean discarded = false; +private volatile boolean discarded = false; /** * The Timestamp when the last time the connect() method was called successfully */ ---
svn commit: r793019 - /tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java
Author: markt Date: Fri Jul 10 16:26:56 2009 New Revision: 793019 URL: http://svn.apache.org/viewvc?rev=793019&view=rev Log: Revert r792945 - JSP.7.3.6.1 explicitly states locations without a leading '/' are to be treated as relative to web.xml Modified: tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java Modified: tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java?rev=793019&r1=793018&r2=793019&view=diff == --- tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java (original) +++ tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java Fri Jul 10 16:26:56 2009 @@ -508,6 +508,11 @@ String taglibs[] = context.findTaglibs(); for (int i = 0; i < taglibs.length; i++) { String resourcePath = context.findTaglib(taglibs[i]); +// FIXME - Servlet 2.4 DTD implies that the location MUST be +// a context-relative path starting with '/'? +if (!resourcePath.startsWith("/")) { +resourcePath = "/WEB-INF/" + resourcePath; +} if (log.isTraceEnabled()) { log.trace(" Adding path '" + resourcePath + "' for URI '" + taglibs[i] + "'"); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r793021 - /tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java
Author: markt Date: Fri Jul 10 16:28:41 2009 New Revision: 793021 URL: http://svn.apache.org/viewvc?rev=793021&view=rev Log: Better notes for future reference Modified: tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java Modified: tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java?rev=793021&r1=793020&r2=793021&view=diff == --- tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java (original) +++ tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java Fri Jul 10 16:28:41 2009 @@ -508,8 +508,10 @@ String taglibs[] = context.findTaglibs(); for (int i = 0; i < taglibs.length; i++) { String resourcePath = context.findTaglib(taglibs[i]); -// FIXME - Servlet 2.4 DTD implies that the location MUST be -// a context-relative path starting with '/'? +// Note: Whilst the Servlet 2.4 DTD implies that the location must +// be a context-relative path starting with '/', JSP.7.3.6.1 states +// explicitly how paths that do not start with '/' should be +// handled. if (!resourcePath.startsWith("/")) { resourcePath = "/WEB-INF/" + resourcePath; } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r793029 - /tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
Author: fhanik Date: Fri Jul 10 16:42:00 2009 New Revision: 793029 URL: http://svn.apache.org/viewvc?rev=793029&view=rev Log: correct counter behavior. Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java?rev=793029&r1=793028&r2=793029&view=diff == --- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java (original) +++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java Fri Jul 10 16:42:00 2009 @@ -532,10 +532,11 @@ if (size.get() < getPoolProperties().getMaxActive()) { //atomic duplicate check if (size.addAndGet(1) > getPoolProperties().getMaxActive()) { -return createConnection(now, con); -} else { //if we got here, two threads passed through the first if size.decrementAndGet(); +} else { +//create a connection, we're below the limit +return createConnection(now, con); } } //end if - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r793040 - in /tomcat/trunk/modules/jdbc-pool: build.properties.default build.xml
Author: fhanik Date: Fri Jul 10 17:08:35 2009 New Revision: 793040 URL: http://svn.apache.org/viewvc?rev=793040&view=rev Log: were not using DBCP anywhere Modified: tomcat/trunk/modules/jdbc-pool/build.properties.default tomcat/trunk/modules/jdbc-pool/build.xml Modified: tomcat/trunk/modules/jdbc-pool/build.properties.default URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/build.properties.default?rev=793040&r1=793039&r2=793040&view=diff == --- tomcat/trunk/modules/jdbc-pool/build.properties.default (original) +++ tomcat/trunk/modules/jdbc-pool/build.properties.default Fri Jul 10 17:08:35 2009 @@ -80,10 +80,11 @@ dbcp.jar=${dbcp.home}/commons-dbcp-1.2.jar dbcp.loc=http://archive.apache.org/dist/commons/dbcp/binaries/commons-dbcp-1.2.zip -tomcat.home=${base.path}/apache-tomcat-6.0.20 +tomcat.version=6.0.20 +tomcat.home=${base.path}/apache-tomcat-${tomcat.version} tomcat.dbcp.jar=${tomcat.home}/lib/tomcat-dbcp.jar tomcat.juli.jar=${tomcat.home}/bin/tomcat-juli.jar -tomcat.loc=http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.20/bin/apache-tomcat-6.0.20.zip +tomcat.loc=http://archive.apache.org/dist/tomcat/tomcat-6/v${tomcat.version}/bin/apache-tomcat-${tomcat.version}.zip tomcat.project.loc=http://svn.apache.org/repos/asf/tomcat/trunk/webapps/docs/project.xml tomcat.project.dest=${base.path}/project.xml Modified: tomcat/trunk/modules/jdbc-pool/build.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/build.xml?rev=793040&r1=793039&r2=793040&view=diff == --- tomcat/trunk/modules/jdbc-pool/build.xml (original) +++ tomcat/trunk/modules/jdbc-pool/build.xml Fri Jul 10 17:08:35 2009 @@ -59,7 +59,6 @@ - @@ -310,11 +309,13 @@ + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r793042 - in /tomcat/trunk/modules/jdbc-pool: build.xml java/org/apache/tomcat/jdbc/pool/DataSource.java
Author: fhanik Date: Fri Jul 10 17:16:25 2009 New Revision: 793042 URL: http://svn.apache.org/viewvc?rev=793042&view=rev Log: remove dbcp add classpath to javadoc start documenting DataSource Modified: tomcat/trunk/modules/jdbc-pool/build.xml tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSource.java Modified: tomcat/trunk/modules/jdbc-pool/build.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/build.xml?rev=793042&r1=793041&r2=793042&view=diff == --- tomcat/trunk/modules/jdbc-pool/build.xml (original) +++ tomcat/trunk/modules/jdbc-pool/build.xml Fri Jul 10 17:16:25 2009 @@ -86,7 +86,9 @@ - + + + Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSource.java URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSource.java?rev=793042&r1=793041&r2=793042&view=diff == --- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSource.java (original) +++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSource.java Fri Jul 10 17:16:25 2009 @@ -50,17 +50,34 @@ // Register the actual pool itself under the tomcat.jdbc domain //=== protected volatile ObjectName oname = null; + +/** + * Unregisters the underlying connection pool mbean. + * {...@inheritdoc} + */ public void postDeregister() { if (oname!=null) unregisterJmx(); } +/** + * no-op + * {...@inheritdoc} + */ public void postRegister(Boolean registrationDone) { } +/** + * no-op + * {...@inheritdoc} + */ public void preDeregister() throws Exception { } +/** + * If the connection pool MBean exists, it will be registered during this operation. + * {...@inheritdoc} + */ public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception { try { this.oname = createObjectName(name); @@ -71,6 +88,12 @@ return name; } +/** + * Creates the ObjectName for the ConnectionPoolMBean object to be registered + * @param original the ObjectName for the DataSource + * @return the ObjectName for the ConnectionPoolMBean + * @throws MalformedObjectNameException + */ public ObjectName createObjectName(ObjectName original) throws MalformedObjectNameException { String domain = "tomcat.jdbc"; Hashtable properties = original.getKeyPropertyList(); @@ -84,10 +107,15 @@ return name; } +/** + * Registers the ConnectionPoolMBean + */ protected void registerJmx() { try { -MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); -mbs.registerMBean(pool.getJmxPool(), oname); +if (pool.getJmxPool()!=null) { +MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); +mbs.registerMBean(pool.getJmxPool(), oname); +} } catch (Exception e) { log.error("Unable to register JDBC pool with JMX",e); } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r793060 - in /tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool: ./ interceptor/ jmx/
Author: fhanik Date: Fri Jul 10 18:10:30 2009 New Revision: 793060 URL: http://svn.apache.org/viewvc?rev=793060&view=rev Log: javadoc corrections Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSource.java tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSourceFactory.java tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSourceProxy.java tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/JdbcInterceptor.java tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PooledConnection.java tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/AbstractCreateStatementInterceptor.java tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/AbstractQueryReport.java tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReportJmx.java tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/jmx/ConnectionPool.java Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java?rev=793060&r1=793059&r2=793060&view=diff == --- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java (original) +++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java Fri Jul 10 18:10:30 2009 @@ -139,7 +139,7 @@ * until a connection has become available. * If a connection is not retrieved, the Future must be cancelled in order for the connection to be returned * to the pool. - * @return + * @return a Future containing a reference to the connection or the future connection * @throws SQLException */ public Future getConnectionAsync() throws SQLException { @@ -234,7 +234,7 @@ * All calls on {...@link java.sql.Connection} methods will be propagated down to the actual JDBC connection except for the * {...@link java.sql.Connection#close()} method. * @param con a {...@link PooledConnection} to wrap in a Proxy - * @return a {...@java.sql.connection} object wrapping a pooled connection. + * @return a {...@link java.sql.Connection} object wrapping a pooled connection. * @throws SQLException if an interceptor can't be configured, if the proxy can't be instantiated */ protected Connection setupConnection(PooledConnection con) throws SQLException { Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSource.java URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSource.java?rev=793060&r1=793059&r2=793060&view=diff == --- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSource.java (original) +++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSource.java Fri Jul 10 18:10:30 2009 @@ -16,6 +16,7 @@ */ package org.apache.tomcat.jdbc.pool; +import java.io.PrintWriter; import java.lang.management.ManagementFactory; import java.sql.SQLException; import java.util.Hashtable; @@ -108,7 +109,7 @@ } /** - * Registers the ConnectionPoolMBean + * Registers the ConnectionPoolMBean under a unique name based on the ObjectName for the DataSource */ protected void registerJmx() { try { @@ -134,6 +135,10 @@ //=== // Expose JMX attributes through Tomcat's dynamic reflection //=== +/** + * Forces an abandon check on the connection pool. + * If connections that have been abandoned exists, they will be closed during this run + */ public void checkAbandoned() { try { createPool().checkAbandoned(); @@ -142,6 +147,9 @@ } } +/** + * Forces a check for downsizing the idle connections + */ public void checkIdle() { try { createPool().checkIdle(); @@ -150,6 +158,9 @@ } } +/** + * @return number of connections in use by the application + */ public int getActive() { try { return createPool().getActive(); @@ -158,10 +169,17 @@ } } +/** + * @return number of connections in use by the application + * {...@link DataSource#getActive()} + */ public int getNumActive() { return getActive(); } +/** + *
svn commit: r793062 - /tomcat/trunk/modules/jdbc-pool/build.xml
Author: fhanik Date: Fri Jul 10 18:17:37 2009 New Revision: 793062 URL: http://svn.apache.org/viewvc?rev=793062&view=rev Log: correct dependency Modified: tomcat/trunk/modules/jdbc-pool/build.xml Modified: tomcat/trunk/modules/jdbc-pool/build.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/build.xml?rev=793062&r1=793061&r2=793062&view=diff == --- tomcat/trunk/modules/jdbc-pool/build.xml (original) +++ tomcat/trunk/modules/jdbc-pool/build.xml Fri Jul 10 18:17:37 2009 @@ -192,7 +192,7 @@ - + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r793093 - in /tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool: ConnectionPool.java PooledConnection.java
Author: fhanik Date: Fri Jul 10 19:48:26 2009 New Revision: 793093 URL: http://svn.apache.org/viewvc?rev=793093&view=rev Log: javadoc Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PooledConnection.java Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java?rev=793093&r1=793092&r2=793093&view=diff == --- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java (original) +++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java Fri Jul 10 19:48:26 2009 @@ -124,7 +124,8 @@ //=== /** - * Instantiate a connection pool. This will create connections if initialSize is larger than 0 + * Instantiate a connection pool. This will create connections if initialSize is larger than 0. + * The {...@link PoolProperties} should not be reused for another connection pool. * @param prop PoolProperties - all the properties for this connection pool * @throws SQLException */ @@ -311,7 +312,12 @@ */ @Override protected void finalize() throws Throwable { -close(true); +Runnable closer = new Runnable() { +public void run() { +close(true); +} +}; +this.cancellator.execute(closer); } /** @@ -365,7 +371,7 @@ /** * Initialize the connection pool - called from the constructor * @param properties PoolProperties - properties used to initialize the pool with - * @throws SQLException + * @throws SQLException if initialization fails */ protected void init(PoolProperties properties) throws SQLException { poolProperties = properties; @@ -578,6 +584,13 @@ } //while } +/** + * Creates a JDBC connection and tries to connect to the database. + * @param now timestamp of when this was called + * @param con the previous pooled connection - argument not used + * @return a PooledConnection that has been connected + * @throws SQLException + */ protected PooledConnection createConnection(long now, PooledConnection con) throws SQLException { //no connections where available we'll create one boolean error = false; @@ -621,6 +634,13 @@ return null; } +/** + * Validates and configures a previously idle connection + * @param now - timestamp + * @param con - the connection to validate and configure + * @return con + * @throws SQLException if a validation error happens + */ protected PooledConnection borrowConnection(long now, PooledConnection con) throws SQLException { //we have a connection, lets set it up @@ -687,6 +707,12 @@ } } +/** + * Determines if a connection should be closed upon return to the pool. + * @param con - the connection + * @param action - the validation action that should be performed + * @return true if the connection should be closed + */ protected boolean shouldClose(PooledConnection con, int action) { if (con.isDiscarded()) return true; if (isClosed()) return true; @@ -700,7 +726,10 @@ /** * Returns a connection to the pool - * @param con PooledConnection + * If the pool is closed, the connection will be released + * If the connection is not part of the busy queue, it will be released. + * If {...@link PoolProperties#testOnReturn} is set to true it will be validated + * @param con PooledConnection to be returned to the pool */ protected void returnConnection(PooledConnection con) { if (isClosed()) { @@ -743,6 +772,11 @@ } //end if } //checkIn +/** + * Determines if a connection should be abandoned based on + * {...@link PoolProperties#abandonWhenPercentageFull} setting. + * @return true if the connection should be abandoned + */ protected boolean shouldAbandon() { if (poolProperties.getAbandonWhenPercentageFull()==0) return true; float used = (float)busy.size(); @@ -751,6 +785,9 @@ return (used/max*100f)>=perc; } +/** + * Iterates through all the busy connections and checks for connections that have timed out + */ public void checkAbandoned() { try { if (busy.size()==0) return; @@ -787,6 +824,10 @@ } } +/** + * Iterates through the idle connections and resizes the idle pool based on parameters + * {...@link PoolProperties#maxIdle}, {...@link PoolProperties#min
svn commit: r793108 - in /tomcat/trunk/modules/jdbc-pool: java/org/apache/tomcat/jdbc/pool/ test/org/apache/tomcat/jdbc/test/ test/org/apache/tomcat/jdbc/test/driver/
Author: fhanik Date: Fri Jul 10 21:02:43 2009 New Revision: 793108 URL: http://svn.apache.org/viewvc?rev=793108&view=rev Log: Fix a concurrency issue with connections being released and then trying to be reconnected Added: tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/TestConcurrency.java (with props) Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PoolProperties.java tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PooledConnection.java tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/ConnectCountTest.java tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/driver/Connection.java tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/driver/Driver.java Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java?rev=793108&r1=793107&r2=793108&view=diff == --- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java (original) +++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java Fri Jul 10 21:02:43 2009 @@ -648,6 +648,11 @@ boolean setToNull = false; try { con.lock(); + +if (con.isReleased()) { +return null; +} + if (!con.isDiscarded() && !con.isInitialized()) { //attempt to connect con.connect(); Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PoolProperties.java URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PoolProperties.java?rev=793108&r1=793107&r2=793108&view=diff == --- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PoolProperties.java (original) +++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PoolProperties.java Fri Jul 10 21:02:43 2009 @@ -72,7 +72,7 @@ protected boolean useEquals = false; protected int abandonWhenPercentageFull = 0; protected long maxAge = 0; - +protected boolean useLock = true; private InterceptorDefinition[] interceptors = null; public void setAbandonWhenPercentageFull(int percentage) { @@ -531,7 +531,15 @@ public void setMaxAge(long maxAge) { this.maxAge = maxAge; } + +public boolean getUseLock() { +return useLock; +} + +public void setUseLock(boolean useLock) { +this.useLock = useLock; +} - + } Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PooledConnection.java URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PooledConnection.java?rev=793108&r1=793107&r2=793108&view=diff == --- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PooledConnection.java (original) +++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PooledConnection.java Fri Jul 10 21:02:43 2009 @@ -112,7 +112,6 @@ private AtomicBoolean released = new AtomicBoolean(false); - public PooledConnection(PoolProperties prop, ConnectionPool parent) { instanceCount = counter.addAndGet(1); poolProperties = prop; @@ -367,7 +366,7 @@ * Otherwise this is a noop for performance */ public void lock() { -if (this.poolProperties.isPoolSweeperEnabled()) { +if (poolProperties.getUseLock() || this.poolProperties.isPoolSweeperEnabled()) { //optimized, only use a lock when there is concurrency lock.writeLock().lock(); } @@ -378,7 +377,7 @@ * Otherwise this is a noop for performance */ public void unlock() { -if (this.poolProperties.isPoolSweeperEnabled()) { +if (poolProperties.getUseLock() || this.poolProperties.isPoolSweeperEnabled()) { //optimized, only use a lock when there is concurrency lock.writeLock().unlock(); } @@ -423,5 +422,9 @@ public String toString() { return "PooledConnection["+(connection!=null?connection.toString():"null")+"]"; } + +public boolean isReleased() { +return released.get(); +} } Modified: tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/ConnectCountTest.java URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/ConnectCountTest.java?rev=793108&r1=793107&r2=793108&view=diff =
svn commit: r793116 - in /tomcat/trunk/modules/jdbc-pool: java/org/apache/tomcat/jdbc/pool/ test/org/apache/tomcat/jdbc/test/
Author: fhanik Date: Fri Jul 10 21:38:16 2009 New Revision: 793116 URL: http://svn.apache.org/viewvc?rev=793116&view=rev Log: Some more concurrency testing Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSourceFactory.java tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSourceProxy.java tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PoolProperties.java tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PooledConnection.java tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/TestConcurrency.java Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java?rev=793116&r1=793115&r2=793116&view=diff == --- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java (original) +++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java Fri Jul 10 21:38:16 2009 @@ -847,7 +847,7 @@ if (busy.contains(con)) continue; long time = con.getTimestamp(); -if (((now - time) > con.getReleaseTime()) && (getSize()>getPoolProperties().getMinIdle())) { +if ((con.getReleaseTime()>0) && ((now - time) > con.getReleaseTime()) && (getSize()>getPoolProperties().getMinIdle())) { release(con); idle.remove(con); setToNull = true; Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSourceFactory.java URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSourceFactory.java?rev=793116&r1=793115&r2=793116&view=diff == --- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSourceFactory.java (original) +++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSourceFactory.java Fri Jul 10 21:38:16 2009 @@ -108,6 +108,7 @@ protected final static String PROP_FAIR_QUEUE = "fairQueue"; protected static final String PROP_USE_EQUALS = "useEquals"; +protected static final String PROP_USE_CON_LOCK = "useLock"; public static final int UNKNOWN_TRANSACTIONISOLATION = -1; @@ -151,7 +152,8 @@ PROP_USE_EQUALS, OBJECT_NAME, PROP_ABANDONWHENPERCENTAGEFULL, -PROP_MAXAGE +PROP_MAXAGE, +PROP_USE_CON_LOCK }; // -- ObjectFactory Methods @@ -424,6 +426,11 @@ poolProperties.setMaxAge(Long.parseLong(value)); } +value = properties.getProperty(PROP_USE_CON_LOCK); +if (value != null) { +poolProperties.setUseLock(Boolean.parseBoolean(value)); +} + return poolProperties; } Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSourceProxy.java URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSourceProxy.java?rev=793116&r1=793115&r2=793116&view=diff == --- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSourceProxy.java (original) +++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSourceProxy.java Fri Jul 10 21:38:16 2009 @@ -287,6 +287,10 @@ this.getPoolProperties().setFairQueue(fairQueue); } +public void setUseLock(boolean useLock) { +this.getPoolProperties().setUseLock(useLock); +} + public void setDefaultCatalog(String catalog) { this.getPoolProperties().setDefaultCatalog(catalog); } Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PoolProperties.java URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PoolProperties.java?rev=793116&r1=793115&r2=793116&view=diff == --- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PoolProperties.java (original) +++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PoolProperties.java Fri Jul 10 21:38:16 2009 @@ -72,7 +72,7 @@ protected boolean useEquals = false; protected int abandonWhenPercentageFull = 0; protected long maxAge = 0; -protected boolean useLock = true; +protected boolean useLock = false; private InterceptorDefinition[] interceptors = null; public void setAban
svn commit: r793117 - /tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/TestConcurrency.java
Author: fhanik Date: Fri Jul 10 21:40:26 2009 New Revision: 793117 URL: http://svn.apache.org/viewvc?rev=793117&view=rev Log: fix assertion Modified: tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/TestConcurrency.java Modified: tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/TestConcurrency.java URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/TestConcurrency.java?rev=793117&r1=793116&r2=793117&view=diff == --- tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/TestConcurrency.java (original) +++ tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/TestConcurrency.java Fri Jul 10 21:40:26 2009 @@ -91,6 +91,7 @@ public void testBrutal() throws Exception { ds.getPoolProperties().setRemoveAbandoned(false); +ds.getPoolProperties().setRemoveAbandonedTimeout(1); ds.getPoolProperties().setMinEvictableIdleTimeMillis(10); ds.getPoolProperties().setTimeBetweenEvictionRunsMillis(-1); ds.getConnection().close(); @@ -135,7 +136,7 @@ assertEquals("Size comparison:",10, ds.getPool().getSize()); assertEquals("Idle comparison:",10, ds.getPool().getIdle()); assertEquals("Used comparison:",0, ds.getPool().getActive()); -assertEquals("Connect count",10,Driver.connectCount.get()-Driver.disconnectCount.get()); +assertEquals("Connect count",10,Driver.connectCount.get()); } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 47500] request.getParameter lead to servlet can't receive READ event in CometProcessor class
https://issues.apache.org/bugzilla/show_bug.cgi?id=47500 Paul Gonchar changed: What|Removed |Added CC||p...@coehl.com --- Comment #1 from Paul Gonchar 2009-07-10 14:52:59 PST --- We have the same problem on Tomcat 6.0.18 and 6.0.20 (running on FreeBSD v7.2 amd64). Also, tried building from HEAD on 07/10/2009 with the same result. We are trying to implement a servlet based on CometProcessor. Here is a snippet of our server code: public void event( CometEvent _event ) throws IOException, ServletException { CometEvent.EventType type = _event.getEventType(); switch ( type ) { case BEGIN: // needed for APR connector if ( _event.getHttpServletRequest().getAttribute("org.apache.tomcat.comet.timeout.support") == Boolean.TRUE ) { _event.setTimeout( getTimeout() ); } break; case READ: processRead( _event ); _event.getHttpServletResponse().flushBuffer(); break; case END: case ERROR: _event.close(); break; } } In the next method the call to getParameter("message") prevents response from getting to the client. After some time some responses make it to the client, but these responses contain only headers (for example, "Connection" header set to "keep-alive" in the servlet by the call _event.getHttpServletResponse().addHeader("Connection", "keep-alive")) - no data is received. We tracked this in Firebug under Firefox 3.5 . If we invoke event.close() after processing of handshake(the same way it is done in BayeuxServlet.handleEvent(xxx) in the HEAD) then the client gets the response and servlet will get another "connect" request. However, there is nowhere to write the next response to because output stream is already closed. When we remove the call to _event.getHttpServletRequest().getParameter("message") everything works fine. private int processRead( CometEvent _event ) throws IOException, ServletException { String msg = _event.getHttpServletRequest().getParameter("message"); // - THE PROBLEM CALL try { JSONArray jobj = new JSONArray( msg ); for (int i = 0; i < jobj.length(); i++) { JSONObject jMsg = jobj.getJSONObject(i); PrintWriter out = _event.getHttpServletResponse().getWriter(); if ( "/meta/handshake".equals( jMsg.optString("channel") ) ) { out.print( "[" + handshake( jMsg) + "]" ); out.flush(); } else if ( "/meta/connect".equals( jMsg.optString("channel") ) ) { out.print( "[ { json response } ]" ); out.flush(); } } } catch ( Exception ex ) { throw new ServletException( ex ); } return 0; } private JSONObject handshake( JSONObject _msg ) throws JSONException { JSONObject response = new JSONObject(); response.put( "channel", "/meta/handshake"); response.put( "version", "1.0"); response.put( "minimumVersion", "0.9"); response.put( "clientId", bayeux.newClient().getId() ); response.put( "successful", true); response.put( "supportedConnectionTypes", new String[] { "long-polling", "callback-polling" } ); response.put( "id", _msg.optInt("id") ); return response; } Here is our test client page: http://localhost:8180/dojo/1.3.1/dojo/dojo.js"; djConfig="parseOnLoad: true, isDebug: true">