Author: remy.maucherat(a)jboss.com
Date: 2008-04-22 12:06:47 -0400 (Tue, 22 Apr 2008)
New Revision: 590
Modified:
trunk/java/org/apache/catalina/Container.java
trunk/java/org/apache/catalina/core/ContainerBase.java
trunk/java/org/apache/catalina/core/StandardContextValve.java
trunk/java/org/apache/catalina/startup/ContextConfig.java
trunk/java/org/apache/el/lang/ELSupport.java
trunk/java/org/apache/jasper/compiler/AntCompiler.java
trunk/webapps/docs/changelog.xml
Log:
- Port a bunch of Tomcat patches.
- Add (for now) isStarted to Container.
- Need to review JBossContextConfig.
Modified: trunk/java/org/apache/catalina/Container.java
===================================================================
--- trunk/java/org/apache/catalina/Container.java 2008-04-21 16:09:30 UTC (rev 589)
+++ trunk/java/org/apache/catalina/Container.java 2008-04-22 16:06:47 UTC (rev 590)
@@ -133,6 +133,13 @@
/**
+ * Return if the container is started. This sort of conflicts with lifecycle
+ * but the purpose should be evident enough.
+ */
+ public boolean isStarted();
+
+
+ /**
* Return descriptive information about this Container implementation and
* the corresponding version number, in the format
* <code><description>/<version></code>.
Modified: trunk/java/org/apache/catalina/core/ContainerBase.java
===================================================================
--- trunk/java/org/apache/catalina/core/ContainerBase.java 2008-04-21 16:09:30 UTC (rev
589)
+++ trunk/java/org/apache/catalina/core/ContainerBase.java 2008-04-22 16:06:47 UTC (rev
590)
@@ -283,6 +283,15 @@
/**
+ * Return if the container is started. This sort of conflicts with lifecycle
+ * but the purpose should be evident enough.
+ */
+ public boolean isStarted() {
+ return started;
+ }
+
+
+ /**
* Get the delay between the invocation of the backgroundProcess method on
* this container and its children. Child containers will not be invoked
* if their delay value is not negative (which would mean they are using
Modified: trunk/java/org/apache/catalina/core/StandardContextValve.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardContextValve.java 2008-04-21 16:09:30 UTC
(rev 589)
+++ trunk/java/org/apache/catalina/core/StandardContextValve.java 2008-04-22 16:06:47 UTC
(rev 590)
@@ -140,6 +140,14 @@
String requestURI = request.getDecodedRequestURI();
notFound(requestURI, response);
return;
+ } else if (!wrapper.isStarted()) {
+ // May be as a result of a reload, try and find the new wrapper
+ wrapper = (Wrapper) container.findChild(wrapper.getName());
+ if (wrapper == null) {
+ String requestURI = request.getDecodedRequestURI();
+ notFound(requestURI, response);
+ return;
+ }
}
// Normal request processing
Modified: trunk/java/org/apache/catalina/startup/ContextConfig.java
===================================================================
--- trunk/java/org/apache/catalina/startup/ContextConfig.java 2008-04-21 16:09:30 UTC (rev
589)
+++ trunk/java/org/apache/catalina/startup/ContextConfig.java 2008-04-22 16:06:47 UTC (rev
590)
@@ -339,10 +339,6 @@
long t1=System.currentTimeMillis();
- if (webDigester == null){
- webDigester = createWebDigester();
- }
-
URL url=null;
// Process the application web.xml file
synchronized (webDigester) {
@@ -624,10 +620,6 @@
+ " " + defaultWebXml + " " + file , e);
}
- if (webDigester == null){
- webDigester = createWebDigester();
- }
-
if (stream != null) {
processDefaultWebConfig(webDigester, stream, source);
webRuleSet.recycle();
@@ -786,9 +778,6 @@
if (source == null)
return;
- if (contextDigester == null){
- contextDigester = createContextDigester();
- }
synchronized (contextDigester) {
try {
source.setByteStream(stream);
@@ -997,6 +986,16 @@
protected void init() {
// Called from StandardContext.init()
+ if (webDigester == null){
+ webDigester = createWebDigester();
+ webDigester.getParser();
+ }
+
+ if (contextDigester == null){
+ contextDigester = createContextDigester();
+ contextDigester.getParser();
+ }
+
if (log.isDebugEnabled())
log.debug(sm.getString("contextConfig.init"));
context.setConfigured(false);
Modified: trunk/java/org/apache/el/lang/ELSupport.java
===================================================================
--- trunk/java/org/apache/el/lang/ELSupport.java 2008-04-21 16:09:30 UTC (rev 589)
+++ trunk/java/org/apache/el/lang/ELSupport.java 2008-04-22 16:06:47 UTC (rev 590)
@@ -225,9 +225,15 @@
if (number instanceof BigDecimal) {
return ((BigDecimal) number).toBigInteger();
}
+ if (number instanceof BigInteger) {
+ return new BigInteger(number.toString());
+ }
return BigInteger.valueOf(number.longValue());
}
if (BigDecimal.class.equals(type)) {
+ if (number instanceof BigDecimal) {
+ return new BigDecimal(number.toString());
+ }
if (number instanceof BigInteger) {
return new BigDecimal((BigInteger) number);
}
@@ -336,7 +342,8 @@
public final static Object coerceToType(final Object obj, final Class type)
throws IllegalArgumentException {
- if (type == null || Object.class.equals(type)) {
+ if (type == null || Object.class.equals(type) ||
+ type.equals(obj.getClass())) {
return obj;
}
if (String.class.equals(type)) {
Modified: trunk/java/org/apache/jasper/compiler/AntCompiler.java
===================================================================
--- trunk/java/org/apache/jasper/compiler/AntCompiler.java 2008-04-21 16:09:30 UTC (rev
589)
+++ trunk/java/org/apache/jasper/compiler/AntCompiler.java 2008-04-22 16:06:47 UTC (rev
590)
@@ -175,8 +175,8 @@
if(endorsed != null) {
Javac.ImplementationSpecificArgument endorsedArg =
javac.createCompilerArg();
- endorsedArg.setLine("-J-Djava.endorsed.dirs="+endorsed);
- info.append(" endorsed dir=" + endorsed + "\n");
+ endorsedArg.setLine("-J-Djava.endorsed.dirs=" +
quotePathList(endorsed));
+ info.append(" endorsed dir=" + quotePathList(endorsed) +
"\n");
} else {
info.append(" no endorsed dirs specified\n");
}
@@ -276,6 +276,26 @@
}
+ private String quotePathList(String list) {
+ StringBuffer result = new StringBuffer(list.length() + 10);
+ StringTokenizer st = new StringTokenizer(list, File.pathSeparator);
+ while (st.hasMoreTokens()) {
+ String token = st.nextToken();
+ if (token.indexOf(' ') == -1) {
+ result.append(token);
+ } else {
+ result.append('\"');
+ result.append(token);
+ result.append('\"');
+ }
+ if (st.hasMoreTokens()) {
+ result.append(File.pathSeparatorChar);
+ }
+ }
+ return result.toString();
+ }
+
+
protected static class SystemLogHandler extends PrintStream {
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-04-21 16:09:30 UTC (rev 589)
+++ trunk/webapps/docs/changelog.xml 2008-04-22 16:06:47 UTC (rev 590)
@@ -71,6 +71,13 @@
Add system properties for JBoss default allowing not starting the context in
init, and set
the configClass field. (remm)
</fix>
+ <fix>
+ <bug>43683</bug>: Need to identify new wrapper for queued request
after reload. (remm)
+ </fix>
+ <fix>
+ <bug>29936</bug>: In some circumstances, Tomcat would use the parser
from a webapp
+ to parse web.xml and possibly context.xml files. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
@@ -129,6 +136,13 @@
<fix>
Make number types handling more flexible in EL. (markt)
</fix>
+ <fix>
+ <bug>43656</bug>: coerceToType() modified some values, and additional
numeric type fixes.
+ Patch provided by Nils Eckert. (markt)
+ </fix>
+ <fix>
+ <bug>31257</bug>: Quote endorsed dirs if they contain a space.
(markt)
+ </fix>
</changelog>
</subsection>
</section>
Show replies by date