JBossWeb SVN: r1745 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2011-06-24 05:44:19 -0400 (Fri, 24 Jun 2011)
New Revision: 1745
Modified:
trunk/java/org/apache/catalina/core/StandardContext.java
trunk/webapps/docs/changelog.xml
Log:
- I don't know why I used something based on the context CL, but this is not a good idea.
Modified: trunk/java/org/apache/catalina/core/StandardContext.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardContext.java 2011-06-24 08:36:16 UTC (rev 1744)
+++ trunk/java/org/apache/catalina/core/StandardContext.java 2011-06-24 09:44:19 UTC (rev 1745)
@@ -3725,6 +3725,10 @@
if ((loader != null) && (loader instanceof Lifecycle))
((Lifecycle) loader).start();
+ if ((loader != null) && (loader.getClassLoader() != null)) {
+ DirContextURLStreamHandler.bind(loader.getClassLoader(), getResources());
+ }
+
// Unbinding thread
unbindThread(oldCCL);
@@ -3996,6 +4000,9 @@
if ((logger != null) && (logger instanceof Lifecycle)) {
((Lifecycle) logger).stop();
}
+ if ((loader != null) && (loader.getClassLoader() != null)) {
+ DirContextURLStreamHandler.unbind(loader.getClassLoader());
+ }
if ((loader != null) && (loader instanceof Lifecycle)) {
((Lifecycle) loader).stop();
}
@@ -4200,8 +4207,6 @@
lifecycle.fireLifecycleEvent(BIND_THREAD_EVENT, null);
- DirContextURLStreamHandler.bind(getResources());
-
return oldContextClassLoader;
}
@@ -4212,8 +4217,6 @@
*/
protected void unbindThread(ClassLoader oldContextClassLoader) {
- DirContextURLStreamHandler.unbind();
-
lifecycle.fireLifecycleEvent(UNBIND_THREAD_EVENT, null);
Thread.currentThread().setContextClassLoader(oldContextClassLoader);
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2011-06-24 08:36:16 UTC (rev 1744)
+++ trunk/webapps/docs/changelog.xml 2011-06-24 09:44:19 UTC (rev 1745)
@@ -16,6 +16,24 @@
<body>
+<section name="JBoss Web 7.0.0.CR4 (remm)">
+ <subsection name="Catalina">
+ <changelog>
+ <fix>
+ <jboss-jira>AS7-1098</jboss-jira>: Cleanup URL stream handler init by using
+ the classloader returned loader.getClassLoader(). (remm)
+ </fix>
+ </changelog>
+ </subsection>
+ <subsection name="Jasper">
+ <changelog>
+ <fix>
+ Improve per thread tagpool cleanup. (remm)
+ </fix>
+ </changelog>
+ </subsection>
+</section>
+
<section name="JBoss Web 7.0.0.CR3 (remm)">
<subsection name="Catalina">
<changelog>
@@ -29,10 +47,6 @@
Allow valves to replace the IS/reader and OS/writer that gets returned to the
applications. (remm)
</update>
- <fix>
- <jboss-jira>AS7-1098</jboss-jira>: Call context classloader unbind with the right
- classloader. (remm)
- </fix>
</changelog>
</subsection>
<subsection name="Jasper">
13 years, 6 months
JBossWeb SVN: r1744 - tags.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2011-06-24 04:36:16 -0400 (Fri, 24 Jun 2011)
New Revision: 1744
Added:
tags/JBOSSWEB_7_0_0_CR3/
Log:
Web CR3.
13 years, 6 months
JBossWeb SVN: r1743 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2011-06-23 18:12:31 -0400 (Thu, 23 Jun 2011)
New Revision: 1743
Modified:
trunk/java/org/apache/catalina/core/StandardContext.java
trunk/webapps/docs/changelog.xml
Log:
- AS7-1098: Fix classloader unbind. Submitted by Stuart Douglas.
Modified: trunk/java/org/apache/catalina/core/StandardContext.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardContext.java 2011-06-22 09:59:29 UTC (rev 1742)
+++ trunk/java/org/apache/catalina/core/StandardContext.java 2011-06-23 22:12:31 UTC (rev 1743)
@@ -4212,14 +4212,14 @@
*/
protected void unbindThread(ClassLoader oldContextClassLoader) {
+ DirContextURLStreamHandler.unbind();
+
lifecycle.fireLifecycleEvent(UNBIND_THREAD_EVENT, null);
Thread.currentThread().setContextClassLoader(oldContextClassLoader);
oldContextClassLoader = null;
- DirContextURLStreamHandler.unbind();
-
}
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2011-06-22 09:59:29 UTC (rev 1742)
+++ trunk/webapps/docs/changelog.xml 2011-06-23 22:12:31 UTC (rev 1743)
@@ -29,6 +29,10 @@
Allow valves to replace the IS/reader and OS/writer that gets returned to the
applications. (remm)
</update>
+ <fix>
+ <jboss-jira>AS7-1098</jboss-jira>: Call context classloader unbind with the right
+ classloader. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
13 years, 6 months
JBossWeb SVN: r1742 - branches/2.1.x/java/org/apache/tomcat/util/http.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2011-06-22 05:59:29 -0400 (Wed, 22 Jun 2011)
New Revision: 1742
Modified:
branches/2.1.x/java/org/apache/tomcat/util/http/Cookies.java
branches/2.1.x/java/org/apache/tomcat/util/http/ServerCookie.java
Log:
Clean the VERSION_SWITCH logic.
Modified: branches/2.1.x/java/org/apache/tomcat/util/http/Cookies.java
===================================================================
--- branches/2.1.x/java/org/apache/tomcat/util/http/Cookies.java 2011-06-21 09:24:10 UTC (rev 1741)
+++ branches/2.1.x/java/org/apache/tomcat/util/http/Cookies.java 2011-06-22 09:59:29 UTC (rev 1742)
@@ -51,7 +51,9 @@
* being quoted.
*/
public static final boolean ALLOW_EQUALS_IN_VALUE;
-
+
+ public static final boolean VERSION_SWITCH =
+ Boolean.valueOf(System.getProperty("org.apache.catalina.STRICT_SERVLET_COMPLIANCE", "false")).booleanValue() ? false : Boolean.valueOf(System.getProperty("org.apache.tomcat.util.http.ServerCookie.VERSION_SWITCH", "false")).booleanValue();
/*
List of Separator Characters (see isSeparator())
Excluding the '/' char violates the RFC, but
@@ -67,7 +69,7 @@
for (int i = 0; i < 128; i++) {
separators[i] = false;
}
- if (Boolean.valueOf(System.getProperty("org.apache.tomcat.util.http.ServerCookie.VERSION_SWITCH", "false")).booleanValue()) {
+ if (VERSION_SWITCH) {
/* Version 1 separators */
SEPARATORS = new char[] { '\t', ' ', '\"', '\'', '(', ')', ',',
':', ';', '<', '=', '>', '?', '@', '[', '\\', ']', '{', '}' };
Modified: branches/2.1.x/java/org/apache/tomcat/util/http/ServerCookie.java
===================================================================
--- branches/2.1.x/java/org/apache/tomcat/util/http/ServerCookie.java 2011-06-21 09:24:10 UTC (rev 1741)
+++ branches/2.1.x/java/org/apache/tomcat/util/http/ServerCookie.java 2011-06-22 09:59:29 UTC (rev 1742)
@@ -76,8 +76,8 @@
/**
* If set to true, we parse cookies according to the servlet spec,
*/
- public static final boolean STRICT_SERVLET_COMPLIANCE =
- Boolean.valueOf(System.getProperty("org.apache.catalina.STRICT_SERVLET_COMPLIANCE", "false")).booleanValue();
+ public static final boolean VERSION_SWITCH =
+ Boolean.valueOf(System.getProperty("org.apache.catalina.STRICT_SERVLET_COMPLIANCE", "false")).booleanValue() ? false : Boolean.valueOf(System.getProperty("org.apache.tomcat.util.http.ServerCookie.VERSION_SWITCH", "false")).booleanValue();
// Note: Servlet Spec =< 2.5 only refers to Netscape and RFC2109,
@@ -391,7 +391,7 @@
buf.append('"');
buf.append(escapeDoubleQuotes(value,1,value.length()-1));
buf.append('"');
- } else if (allowVersionSwitch && (!STRICT_SERVLET_COMPLIANCE) && version==0 && !isToken2(value, literals)) {
+ } else if (allowVersionSwitch && VERSION_SWITCH && version==0 && !isToken2(value, literals)) {
buf.append('"');
buf.append(escapeDoubleQuotes(value,0,value.length()));
buf.append('"');
13 years, 6 months
JBossWeb SVN: r1741 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2011-06-21 05:24:10 -0400 (Tue, 21 Jun 2011)
New Revision: 1741
Modified:
trunk/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java
trunk/webapps/docs/changelog.xml
Log:
- More cleanup won't hurt.
Modified: trunk/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java
===================================================================
--- trunk/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java 2011-06-20 08:53:55 UTC (rev 1740)
+++ trunk/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java 2011-06-21 09:24:10 UTC (rev 1741)
@@ -133,7 +133,12 @@
if (ptd.handlers != null) {
for (int i=ptd.current; i>=0; i--) {
if (ptd.handlers[i] != null) {
- ptd.handlers[i].release();
+ try {
+ ptd.handlers[i].release();
+ } catch (Exception e) {
+ log.warn("Error processing release on tag instance of "
+ + ptd.handlers[i].getClass().getName(), e);
+ }
if (Constants.INJECT_TAGS || Constants.USE_INSTANCE_MANAGER_FOR_TAGS) {
try {
instanceManager.destroyInstance(ptd.handlers[i]);
@@ -145,7 +150,10 @@
}
}
}
+ ptd.handlers = null;
+ ptd.current = -1;
}
+ perThreadDataVector.clear();
}
}
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2011-06-20 08:53:55 UTC (rev 1740)
+++ trunk/webapps/docs/changelog.xml 2011-06-21 09:24:10 UTC (rev 1741)
@@ -31,6 +31,13 @@
</update>
</changelog>
</subsection>
+ <subsection name="Jasper">
+ <changelog>
+ <fix>
+ Improve per thread tagpool cleanup. (remm)
+ </fix>
+ </changelog>
+ </subsection>
</section>
<section name="JBoss Web 7.0.0.CR2 (remm)">
13 years, 6 months
JBossWeb SVN: r1740 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2011-06-20 04:53:55 -0400 (Mon, 20 Jun 2011)
New Revision: 1740
Modified:
trunk/java/org/apache/catalina/connector/Request.java
trunk/java/org/apache/catalina/connector/Response.java
trunk/webapps/docs/changelog.xml
Log:
- Add custom IS/OS fields to allow some wrapping by valves. Hopefully won't cause issues.
Modified: trunk/java/org/apache/catalina/connector/Request.java
===================================================================
--- trunk/java/org/apache/catalina/connector/Request.java 2011-06-14 14:56:59 UTC (rev 1739)
+++ trunk/java/org/apache/catalina/connector/Request.java 2011-06-20 08:53:55 UTC (rev 1740)
@@ -347,6 +347,18 @@
/**
+ * Application input stream.
+ */
+ protected ServletInputStream applicationInputStream = null;
+
+
+ /**
+ * Application reader.
+ */
+ protected BufferedReader applicationReader = null;
+
+
+ /**
* User principal.
*/
protected Principal userPrincipal = null;
@@ -525,6 +537,8 @@
inputBuffer.recycle();
usingInputStream = false;
usingReader = false;
+ applicationInputStream = null;
+ applicationReader = null;
userPrincipal = null;
subject = null;
sessionParsed = false;
@@ -855,16 +869,6 @@
}
/**
- * Set the input stream associated with this Request.
- *
- * @param stream The new input stream
- */
- public void setStream(InputStream stream) {
- // Ignore
- }
-
-
- /**
* URI byte to char converter (not recycled).
*/
protected B2CConverter URIConverter = null;
@@ -1215,6 +1219,9 @@
throw new IllegalStateException
(sm.getString("coyoteRequest.getInputStream.ise"));
+ if (applicationInputStream != null) {
+ return applicationInputStream;
+ }
usingInputStream = true;
if (inputStream == null) {
inputStream = new CoyoteInputStream(inputBuffer);
@@ -1224,6 +1231,11 @@
}
+ public void setInputStream(ServletInputStream inputStream) {
+ applicationInputStream = inputStream;
+ }
+
+
/**
* Return the preferred Locale that the client will accept content in,
* based on the value for the first <code>Accept-Language</code> header
@@ -1362,6 +1374,9 @@
throw new IllegalStateException
(sm.getString("coyoteRequest.getReader.ise"));
+ if (applicationReader != null) {
+ return applicationReader;
+ }
usingReader = true;
inputBuffer.checkConverter();
if (reader == null) {
@@ -1371,7 +1386,17 @@
}
+
+ /**
+ * Replaces the reader with an application provided one.
+ *
+ * @param reader
+ */
+ public void setReader(BufferedReader reader) {
+ applicationReader = reader;
+ }
+
/**
* Return the real path of the specified virtual path.
*
Modified: trunk/java/org/apache/catalina/connector/Response.java
===================================================================
--- trunk/java/org/apache/catalina/connector/Response.java 2011-06-14 14:56:59 UTC (rev 1739)
+++ trunk/java/org/apache/catalina/connector/Response.java 2011-06-20 08:53:55 UTC (rev 1740)
@@ -218,6 +218,18 @@
/**
+ * Application output stream.
+ */
+ protected ServletOutputStream applicationOutputStream = null;
+
+
+ /**
+ * Using writer flag.
+ */
+ protected PrintWriter applicationWriter = null;
+
+
+ /**
* URL encoder.
*/
protected UEncoder urlEncoder = new UEncoder();
@@ -241,6 +253,8 @@
outputBuffer.recycle();
usingOutputStream = false;
usingWriter = false;
+ applicationOutputStream = null;
+ applicationWriter = null;
appCommitted = false;
included = false;
error = false;
@@ -393,16 +407,6 @@
/**
- * Set the output stream associated with this Response.
- *
- * @param stream The new output stream
- */
- public void setStream(OutputStream stream) {
- // This method is evil
- }
-
-
- /**
* Set the suspended flag.
*
* @param suspended The new suspended flag value
@@ -567,6 +571,10 @@
throw new IllegalStateException
(sm.getString("coyoteResponse.getOutputStream.ise"));
+ if (applicationOutputStream != null) {
+ return applicationOutputStream;
+ }
+
usingOutputStream = true;
if (outputStream == null) {
outputStream = new CoyoteOutputStream(outputBuffer);
@@ -575,7 +583,12 @@
}
+
+ public void setOutputStream(ServletOutputStream outputStream) {
+ applicationOutputStream = outputStream;
+ }
+
/**
* Return the Locale assigned to this response.
*/
@@ -598,6 +611,10 @@
throw new IllegalStateException
(sm.getString("coyoteResponse.getWriter.ise"));
+ if (applicationWriter != null) {
+ return applicationWriter;
+ }
+
if (Globals.STRICT_SERVLET_COMPLIANCE) {
/*
* If the response's character encoding has not been specified as
@@ -624,6 +641,11 @@
}
+ public void setWriter(PrintWriter writer) {
+ applicationWriter = writer;
+ }
+
+
/**
* Has the output of this response already been committed?
*/
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2011-06-14 14:56:59 UTC (rev 1739)
+++ trunk/webapps/docs/changelog.xml 2011-06-20 08:53:55 UTC (rev 1740)
@@ -25,6 +25,10 @@
<fix>
<bug>51348</bug>: WebDAV lock processing NPE fix. (markt)
</fix>
+ <update>
+ Allow valves to replace the IS/reader and OS/writer that gets returned to the
+ applications. (remm)
+ </update>
</changelog>
</subsection>
</section>
13 years, 6 months
JBossWeb SVN: r1739 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2011-06-14 10:56:59 -0400 (Tue, 14 Jun 2011)
New Revision: 1739
Modified:
trunk/java/org/apache/catalina/servlets/WebdavServlet.java
trunk/webapps/docs/changelog.xml
Log:
- 51348: port NPE lock fix.
Modified: trunk/java/org/apache/catalina/servlets/WebdavServlet.java
===================================================================
--- trunk/java/org/apache/catalina/servlets/WebdavServlet.java 2011-06-10 14:49:38 UTC (rev 1738)
+++ trunk/java/org/apache/catalina/servlets/WebdavServlet.java 2011-06-14 14:56:59 UTC (rev 1739)
@@ -1282,7 +1282,7 @@
LockInfo toRenew = resourceLocks.get(path);
Enumeration<String> tokenList = null;
- if (lock != null) {
+ if (toRenew != null) {
// At least one of the tokens of the locks must have been given
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2011-06-10 14:49:38 UTC (rev 1738)
+++ trunk/webapps/docs/changelog.xml 2011-06-14 14:56:59 UTC (rev 1739)
@@ -22,6 +22,9 @@
<fix>
<bug>51324</bug>: Recycle should reset the OutputBuffer doFlush flag. (remm)
</fix>
+ <fix>
+ <bug>51348</bug>: WebDAV lock processing NPE fix. (markt)
+ </fix>
</changelog>
</subsection>
</section>
13 years, 6 months
JBossWeb SVN: r1738 - in trunk/java/org/apache: tomcat/util/net/jsse and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2011-06-10 10:49:38 -0400 (Fri, 10 Jun 2011)
New Revision: 1738
Modified:
trunk/java/org/apache/coyote/http11/Http11Protocol.java
trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java
Log:
- Add the capability to set the SSLContext, fully configured elsewhere. I like delegating the hard stuff.
Modified: trunk/java/org/apache/coyote/http11/Http11Protocol.java
===================================================================
--- trunk/java/org/apache/coyote/http11/Http11Protocol.java 2011-06-10 12:54:21 UTC (rev 1737)
+++ trunk/java/org/apache/coyote/http11/Http11Protocol.java 2011-06-10 14:49:38 UTC (rev 1738)
@@ -36,6 +36,7 @@
import javax.management.MBeanRegistration;
import javax.management.MBeanServer;
import javax.management.ObjectName;
+import javax.net.ssl.SSLContext;
import org.apache.coyote.Adapter;
import org.apache.coyote.ProtocolHandler;
@@ -546,6 +547,14 @@
setAttribute("keyAlias", keyAlias);
}
+ public SSLContext getSSLContext() {
+ return (SSLContext) getAttribute("SSLContext");
+ }
+
+ public void setSSLContext(SSLContext sslContext) {
+ setAttribute("SSLContext", sslContext);
+ }
+
// ----------------------------------- Http11ConnectionHandler Inner Class
protected static class Http11ConnectionHandler implements Handler {
Modified: trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java
===================================================================
--- trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java 2011-06-10 12:54:21 UTC (rev 1737)
+++ trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java 2011-06-10 14:49:38 UTC (rev 1738)
@@ -446,13 +446,15 @@
}
// Create and init SSLContext
- SSLContext context = SSLContext.getInstance(protocol);
- context.init(getKeyManagers(keystoreType, keystoreProvider,
- algorithm,
- (String) attributes.get("keyAlias")),
- getTrustManagers(keystoreType, keystoreProvider,
- trustAlgorithm),
- new SecureRandom());
+ SSLContext context = (SSLContext) attributes.get("SSLContext");
+ if (context == null) {
+ context = SSLContext.getInstance(protocol);
+ context.init(
+ getKeyManagers(keystoreType, keystoreProvider,
+ algorithm, (String) attributes.get("keyAlias")),
+ getTrustManagers(keystoreType, keystoreProvider,
+ trustAlgorithm), new SecureRandom());
+ }
// Configure SSL session cache
int sessionCacheSize;
13 years, 6 months
JBossWeb SVN: r1736 - in sandbox/webapps: html and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2011-06-08 05:51:06 -0400 (Wed, 08 Jun 2011)
New Revision: 1736
Added:
sandbox/webapps/html/EL.jsp
Modified:
sandbox/webapps/myapp.xml
Log:
And EL example...
Added: sandbox/webapps/html/EL.jsp
===================================================================
--- sandbox/webapps/html/EL.jsp (rev 0)
+++ sandbox/webapps/html/EL.jsp 2011-06-08 09:51:06 UTC (rev 1736)
@@ -0,0 +1,6 @@
+<body>
+<h1> EL tests</h1>
+\${1 + 2}:<br>
+${1 + 2}<br>
+</body>
+</html>
Modified: sandbox/webapps/myapp.xml
===================================================================
--- sandbox/webapps/myapp.xml 2011-06-08 04:03:12 UTC (rev 1735)
+++ sandbox/webapps/myapp.xml 2011-06-08 09:51:06 UTC (rev 1736)
@@ -1,20 +1,18 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE web-app
- PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
- "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ version="2.5">
-<web-app>
-
- <display-name>JFC test application</display-name>
<description>
Welcome to JFC test application
</description>
+ <display-name>JFC test application</display-name>
<!-- <distributable/> -->
<!-- Filters -->
<filter>
<filter-name>TestFilter</filter-name>
- <description>Test Filter</description>
<filter-class>TestFilter</filter-class>
<init-param>
<param-name>test</param-name>
@@ -30,7 +28,6 @@
<!-- Servlets -->
<servlet>
<servlet-name>MySession</servlet-name>
- <display-name>installerDownload</display-name>
<servlet-class>MySession</servlet-class>
<init-param>
<param-name>debug</param-name>
@@ -162,6 +159,18 @@
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
+ <!--
+ <jsp-config>
+ <jsp-property-group>
+ <description>Test EL</description>
+ <display-name>JSPConfiguration</display-name>
+ <url-pattern>*.jsp</url-pattern>
+ <el-ignored>false</el-ignored>
+ <scripting-invalid>false</scripting-invalid>
+ </jsp-property-group>
+ </jsp-config>
+ -->
+
<!-- Security testings -->
<security-constraint>
<web-resource-collection>
@@ -206,8 +215,8 @@
<env-entry>
<env-entry-name>test</env-entry-name>
+ <env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>Toto</env-entry-value>
- <env-entry-type>java.lang.String</env-entry-type>
</env-entry>
</web-app>
13 years, 6 months
JBossWeb SVN: r1735 - in branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-6688: src/share/classes/org/apache/catalina/connector and 3 other directories.
by jbossweb-commits@lists.jboss.org
Author: bmaxwell
Date: 2011-06-08 00:03:12 -0400 (Wed, 08 Jun 2011)
New Revision: 1735
Modified:
branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-6688/src/share/classes/javax/el/BeanELResolver.java
branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-6688/src/share/classes/org/apache/catalina/connector/Request.java
branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-6688/src/share/classes/org/apache/el/lang/ExpressionBuilder.java
branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-6688/src/share/classes/org/apache/el/util/ConcurrentCache.java
branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-6688/xdocs/news/changelog.xml
Log:
[JBPAPP-6688] - JBWEB-185: Fix thread safety in two EL caches.
Modified: branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-6688/src/share/classes/javax/el/BeanELResolver.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-6688/src/share/classes/javax/el/BeanELResolver.java 2011-06-08 03:23:33 UTC (rev 1734)
+++ branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-6688/src/share/classes/javax/el/BeanELResolver.java 2011-06-08 04:03:12 UTC (rev 1735)
@@ -25,6 +25,8 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
@@ -34,11 +36,30 @@
public class BeanELResolver extends ELResolver {
- private final boolean readOnly;
+ private static final int CACHE_SIZE;
+ private static final String CACHE_SIZE_PROP =
+ "org.apache.el.BeanELResolver.CACHE_SIZE";
- private final ConcurrentCache<String, BeanProperties> cache = new ConcurrentCache<String, BeanProperties>(
- 1000);
+ static {
+ if (System.getSecurityManager() == null) {
+ CACHE_SIZE = Integer.parseInt(
+ System.getProperty(CACHE_SIZE_PROP, "1000"));
+ } else {
+ CACHE_SIZE = AccessController.doPrivileged(
+ new PrivilegedAction<Integer>() {
+ public Integer run() {
+ return Integer.valueOf(
+ System.getProperty(CACHE_SIZE_PROP, "1000"));
+ }
+ }).intValue();
+ }
+ }
+ private final boolean readOnly;
+
+ private final ConcurrentCache<String, BeanProperties> cache =
+ new ConcurrentCache<String, BeanProperties>(CACHE_SIZE);
+
public BeanELResolver() {
this.readOnly = false;
}
@@ -296,37 +317,40 @@
}
return null;
}
-
- private final static class ConcurrentCache<K,V> {
- private final int size;
- private final Map<K,V> eden;
- private final Map<K,V> longterm;
-
- public ConcurrentCache(int size) {
- this.size = size;
- this.eden = new ConcurrentHashMap<K,V>(size);
- this.longterm = new WeakHashMap<K,V>(size);
- }
-
- public V get(K key) {
- V value = this.eden.get(key);
- if (value == null) {
- value = this.longterm.get(key);
- if (value != null) {
- this.eden.put(key, value);
- }
- }
- return value;
- }
-
- public void put(K key, V value) {
- if (this.eden.size() >= this.size) {
- this.longterm.putAll(this.eden);
- this.eden.clear();
- }
- this.eden.put(key, value);
- }
+ private final static class ConcurrentCache<K,V> {
- }
+ private final int size;
+ private final Map<K,V> eden;
+ private final Map<K,V> longterm;
+
+ public ConcurrentCache(int size) {
+ this.size = size;
+ this.eden = new ConcurrentHashMap<K,V>(size);
+ this.longterm = new WeakHashMap<K,V>(size);
+ }
+
+ public V get(K key) {
+ V value = this.eden.get(key);
+ if (value == null) {
+ synchronized (longterm) {
+ value = this.longterm.get(key);
+ }
+ if (value != null) {
+ this.eden.put(key, value);
+ }
+ }
+ return value;
+ }
+
+ public void put(K key, V value) {
+ if (this.eden.size() >= this.size) {
+ synchronized (longterm) {
+ this.longterm.putAll(this.eden);
+ }
+ this.eden.clear();
+ }
+ this.eden.put(key, value);
+ }
+ }
}
Property changes on: branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-6688/src/share/classes/javax/el/BeanELResolver.java
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/2.1.x/java/javax/el/BeanELResolver.java:1639
Modified: branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-6688/src/share/classes/org/apache/catalina/connector/Request.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-6688/src/share/classes/org/apache/catalina/connector/Request.java 2011-06-08 03:23:33 UTC (rev 1734)
+++ branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-6688/src/share/classes/org/apache/catalina/connector/Request.java 2011-06-08 04:03:12 UTC (rev 1735)
@@ -1341,8 +1341,8 @@
}
if (context == null)
- return;
-
+ return;
+
// Notify interested application event listeners
Object listeners[] = context.getApplicationEventListeners();
if ((listeners == null) || (listeners.length == 0))
@@ -1414,8 +1414,8 @@
}
if (context == null)
- return;
-
+ return;
+
// Notify interested application event listeners
Object listeners[] = context.getApplicationEventListeners();
if ((listeners == null) || (listeners.length == 0))
Property changes on: branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-6688/src/share/classes/org/apache/catalina/connector/Request.java
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/2.1.x/java/org/apache/catalina/connector/Request.java:1639
Modified: branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-6688/src/share/classes/org/apache/el/lang/ExpressionBuilder.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-6688/src/share/classes/org/apache/el/lang/ExpressionBuilder.java 2011-06-08 03:23:33 UTC (rev 1734)
+++ branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-6688/src/share/classes/org/apache/el/lang/ExpressionBuilder.java 2011-06-08 04:03:12 UTC (rev 1735)
@@ -50,7 +50,7 @@
*/
public final class ExpressionBuilder implements NodeVisitor {
- private static final ConcurrentCache<String, Node> cache = new ConcurrentCache<String, Node>(5000);
+ private static final ConcurrentCache<String, Node> cache = new ConcurrentCache<String, Node>(10000);
private FunctionMapper fnMapper;
Property changes on: branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-6688/src/share/classes/org/apache/el/lang/ExpressionBuilder.java
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/2.1.x/java/org/apache/el/lang/ExpressionBuilder.java:1639
Modified: branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-6688/src/share/classes/org/apache/el/util/ConcurrentCache.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-6688/src/share/classes/org/apache/el/util/ConcurrentCache.java 2011-06-08 03:23:33 UTC (rev 1734)
+++ branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-6688/src/share/classes/org/apache/el/util/ConcurrentCache.java 2011-06-08 04:03:12 UTC (rev 1735)
@@ -37,7 +37,9 @@
public V get(K k) {
V v = this.eden.get(k);
if (v == null) {
- v = this.longterm.get(k);
+ synchronized (longterm) {
+ v = this.longterm.get(k);
+ }
if (v != null) {
this.eden.put(k, v);
}
@@ -47,7 +49,9 @@
public void put(K k, V v) {
if (this.eden.size() >= size) {
- this.longterm.putAll(this.eden);
+ synchronized (longterm) {
+ this.longterm.putAll(this.eden);
+ }
this.eden.clear();
}
this.eden.put(k, v);
Property changes on: branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-6688/src/share/classes/org/apache/el/util/ConcurrentCache.java
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/2.1.x/java/org/apache/el/util/ConcurrentCache.java:1639
Modified: branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-6688/xdocs/news/changelog.xml
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-6688/xdocs/news/changelog.xml 2011-06-08 03:23:33 UTC (rev 1734)
+++ branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-6688/xdocs/news/changelog.xml 2011-06-08 04:03:12 UTC (rev 1735)
@@ -12,6 +12,30 @@
</properties>
<body>
+<section name="JBoss Web 2.1.11.GA (remm)">
+ <subsection name="Catalina">
+ <changelog>
+ <fix>
+ <jira>148</jira>: Fix possible NPE on request.set/removeAttribute. (remm)
+ </fix>
+ </changelog>
+ </subsection>
+ <subsection name="Coyote">
+ <changelog>
+ <fix>
+ <jboss-jira>JBPAPP-5293</jboss-jira>: ConcurrentModificationException in HandshakeCompletedNotify-Thread. (remm)
+ </fix>
+ </changelog>
+ </subsection>
+ <subsection name="Jasper">
+ <changelog>
+ <fix>
+ <jira>185</jira>: Fix cache thread safety issue for EL expression builder.
+ Patch submitted by Takayoshi Kimura. (remm)
+ </fix>
+ </changelog>
+ </subsection>
+</section>
<section name="JBossWeb 1.0">
<subsection name="General">
Property changes on: branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-6688/xdocs/news/changelog.xml
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/2.1.x/webapps/docs/changelog.xml:1639
13 years, 6 months