svn commit: r1831618 - in /tomcat/trunk: java/org/apache/catalina/core/StandardContext.java java/org/apache/catalina/loader/WebappClassLoaderBase.java webapps/docs/changelog.xml webapps/docs/config/co

2018-05-15 Thread markt
Author: markt
Date: Tue May 15 10:26:30 2018
New Revision: 1831618

URL: http://svn.apache.org/viewvc?rev=1831618&view=rev
Log:
Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=50175
Add a new attribute to the standard context implementation, 
skipMemoryLeakChecksOnJvmShutdown, that allows the user to configure Tomcat to 
skip the memory leak checks usually performed during web application stop if 
that stop is triggered by a JVM shutdown.

Modified:
tomcat/trunk/java/org/apache/catalina/core/StandardContext.java
tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoaderBase.java
tomcat/trunk/webapps/docs/changelog.xml
tomcat/trunk/webapps/docs/config/context.xml

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardContext.java?rev=1831618&r1=1831617&r2=1831618&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/core/StandardContext.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardContext.java Tue May 15 
10:26:30 2018
@@ -743,6 +743,12 @@ public class StandardContext extends Con
 private boolean clearReferencesObjectStreamClassCaches = true;
 
 /**
+ * Should Tomcat skip the memory leak checks when the web application is
+ * stopped as part of the process of shutting down the JVM?
+ */
+private boolean skipMemoryLeakChecksOnJvmShutdown = false;
+
+/**
  * Should the effective web.xml be logged when the context starts?
  */
 private boolean logEffectiveWebXml = false;
@@ -2691,6 +2697,16 @@ public class StandardContext extends Con
 }
 
 
+public boolean getSkipMemoryLeakChecksOnJvmShutdown() {
+return skipMemoryLeakChecksOnJvmShutdown;
+}
+
+
+public void setSkipMemoryLeakChecksOnJvmShutdown(boolean 
skipMemoryLeakChecksOnJvmShutdown) {
+this.skipMemoryLeakChecksOnJvmShutdown = 
skipMemoryLeakChecksOnJvmShutdown;
+}
+
+
 public Boolean getFailCtxIfServletStartFails() {
 return failCtxIfServletStartFails;
 }
@@ -4951,6 +4967,8 @@ public class StandardContext extends Con
 getClearReferencesHttpClientKeepAliveThread());
 
setClassLoaderProperty("clearReferencesObjectStreamClassCaches",
 getClearReferencesObjectStreamClassCaches());
+setClassLoaderProperty("skipMemoryLeakChecksOnJvmShutdown",
+getSkipMemoryLeakChecksOnJvmShutdown());
 
 // By calling unbindThread and bindThread in a row, we setup 
the
 // current Thread CCL to be the webapp classloader

Modified: 
tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoaderBase.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoaderBase.java?rev=1831618&r1=1831617&r2=1831618&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoaderBase.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoaderBase.java Tue 
May 15 10:26:30 2018
@@ -368,6 +368,12 @@ public abstract class WebappClassLoaderB
 private boolean clearReferencesObjectStreamClassCaches = true;
 
 /**
+ * Should Tomcat skip the memory leak checks when the web application is
+ * stopped as part of the process of shutting down the JVM?
+ */
+private boolean skipMemoryLeakChecksOnJvmShutdown = false;
+
+/**
  * Holds the class file transformers decorating this class loader. The
  * CopyOnWriteArrayList is thread safe. It is expensive on writes, but
  * those should be rare. It is very fast on reads, since synchronization
@@ -613,6 +619,16 @@ public abstract class WebappClassLoaderB
 }
 
 
+public boolean getSkipMemoryLeakChecksOnJvmShutdown() {
+return skipMemoryLeakChecksOnJvmShutdown;
+}
+
+
+public void setSkipMemoryLeakChecksOnJvmShutdown(boolean 
skipMemoryLeakChecksOnJvmShutdown) {
+this.skipMemoryLeakChecksOnJvmShutdown = 
skipMemoryLeakChecksOnJvmShutdown;
+}
+
+
 // --- Reloader Methods
 
 /**
@@ -1524,6 +1540,21 @@ public abstract class WebappClassLoaderB
  */
 protected void clearReferences() {
 
+// If the JVM is shutting down, skip the memory leak checks
+if (skipMemoryLeakChecksOnJvmShutdown
+&& !resources.getContext().getParent().getState().isAvailable()) {
+// During reloading / redeployment the parent is expected to be
+// available. Parent is not available so this might be a JVM
+// shutdown.
+try {
+Thread dummyHook = new Thread();
+Runtime.getRuntime().addShutdownHook(dummyHook);
+Runtime.getRuntime().rem

[Bug 50175] Enhance memory leak detection by selectively applying methods [PATCH?]

2018-05-15 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=50175

Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #8 from Mark Thomas  ---
Implemented in trunk for 9.0.9 onwards.

-- 
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



[Bug 62376] New: PropertyNotFoundException since 8.5.25

2018-05-15 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=62376

Bug ID: 62376
   Summary: PropertyNotFoundException since 8.5.25
   Product: Tomcat 8
   Version: 8.5.x-trunk
  Hardware: PC
Status: NEW
  Severity: normal
  Priority: P2
 Component: EL
  Assignee: dev@tomcat.apache.org
  Reporter: msadow...@novomind.com
  Target Milestone: 

Upgrading from Tomcat 8.5.24 to 8.5.31 we encountered a lot of
PropertyNotFoundException's. I nailed it down to this change: 

https://github.com/apache/tomcat/commit/b7ce5679b9e6a073dadbc31e6ecde12ad1e0ede8#diff-5dfeea95029bca0c6f37f20eeb4940a4

With this change you now compare the paramCount with the passed values which
didn't happen before.
I believe that line 186 should be: "if (m.isVarArgs() ...)" (no "!").

We only see these errors when using f:ajax or p:ajax wrapped by composite
components which define the listener as an attribute. Perhaps my issue in
Primefaces can help: https://github.com/primefaces/primefaces/issues/3659

When debugging this issue I also found, that Mojarra
(https://github.com/javaserverfaces/mojarra/blob/2.2.16/jsf-ri/src/main/java/com/sun/faces/facelets/tag/jsf/core/AjaxHandler.java#L460)
and Primefaces
(https://github.com/primefaces/primefaces/blob/master/src/main/java/org/primefaces/behavior/ajax/AjaxBehaviorListenerImpl.java#L64)
are expecting a "MethodNotFoundException" but a "PropertyNotFoundException" is
thrown because of
(https://github.com/javaserverfaces/mojarra/blob/2.2.16/jsf-ri/src/main/java/com/sun/faces/facelets/el/ContextualCompositeMethodExpression.java#L241)

-- 
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



[Bug 62376] PropertyNotFoundException since 8.5.25

2018-05-15 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=62376

Mark Thomas  changed:

   What|Removed |Added

 OS||All

--- Comment #1 from Mark Thomas  ---
Line 186 looks correct to me. It is checking that, for non-vararg methods where
the parameter values are provided that the number of parameters matches the
number of values. For a non-vararg method they should be equal.

A test case that we could run would be helpful. Ideally as a Tomcat unit test
but we should be able to work with anything that reproduces the issue.

-- 
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



[GUMP@vmgump-vm3]: Project tomcat-trunk-test-nio2 (in module tomcat-trunk) failed

2018-05-15 Thread Bill Barker
To whom it may engage...

This is an automated request, but not an unsolicited one. For 
more information please visit http://gump.apache.org/nagged.html, 
and/or contact the folk at gene...@gump.apache.org.

Project tomcat-trunk-test-nio2 has an issue affecting its community integration.
This issue affects 1 projects,
 and has been outstanding for 8 runs.
The current state of this project is 'Failed', with reason 'Build Failed'.
For reference only, the following projects are affected by this:
- tomcat-trunk-test-nio2 :  Tomcat 9.x, a web server implementing the Java 
Servlet 4.0,
...


Full details are available at:
http://vmgump-vm3.apache.org/tomcat-trunk/tomcat-trunk-test-nio2/index.html

That said, some information snippets are provided here.

The following annotations (debug/informational/warning/error messages) were 
provided:
 -INFO- Failed with reason build failed
 -INFO- Project Reports in: 
/srv/gump/public/workspace/tomcat-trunk/output/logs-NIO2
 -INFO- Project Reports in: 
/srv/gump/public/workspace/tomcat-trunk/output/test-tmp-NIO2/logs
 -WARNING- No directory 
[/srv/gump/public/workspace/tomcat-trunk/output/test-tmp-NIO2/logs]



The following work was performed:
http://vmgump-vm3.apache.org/tomcat-trunk/tomcat-trunk-test-nio2/gump_work/build_tomcat-trunk_tomcat-trunk-test-nio2.html
Work Name: build_tomcat-trunk_tomcat-trunk-test-nio2 (Type: Build)
Work ended in a state of : Failed
Elapsed: 23 mins 37 secs
Command Line: /usr/lib/jvm/java-8-oracle/bin/java -Djava.awt.headless=true 
-Dbuild.sysclasspath=only org.apache.tools.ant.Main 
-Dgump.merge=/srv/gump/public/gump/work/merge.xml 
-Djunit.jar=/srv/gump/public/workspace/junit/target/junit-4.13-SNAPSHOT.jar 
-Djava.net.preferIPv4Stack=/srv/gump/public/workspace/tomcat-trunk/true 
-Dobjenesis.jar=/srv/gump/public/workspace/objenesis/main/target/objenesis-2.7-SNAPSHOT.jar
 -Dtest.reports=output/logs-NIO2 -Dexecute.test.nio2=true 
-Dexamples.sources.skip=true 
-Dbase.path=/srv/gump/public/workspace/tomcat-trunk/tomcat-build-libs 
-Djdt.jar=/srv/gump/packages/eclipse/plugins/R-4.7.3a-201803300640/ecj-4.7.3a.jar
 -Dtest.relaxTiming=true 
-Dcommons-daemon.jar=/srv/gump/public/workspace/apache-commons/daemon/target/commons-daemon-1.1.1-SNAPSHOT.jar
 -Dtest.temp=output/test-tmp-NIO2 -Dtest.accesslog=true 
-Dexecute.test.nio=false 
-Dtest.openssl.path=/srv/gump/public/workspace/openssl-master/dest-20180516/bin/openssl
 -Dexecute.test.apr=false -Dtest.excludeP
 erformance=true 
-Deasymock.jar=/srv/gump/public/workspace/easymock/core/target/easymock-3.7-SNAPSHOT.jar
 -Dhamcrest.jar=/srv/gump/packages/hamcrest/hamcrest-core-1.3.jar 
-Dcglib.jar=/srv/gump/packages/cglib/cglib-nodep-2.2.jar test 
[Working Directory: /srv/gump/public/workspace/tomcat-trunk]
CLASSPATH: 
/usr/lib/jvm/java-8-oracle/lib/tools.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/webapps/examples/WEB-INF/classes:/srv/gump/public/workspace/tomcat-trunk/output/testclasses:/srv/gump/public/workspace/ant/dist/lib/ant.jar:/srv/gump/public/workspace/ant/dist/lib/ant-launcher.jar:/srv/gump/public/workspace/ant/dist/lib/ant-jmf.jar:/srv/gump/public/workspace/ant/dist/lib/ant-junit.jar:/srv/gump/public/workspace/ant/dist/lib/ant-junit4.jar:/srv/gump/public/workspace/ant/dist/lib/ant-swing.jar:/srv/gump/public/workspace/ant/dist/lib/ant-apache-resolver.jar:/srv/gump/public/workspace/ant/dist/lib/ant-apache-xalan2.jar:/srv/gump/public/workspace/xml-commons/java/build/resolver.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/bin/bootstrap.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/bin/tomcat-juli.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/annotations-api.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/servlet-api.ja
 
r:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/jsp-api.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/el-api.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/websocket-api.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/jaspic-api.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/catalina.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/catalina-ant.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/catalina-storeconfig.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/tomcat-coyote.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/jasper.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/jasper-el.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/catalina-tribes.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/catalina-ha.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/tomcat-api.jar:/srv/gump/public/workspace/tomcat-trunk/output/bu
 
ild/lib/tomcat-jni.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/tomcat-util.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/tomcat-util-scan.jar:/srv/gump/public/workspace/tomcat-trunk/output/bui

[Bug 60362] Missing reason phrase in response

2018-05-15 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=60362

--- Comment #72 from Ralf Hauser  ---
First, there are many error conditions for which no precise 4xx or 5xx code is
defined. So in this way, the reason might be helpful.

While I understand that an html browser can display more hints on the error in
the content instead of the header, how should other http dependent clients do
that such as webDav clients (winscp.net, cyberduck.io, ...)?

Just for curiosity: how should webDav clients work with Http/2 to display
tailored error messages to the end-user ?

-- 
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