DO NOT REPLY [Bug 50448] StandardSession.expire causes IllegalStateException: getCreationTime: Session already invalidated

2010-12-11 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=50448

--- Comment #2 from Martin Grotzke martin.grot...@googlemail.com 2010-12-11 
08:13:04 EST ---
Thanx for the fix, now all tests for memcached-session-manager are green! Happy
now, looking forward to tomcat 7.0.6. Keep on the great work!

-- 
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: r1044692 - in /tomcat/trunk/java/org/apache: catalina/core/AsyncContextImpl.java coyote/AsyncContextCallback.java coyote/AsyncStateMachine.java coyote/ajp/AbstractAjpProcessor.java coyote/

2010-12-11 Thread markt
Author: markt
Date: Sat Dec 11 18:27:15 2010
New Revision: 1044692

URL: http://svn.apache.org/viewvc?rev=1044692view=rev
Log:
Coyote should not depend on Catalina

Added:
tomcat/trunk/java/org/apache/coyote/AsyncContextCallback.java   (with props)
Modified:
tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java
tomcat/trunk/java/org/apache/coyote/AsyncStateMachine.java
tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java
tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java

Modified: tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java?rev=1044692r1=1044691r2=1044692view=diff
==
--- tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java Sat Dec 11 
18:27:15 2010
@@ -43,6 +43,7 @@ import org.apache.catalina.Context;
 import org.apache.catalina.Globals;
 import org.apache.catalina.connector.Request;
 import org.apache.coyote.ActionCode;
+import org.apache.coyote.AsyncContextCallback;
 import org.apache.coyote.RequestInfo;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
@@ -52,7 +53,7 @@ import org.apache.tomcat.InstanceManager
  * @author fhanik
  *
  */
-public class AsyncContextImpl implements AsyncContext {
+public class AsyncContextImpl implements AsyncContext, AsyncContextCallback {
 
 private static final Log log = LogFactory.getLog(AsyncContextImpl.class);
 

Added: tomcat/trunk/java/org/apache/coyote/AsyncContextCallback.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/AsyncContextCallback.java?rev=1044692view=auto
==
--- tomcat/trunk/java/org/apache/coyote/AsyncContextCallback.java (added)
+++ tomcat/trunk/java/org/apache/coyote/AsyncContextCallback.java Sat Dec 11 
18:27:15 2010
@@ -0,0 +1,28 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the License); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an AS IS BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.coyote;
+
+/**
+ * Provides a mechanism for the Coyote connectors to signal to a
+ * {...@link javax.servlet.AsyncContext} implementation that an action, such as
+ * firing event listeners needs to be taken. It is implemented in this manner
+ * so that the org.apache.coyote package does not have a dependency on the
+ * org.apache.coyote package.  
+ */
+public interface AsyncContextCallback {
+public void fireOnComplete();
+}

Propchange: tomcat/trunk/java/org/apache/coyote/AsyncContextCallback.java
--
svn:eol-style = native

Modified: tomcat/trunk/java/org/apache/coyote/AsyncStateMachine.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/AsyncStateMachine.java?rev=1044692r1=1044691r2=1044692view=diff
==
--- tomcat/trunk/java/org/apache/coyote/AsyncStateMachine.java (original)
+++ tomcat/trunk/java/org/apache/coyote/AsyncStateMachine.java Sat Dec 11 
18:27:15 2010
@@ -19,7 +19,6 @@ package org.apache.coyote;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 
-import org.apache.catalina.core.AsyncContextImpl;
 import org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState;
 import org.apache.tomcat.util.res.StringManager;
 
@@ -96,7 +95,7 @@ public class AsyncStateMachine {
 
 private volatile AsyncState state = AsyncState.DISPATCHED;
 // Need this to fire listener on complete
-private AsyncContextImpl asyncCtxt = null;
+private AsyncContextCallback asyncCtxt = null;
 private Processor processor;
 
 
@@ -122,7 +121,7 @@ public class AsyncStateMachine {
 }
 
 
-public synchronized void asyncStart(AsyncContextImpl asyncCtxt) {
+public synchronized void asyncStart(AsyncContextCallback asyncCtxt) {
 if (state == AsyncState.DISPATCHED) {
 state = AsyncState.STARTING;
 this.asyncCtxt = asyncCtxt;

Modified: 

Re: svn commit: r1044145 - in /tomcat/trunk: java/org/apache/catalina/core/ java/org/apache/tomcat/util/threads/ test/org/apache/tomcat/util/threads/

2010-12-11 Thread Mark Thomas
On 09/12/2010 22:11, slaur...@apache.org wrote:
 Author: slaurent
 Date: Thu Dec  9 22:11:27 2010
 New Revision: 1044145
 
 URL: http://svn.apache.org/viewvc?rev=1044145view=rev
 Log:
 bug 49159: Improve ThreadLocal memory leak clean-up 
 https://issues.apache.org/bugzilla/show_bug.cgi?id=49159

-1. This breaks at least one unit test.

Mark

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1044708 - /tomcat/trunk/java/javax/el/CompositeELResolver.java

2010-12-11 Thread markt
Author: markt
Date: Sat Dec 11 20:36:29 2010
New Revision: 1044708

URL: http://svn.apache.org/viewvc?rev=1044708view=rev
Log:
javax.el should not depend on javax.servlet.jsp.el

Modified:
tomcat/trunk/java/javax/el/CompositeELResolver.java

Modified: tomcat/trunk/java/javax/el/CompositeELResolver.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/CompositeELResolver.java?rev=1044708r1=1044707r2=1044708view=diff
==
--- tomcat/trunk/java/javax/el/CompositeELResolver.java (original)
+++ tomcat/trunk/java/javax/el/CompositeELResolver.java Sat Dec 11 20:36:29 2010
@@ -21,8 +21,6 @@ import java.beans.FeatureDescriptor;
 import java.util.Iterator;
 import java.util.NoSuchElementException;
 
-import javax.servlet.jsp.el.ScopedAttributeELResolver;
-
 public class CompositeELResolver extends ELResolver {
 
 private int size;
@@ -120,8 +118,10 @@ public class CompositeELResolver extends
 for (int i = 0; i  sz; i++) {
 type = this.resolvers[i].getType(context, base, property);
 if (context.isPropertyResolved()) {
-if (resolvers[i] instanceof ScopedAttributeELResolver) {
+if (resolvers[i].getClass().getName().equals(
+javax.servlet.jsp.el.ScopedAttributeELResolver)) {
 // Special case since this will always return Object.class
+// for type
 Object value =
 resolvers[i].getValue(context, base, property);
 if (value != null) {



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1044710 - in /tomcat/trunk: ./ res/checkstyle/

2010-12-11 Thread markt
Author: markt
Date: Sat Dec 11 20:38:42 2010
New Revision: 1044710

URL: http://svn.apache.org/viewvc?rev=1044710view=rev
Log:
Add import-control checks to Checkstyle (these found the recent dependency 
issues)
Move checkstyle config to res/checkstyle to stop it cluttering up the root

Added:
tomcat/trunk/res/checkstyle/
tomcat/trunk/res/checkstyle/checkstyle.xml
  - copied unchanged from r1044249, tomcat/trunk/checkstyle.xml
tomcat/trunk/res/checkstyle/javax-checkstyle.xml   (with props)
tomcat/trunk/res/checkstyle/javax-import-control.xml   (with props)
tomcat/trunk/res/checkstyle/org-checkstyle.xml   (with props)
tomcat/trunk/res/checkstyle/org-import-control.xml   (with props)
Removed:
tomcat/trunk/checkstyle.xml
Modified:
tomcat/trunk/build.xml

Modified: tomcat/trunk/build.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/build.xml?rev=1044710r1=1044709r2=1044710view=diff
==
--- tomcat/trunk/build.xml (original)
+++ tomcat/trunk/build.xml Sat Dec 11 20:38:42 2010
@@ -424,7 +424,7 @@
   target name=validate depends=download-validate if=${execute.validate}
 taskdef resource=checkstyletask.properties
  classpath=${checkstyle.jar} /
-checkstyle config=checkstyle.xml
+checkstyle config=res/checkstyle/checkstyle.xml
   fileset dir=. 
 patternset refid=text.files /
 exclude name=.*/**/
@@ -438,6 +438,18 @@
 exclude name=**/tomcat-deps/**/
   /fileset
 /checkstyle
+!-- javax package checks --
+checkstyle config=res/checkstyle/javax-checkstyle.xml
+  fileset dir=java/javax 
+include name=**/*.java/
+  /fileset
+/checkstyle
+!-- org package checks --
+checkstyle config=res/checkstyle/org-checkstyle.xml
+  fileset dir=java/org 
+include name=**/*.java/
+  /fileset
+/checkstyle
   /target
 
   target name=compile depends=build-prepare,download-compile,validate

Added: tomcat/trunk/res/checkstyle/javax-checkstyle.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/res/checkstyle/javax-checkstyle.xml?rev=1044710view=auto
==
--- tomcat/trunk/res/checkstyle/javax-checkstyle.xml (added)
+++ tomcat/trunk/res/checkstyle/javax-checkstyle.xml Sat Dec 11 20:38:42 2010
@@ -0,0 +1,33 @@
+?xml version=1.0?
+!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the License); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an AS IS BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+--
+!DOCTYPE module PUBLIC
+-//Puppy Crawl//DTD Check Configuration 1.2//EN
+http://www.puppycrawl.com/dtds/configuration_1_2.dtd;
+module name=Checker
+  !-- When adding checks, keep to the order checks are listed under 
--
+  !-- 'Standard Checks' in the Checkstyle documentation:
--
+  !-- http://checkstyle.sourceforge.net/config_coding.html  
--
+
+  !-- Specific checks for javax.* packages --
+
+  module name=TreeWalker
+module name=ImportControl
+  property name=file value=res/checkstyle/javax-import-control.xml/
+/module
+  /module
+/module
\ No newline at end of file

Propchange: tomcat/trunk/res/checkstyle/javax-checkstyle.xml
--
svn:eol-style = native

Added: tomcat/trunk/res/checkstyle/javax-import-control.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/res/checkstyle/javax-import-control.xml?rev=1044710view=auto
==
--- tomcat/trunk/res/checkstyle/javax-import-control.xml (added)
+++ tomcat/trunk/res/checkstyle/javax-import-control.xml Sat Dec 11 20:38:42 
2010
@@ -0,0 +1,50 @@
+?xml version=1.0?
+!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the License); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in 

svn commit: r1044716 - in /tomcat/trunk/res/checkstyle: javax-checkstyle.xml org-checkstyle.xml

2010-12-11 Thread markt
Author: markt
Date: Sat Dec 11 20:58:28 2010
New Revision: 1044716

URL: http://svn.apache.org/viewvc?rev=1044716view=rev
Log:
Get the checkstyle configs to play nicely with Ant and the Eclipse plug-in

Modified:
tomcat/trunk/res/checkstyle/javax-checkstyle.xml
tomcat/trunk/res/checkstyle/org-checkstyle.xml

Modified: tomcat/trunk/res/checkstyle/javax-checkstyle.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/res/checkstyle/javax-checkstyle.xml?rev=1044716r1=1044715r2=1044716view=diff
==
--- tomcat/trunk/res/checkstyle/javax-checkstyle.xml (original)
+++ tomcat/trunk/res/checkstyle/javax-checkstyle.xml Sat Dec 11 20:58:28 2010
@@ -27,7 +27,7 @@
 
   module name=TreeWalker
 module name=ImportControl
-  property name=file value=res/checkstyle/javax-import-control.xml/
+  property name=file 
value=${basedir}/res/checkstyle/javax-import-control.xml/
 /module
   /module
 /module
\ No newline at end of file

Modified: tomcat/trunk/res/checkstyle/org-checkstyle.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/res/checkstyle/org-checkstyle.xml?rev=1044716r1=1044715r2=1044716view=diff
==
--- tomcat/trunk/res/checkstyle/org-checkstyle.xml (original)
+++ tomcat/trunk/res/checkstyle/org-checkstyle.xml Sat Dec 11 20:58:28 2010
@@ -27,7 +27,7 @@
 
   module name=TreeWalker
 module name=ImportControl
-  property name=file value=res/checkstyle/org-import-control.xml/
+  property name=file 
value=${basedir}/res/checkstyle/org-import-control.xml/
 /module
   /module
 /module
\ 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



svn commit: r1044723 - in /tomcat/trunk: java/org/apache/tomcat/util/net/ java/org/apache/tomcat/util/net/jsse/ res/checkstyle/

2010-12-11 Thread markt
Author: markt
Date: Sat Dec 11 21:14:45 2010
New Revision: 1044723

URL: http://svn.apache.org/viewvc?rev=1044723view=rev
Log:
o.a.tomcat.util.net should not depend on o.a.catalina

Added:
tomcat/trunk/java/org/apache/tomcat/util/net/Constants.java   (with props)
Modified:
tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java
tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java
tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java
tomcat/trunk/res/checkstyle/org-import-control.xml

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java?rev=1044723r1=1044722r2=1044723view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java Sat Dec 
11 21:14:45 2010
@@ -28,7 +28,6 @@ import java.util.concurrent.TimeUnit;
 
 import javax.net.ssl.KeyManagerFactory;
 
-import org.apache.catalina.Globals;
 import org.apache.coyote.RequestGroupInfo;
 import org.apache.juli.logging.Log;
 import org.apache.tomcat.util.IntrospectionUtils;
@@ -586,7 +585,8 @@ public abstract class AbstractEndpoint {
 private String keystoreFile = System.getProperty(user.home)+/.keystore;
 public String getKeystoreFile() { return keystoreFile;}
 public void setKeystoreFile(String s ) {
-String file = adjustRelativePath(s, 
System.getProperty(Globals.CATALINA_BASE_PROP));
+String file = adjustRelativePath(s,
+System.getProperty(Constants.CATALINA_BASE_PROP));
 this.keystoreFile = file;
 }
 
@@ -633,7 +633,8 @@ public abstract class AbstractEndpoint {
 private String truststoreFile = 
System.getProperty(javax.net.ssl.trustStore);
 public String getTruststoreFile() {return truststoreFile;}
 public void setTruststoreFile(String s) {
-String file = adjustRelativePath(s, 
System.getProperty(Globals.CATALINA_BASE_PROP));
+String file = adjustRelativePath(s,
+System.getProperty(Constants.CATALINA_BASE_PROP));
 this.truststoreFile = file;
 }
 

Added: tomcat/trunk/java/org/apache/tomcat/util/net/Constants.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/Constants.java?rev=1044723view=auto
==
--- tomcat/trunk/java/org/apache/tomcat/util/net/Constants.java (added)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/Constants.java Sat Dec 11 
21:14:45 2010
@@ -0,0 +1,33 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the License); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an AS IS BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.tomcat.util.net;
+
+public class Constants {
+
+/**
+ * Name of the system property containing
+ * the tomcat instance installation path
+ */
+public static final String CATALINA_BASE_PROP = catalina.base;
+
+
+/**
+ * Has security been turned on?
+ */
+public static final boolean IS_SECURITY_ENABLED =
+(System.getSecurityManager() != null);
+}

Propchange: tomcat/trunk/java/org/apache/tomcat/util/net/Constants.java
--
svn:eol-style = native

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java?rev=1044723r1=1044722r2=1044723view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java Sat Dec 11 
21:14:45 2010
@@ -28,7 +28,6 @@ import java.util.Iterator;
 import java.util.concurrent.ConcurrentLinkedQueue;
 import java.util.concurrent.RejectedExecutionException;
 
-import org.apache.catalina.Globals;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.ExceptionUtils;
@@ -508,7 +507,7 @@ public class JIoEndpoint extends 

svn commit: r1044727 - in /tomcat/trunk: java/org/apache/coyote/ajp/ java/org/apache/coyote/http11/ java/org/apache/tomcat/util/net/ res/checkstyle/

2010-12-11 Thread markt
Author: markt
Date: Sat Dec 11 21:35:18 2010
New Revision: 1044727

URL: http://svn.apache.org/viewvc?rev=1044727view=rev
Log:
o.a.tomcat.util.net should not depend on o.a.coyote

Modified:
tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java
tomcat/trunk/java/org/apache/coyote/ajp/AjpProtocol.java
tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java
tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java
tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java
tomcat/trunk/res/checkstyle/org-import-control.xml

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java?rev=1044727r1=1044726r2=1044727view=diff
==
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java Sat Dec 11 
21:35:18 2010
@@ -154,7 +154,7 @@ public class AjpAprProtocol extends Abst
 }
 
 @Override
-public RequestGroupInfo getGlobal() {
+public Object getGlobal() {
 return global;
 }
 

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpProtocol.java?rev=1044727r1=1044726r2=1044727view=diff
==
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpProtocol.java Sat Dec 11 
21:35:18 2010
@@ -141,7 +141,7 @@ public class AjpProtocol extends Abstrac
 }
 
 @Override
-public RequestGroupInfo getGlobal() {
+public Object getGlobal() {
 return global;
 }
 

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java?rev=1044727r1=1044726r2=1044727view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java Sat Dec 
11 21:35:18 2010
@@ -245,7 +245,7 @@ public class Http11AprProtocol extends A
 }
 
 @Override
-public RequestGroupInfo getGlobal() {
+public Object getGlobal() {
 return global;
 }
 

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java?rev=1044727r1=1044726r2=1044727view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java Sat Dec 
11 21:35:18 2010
@@ -205,7 +205,7 @@ public class Http11NioProtocol extends A
 }
 
 @Override
-public RequestGroupInfo getGlobal() {
+public Object getGlobal() {
 return global;
 }
 

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java?rev=1044727r1=1044726r2=1044727view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java Sat Dec 11 
21:35:18 2010
@@ -139,7 +139,7 @@ public class Http11Protocol extends Abst
 }
 
 @Override
-public RequestGroupInfo getGlobal() {
+public Object getGlobal() {
 return global;
 }
 

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java?rev=1044727r1=1044726r2=1044727view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java Sat Dec 
11 21:35:18 2010
@@ -28,7 +28,6 @@ import java.util.concurrent.TimeUnit;
 
 import javax.net.ssl.KeyManagerFactory;
 
-import org.apache.coyote.RequestGroupInfo;
 import org.apache.juli.logging.Log;
 import org.apache.tomcat.util.IntrospectionUtils;
 import org.apache.tomcat.util.net.jsse.JSSESocketFactory;
@@ -60,7 +59,7 @@ public abstract class AbstractEndpoint {
 /**
  * Obtain the GlobalRequestProcessor associated with the handler.
  */
- 

svn commit: r1044729 - in /tomcat/trunk: java/org/apache/tomcat/jni/Library.java res/checkstyle/org-import-control.xml

2010-12-11 Thread markt
Author: markt
Date: Sat Dec 11 21:48:22 2010
New Revision: 1044729

URL: http://svn.apache.org/viewvc?rev=1044729view=rev
Log:
o.a.tomcat.jni should not have any external dependencies
OK for o.a.naming to have dependencies

Modified:
tomcat/trunk/java/org/apache/tomcat/jni/Library.java
tomcat/trunk/res/checkstyle/org-import-control.xml

Modified: tomcat/trunk/java/org/apache/tomcat/jni/Library.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/jni/Library.java?rev=1044729r1=1044728r2=1044729view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/jni/Library.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/jni/Library.java Sat Dec 11 21:48:22 
2010
@@ -17,8 +17,6 @@
 
 package org.apache.tomcat.jni;
 
-import org.apache.tomcat.util.ExceptionUtils;
-
 /** Library
  *
  * @author Mladen Turk
@@ -44,8 +42,13 @@ public final class Library {
 System.loadLibrary(NAMES[i]);
 loaded = true;
 }
-catch (Throwable e) {
-ExceptionUtils.handleThrowable(e);
+catch (Throwable t) {
+if (t instanceof ThreadDeath) {
+throw (ThreadDeath) t;
+}
+if (t instanceof VirtualMachineError) {
+throw (VirtualMachineError) t;
+}
 String name = System.mapLibraryName(NAMES[i]);
 String path = System.getProperty(java.library.path);
 String sep = System.getProperty(path.separator);
@@ -53,12 +56,12 @@ public final class Library {
 for (int j=0; jpaths.length; j++) {
 java.io.File fd = new java.io.File(paths[j] , name);
 if (fd.exists()) {
-e.printStackTrace();
+t.printStackTrace();
 }
 }
 if ( i  0)
 err += , ;
-err +=  e.getMessage();
+err +=  t.getMessage();
 }
 if (loaded)
 break;

Modified: tomcat/trunk/res/checkstyle/org-import-control.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/res/checkstyle/org-import-control.xml?rev=1044729r1=1044728r2=1044729view=diff
==
--- tomcat/trunk/res/checkstyle/org-import-control.xml (original)
+++ tomcat/trunk/res/checkstyle/org-import-control.xml Sat Dec 11 21:48:22 2010
@@ -72,7 +72,6 @@
 allow pkg=javax.mail/
 allow pkg=javax.wsdl/
 allow pkg=org.apache.naming/
-!-- To remove? --
 allow class=org.apache.catalina.util.RequestUtil/
 allow class=org.apache.tomcat.util.http.FastHttpDateFormat/
   /subpackage
@@ -81,10 +80,7 @@
 subpackage name=buildutil
   allow pkg=org.apache.tools.ant/
 /subpackage
-subpackage name=jni
-  !-- To remove? --
-  allow class=org.apache.tomcat.util.ExceptionUtils/
-/subpackage
+subpackage name=jni/
 subpackage name=util
   allow pkg=org.apache.juli/
   allow pkg=org.apache.tomcat.jni/



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1044730 - in /tomcat/trunk/java/org/apache/catalina/tribes: membership/McastServiceImpl.java transport/nio/NioReceiver.java

2010-12-11 Thread markt
Author: markt
Date: Sat Dec 11 22:20:10 2010
New Revision: 1044730

URL: http://svn.apache.org/viewvc?rev=1044730view=rev
Log:
Tribes should only depend on JULI

Modified:

tomcat/trunk/java/org/apache/catalina/tribes/membership/McastServiceImpl.java
tomcat/trunk/java/org/apache/catalina/tribes/transport/nio/NioReceiver.java

Modified: 
tomcat/trunk/java/org/apache/catalina/tribes/membership/McastServiceImpl.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/membership/McastServiceImpl.java?rev=1044730r1=1044729r2=1044730view=diff
==
--- 
tomcat/trunk/java/org/apache/catalina/tribes/membership/McastServiceImpl.java 
(original)
+++ 
tomcat/trunk/java/org/apache/catalina/tribes/membership/McastServiceImpl.java 
Sat Dec 11 22:20:10 2010
@@ -36,7 +36,6 @@ import org.apache.catalina.tribes.Messag
 import org.apache.catalina.tribes.io.ChannelData;
 import org.apache.catalina.tribes.io.XByteBuffer;
 import org.apache.catalina.tribes.util.ExecutorFactory;
-import org.apache.tomcat.util.ExceptionUtils;
 
 /**
  * A bmembership/b implementation using simple multicast.
@@ -422,7 +421,12 @@ public class McastServiceImpl
 msgservice.messageReceived(data[i]);
 }
 } catch (Throwable t) {
-ExceptionUtils.handleThrowable(t);
+if (t instanceof ThreadDeath) {
+throw (ThreadDeath) t;
+}
+if (t instanceof VirtualMachineError) {
+throw (VirtualMachineError) t;
+}
 log.error(Unable to receive broadcast 
message.,t);
 }
 }

Modified: 
tomcat/trunk/java/org/apache/catalina/tribes/transport/nio/NioReceiver.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/transport/nio/NioReceiver.java?rev=1044730r1=1044729r2=1044730view=diff
==
--- tomcat/trunk/java/org/apache/catalina/tribes/transport/nio/NioReceiver.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/tribes/transport/nio/NioReceiver.java 
Sat Dec 11 22:20:10 2010
@@ -39,7 +39,6 @@ import org.apache.catalina.tribes.transp
 import org.apache.catalina.tribes.util.StringManager;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
-import org.apache.tomcat.util.ExceptionUtils;
 
 /**
  * @author Filip Hanik
@@ -318,9 +317,14 @@ public class NioReceiver extends Receive
 // ignore is normal at shutdown or stop listen socket
 } catch (java.nio.channels.CancelledKeyException nx) {
 log.warn(Replication client disconnected, error when polling 
key. Ignoring client.);
-} catch (Throwable x) {
-ExceptionUtils.handleThrowable(x);
-log.error(Unable to process request in NioReceiver, x);
+} catch (Throwable t) {
+if (t instanceof ThreadDeath) {
+throw (ThreadDeath) t;
+}
+if (t instanceof VirtualMachineError) {
+throw (VirtualMachineError) t;
+}
+log.error(Unable to process request in NioReceiver, t);
 }
 
 }



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1044731 - in /tomcat/trunk: res/checkstyle/ res/maven/ test/org/apache/tomcat/util/threads/

2010-12-11 Thread markt
Author: markt
Date: Sat Dec 11 22:21:02 2010
New Revision: 1044731

URL: http://svn.apache.org/viewvc?rev=1044731view=rev
Log:
TRy and sync up the deps in the POMs with what Checkstyle validates

Removed:
tomcat/trunk/test/org/apache/tomcat/util/threads/
Modified:
tomcat/trunk/res/checkstyle/org-import-control.xml
tomcat/trunk/res/maven/tomcat-api.pom
tomcat/trunk/res/maven/tomcat-catalina-ant.pom
tomcat/trunk/res/maven/tomcat-catalina-jmx-remote.pom
tomcat/trunk/res/maven/tomcat-catalina-ws.pom
tomcat/trunk/res/maven/tomcat-coyote.pom
tomcat/trunk/res/maven/tomcat-jasper.pom

Modified: tomcat/trunk/res/checkstyle/org-import-control.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/res/checkstyle/org-import-control.xml?rev=1044731r1=1044730r2=1044731view=diff
==
--- tomcat/trunk/res/checkstyle/org-import-control.xml (original)
+++ tomcat/trunk/res/checkstyle/org-import-control.xml Sat Dec 11 22:21:02 2010
@@ -43,7 +43,36 @@
 allow pkg=org.apache.juli/
 allow pkg=org.apache.naming/
 allow pkg=org.apache.tomcat/
-allow pkg=org.apache.tools.ant/
+subpackage name=ant
+  allow pkg=org.apache.tools.ant/
+  allow class=org.apache.tomcat.util.Base64/
+  disallow pkg=javax.annotation/
+  disallow pkg=javax.ejb/
+  disallow pkg=javax.persistence/
+  disallow pkg=javax.servlet/
+  disallow pkg=org.apache.coyote/
+  disallow pkg=org.apache.juli/
+  disallow pkg=org.apache.naming/
+/subpackage
+subpackage name=ha
+  disallow pkg=javax.annotation/
+  disallow pkg=javax.ejb/
+  disallow pkg=javax.persistence/
+  disallow pkg=org.apache.coyote/
+  disallow pkg=org.apache.naming/
+  allow pkg=org.apache.catalina.ha/
+/subpackage
+subpackage name=tribes
+  disallow pkg=javax.annotation/
+  disallow pkg=javax.ejb/
+  disallow pkg=javax.persistence/
+  disallow pkg=javax.servlet/
+  disallow pkg=org.apache.catalina/
+  disallow pkg=org.apache.coyote/
+  disallow pkg=org.apache.naming/
+  disallow pkg=org.apache.tomcat/
+  allow pkg=org.apache.catalina.tribes/
+/subpackage
   /subpackage
   subpackage name=coyote
 allow pkg=org.apache.coyote/
@@ -74,6 +103,8 @@
 allow pkg=org.apache.naming/
 allow class=org.apache.catalina.util.RequestUtil/
 allow class=org.apache.tomcat.util.http.FastHttpDateFormat/
+subpackage name=factory.webservices
+/subpackage
   /subpackage
   subpackage name=tomcat
 allow pkg=javax.servlet/

Modified: tomcat/trunk/res/maven/tomcat-api.pom
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/res/maven/tomcat-api.pom?rev=1044731r1=1044730r2=1044731view=diff
==
--- tomcat/trunk/res/maven/tomcat-api.pom (original)
+++ tomcat/trunk/res/maven/tomcat-api.pom Sat Dec 11 22:21:02 2010
@@ -21,4 +21,12 @@
   artifactIdtomcat-api/artifactId
   version@MAVEN.DEPLOY.VERSION@/version
   descriptionDefinition of interfaces shared by Catalina and 
Jasper/description
+  dependencies
+dependency
+  groupIdorg.apache.tomcat/groupId
+  artifactIdtomcat-servlet-api/artifactId
+  version@MAVEN.DEPLOY.VERSION@/version
+  scopecompile/scope
+/dependency
+  /dependencies
 /project

Modified: tomcat/trunk/res/maven/tomcat-catalina-ant.pom
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/res/maven/tomcat-catalina-ant.pom?rev=1044731r1=1044730r2=1044731view=diff
==
--- tomcat/trunk/res/maven/tomcat-catalina-ant.pom (original)
+++ tomcat/trunk/res/maven/tomcat-catalina-ant.pom Sat Dec 11 22:21:02 2010
@@ -30,18 +30,6 @@
 /dependency
 dependency
   groupIdorg.apache.tomcat/groupId
-  artifactIdtomcat-servlet-api/artifactId
-  version@MAVEN.DEPLOY.VERSION@/version
-  scopecompile/scope
-/dependency
-dependency
-  groupIdorg.apache.tomcat/groupId
-  artifactIdtomcat-juli/artifactId
-  version@MAVEN.DEPLOY.VERSION@/version
-  scopecompile/scope
-/dependency
-dependency
-  groupIdorg.apache.tomcat/groupId
   artifactIdtomcat-catalina/artifactId
   version@MAVEN.DEPLOY.VERSION@/version
   scopecompile/scope

Modified: tomcat/trunk/res/maven/tomcat-catalina-jmx-remote.pom
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/res/maven/tomcat-catalina-jmx-remote.pom?rev=1044731r1=1044730r2=1044731view=diff
==
--- tomcat/trunk/res/maven/tomcat-catalina-jmx-remote.pom (original)
+++ tomcat/trunk/res/maven/tomcat-catalina-jmx-remote.pom Sat Dec 11 22:21:02 
2010
@@ -24,9 +24,21 @@
   dependencies
 dependency
   groupIdorg.apache.tomcat/groupId
+  artifactIdtomcat-coyote/artifactId
+  version@MAVEN.DEPLOY.VERSION@/version
+  scopecompile/scope
+

DO NOT REPLY [Bug 50459] New: StandardContext.bindThread() and unbindThread() are not symmetrical and not limited to current thread

2010-12-11 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=50459

   Summary: StandardContext.bindThread() and unbindThread() are
not symmetrical and not limited to current thread
   Product: Tomcat 7
   Version: 7.0.5
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: Catalina
AssignedTo: dev@tomcat.apache.org
ReportedBy: sylvain.laur...@gmail.com


As a side effect of my commit, I think I found a bug in
StandardContext.bindThread() and unbindThread() methods in both tomcat 6 and 7
:

- the methods should be symmetrical : unbindThread should restore the Thread
CCL after calling DirContextURLStreamHandler.unbind() and
ContextBindings.unbindThread()
- StandardContext.bindThread() should call
DirContextURLStreamHandler.bindThread() instead of
DirContextURLStreamHandler.bind()
- StandardContext.unbindThread() should call
DirContextURLStreamHandler.unbindThread() instead of
DirContextURLStreamHandler.unbind()

-- 
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 50459] StandardContext.bindThread() and unbindThread() are not symmetrical and not limited to current thread

2010-12-11 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=50459

--- Comment #1 from Sylvain Laurent sylvain.laur...@gmail.com 2010-12-11 
19:09:33 EST ---
oops, forgot the link to my initial commit that revealed the bug :
http://svn.apache.org/viewvc?rev=1044145view=rev

-- 
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: r1044746 - /tomcat/trunk/java/org/apache/catalina/core/StandardContext.java

2010-12-11 Thread slaurent
Author: slaurent
Date: Sun Dec 12 00:10:39 2010
New Revision: 1044746

URL: http://svn.apache.org/viewvc?rev=1044746view=rev
Log:
bug 50459: StandardContext.bindThread() and unbindThread() are not symmetrical 
and not limited to current thread 
https://issues.apache.org/bugzilla/show_bug.cgi?id=50459

This fixes the bug that was introduced by 
http://svn.apache.org/viewvc?rev=1044145view=rev (introduced a dedicated 
thread when starting and stopping web applications to avoid mem leak)

Modified:
tomcat/trunk/java/org/apache/catalina/core/StandardContext.java

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=1044746r1=1044745r2=1044746view=diff
==
--- tomcat/trunk/java/org/apache/catalina/core/StandardContext.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardContext.java Sun Dec 12 
00:10:39 2010
@@ -4862,10 +4862,10 @@ public class StandardContext extends Con
 if ((loader != null)  (loader instanceof Lifecycle))
 ((Lifecycle) loader).start();
 
-// Unbinding thread
+// since the loader just started, the webapp classloader is now
+// created by calling unbindThread and bindThread in a row, we
+// setup the current Thread CCL to be the webapp classloader
 unbindThread(oldCCL);
-
-// Binding thread
 oldCCL = bindThread();
 
 // Initialize logger again. Other components might have used 
it too early, 
@@ -5542,7 +5542,7 @@ public class StandardContext extends Con
 (getLoader().getClassLoader());
 }
 
-DirContextURLStreamHandler.bind(getResources());
+DirContextURLStreamHandler.bindThread(getResources());
 
 if (isUseNaming()) {
 try {
@@ -5563,16 +5563,13 @@ public class StandardContext extends Con
  */
 private void unbindThread(ClassLoader oldContextClassLoader) {
 
-Thread.currentThread().setContextClassLoader(oldContextClassLoader);
-
-oldContextClassLoader = null;
-
 if (isUseNaming()) {
 ContextBindings.unbindThread(this, this);
 }
 
-DirContextURLStreamHandler.unbind();
+DirContextURLStreamHandler.unbindThread();
 
+Thread.currentThread().setContextClassLoader(oldContextClassLoader);
 }
 
 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 50459] StandardContext.bindThread() and unbindThread() are not symmetrical and not limited to current thread

2010-12-11 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=50459

--- Comment #2 from Sylvain Laurent sylvain.laur...@gmail.com 2010-12-11 
19:12:12 EST ---
fix committed on trunk : http://svn.apache.org/viewvc?rev=1044746view=rev

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



Re: svn commit: r1044746 - /tomcat/trunk/java/org/apache/catalina/core/StandardContext.java

2010-12-11 Thread Mark Thomas
On 12/12/2010 00:10, slaur...@apache.org wrote:
 Author: slaurent
 Date: Sun Dec 12 00:10:39 2010
 New Revision: 1044746
 
 @@ -4862,10 +4862,10 @@ public class StandardContext extends Con
  if ((loader != null)  (loader instanceof Lifecycle))
  ((Lifecycle) loader).start();
  
 -// Unbinding thread
 +// since the loader just started, the webapp classloader is 
 now
 +// created by calling unbindThread and bindThread in a row, 
 we
 +// setup the current Thread CCL to be the webapp classloader
  unbindThread(oldCCL);
 -
 -// Binding thread
  oldCCL = bindThread();

That new comment doesn't look right. The class loader is not created by
calling unbindThread and bindThread in a row.

Mark

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: svn commit: r1044145 - in /tomcat/trunk: java/org/apache/catalina/core/ java/org/apache/tomcat/util/threads/ test/org/apache/tomcat/util/threads/

2010-12-11 Thread Sylvain Laurent
Good catch!

Actually I think my commit revealed a current bug in tc 6  7 : 
https://issues.apache.org/bugzilla/show_bug.cgi?id=50459

I fixed it with http://svn.apache.org/viewvc?rev=1044746view=rev . Now all 
tests pass (checked with ant clean test).

Sylvain

On 11 déc. 2010, at 21:34, Mark Thomas wrote:

 On 09/12/2010 22:11, slaur...@apache.org wrote:
 Author: slaurent
 Date: Thu Dec  9 22:11:27 2010
 New Revision: 1044145
 
 URL: http://svn.apache.org/viewvc?rev=1044145view=rev
 Log:
 bug 49159: Improve ThreadLocal memory leak clean-up 
 https://issues.apache.org/bugzilla/show_bug.cgi?id=49159
 
 -1. This breaks at least one unit test.
 
 Mark
 
 -
 To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: dev-h...@tomcat.apache.org
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1044747 - /tomcat/trunk/java/org/apache/catalina/core/StandardContext.java

2010-12-11 Thread slaurent
Author: slaurent
Date: Sun Dec 12 00:16:33 2010
New Revision: 1044747

URL: http://svn.apache.org/viewvc?rev=1044747view=rev
Log:
bug 50459: StandardContext.bindThread() and unbindThread() are not symmetrical 
and not limited to current thread 
https://issues.apache.org/bugzilla/show_bug.cgi?id=50459

Fixed incorrect comment in code

Modified:
tomcat/trunk/java/org/apache/catalina/core/StandardContext.java

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=1044747r1=1044746r2=1044747view=diff
==
--- tomcat/trunk/java/org/apache/catalina/core/StandardContext.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardContext.java Sun Dec 12 
00:16:33 2010
@@ -4863,8 +4863,9 @@ public class StandardContext extends Con
 ((Lifecycle) loader).start();
 
 // since the loader just started, the webapp classloader is now
-// created by calling unbindThread and bindThread in a row, we
-// setup the current Thread CCL to be the webapp classloader
+// created.
+// By calling unbindThread and bindThread in a row, we setup 
the
+// current Thread CCL to be the webapp classloader
 unbindThread(oldCCL);
 oldCCL = bindThread();
 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: svn commit: r1044746 - /tomcat/trunk/java/org/apache/catalina/core/StandardContext.java

2010-12-11 Thread Sylvain Laurent
oops, I just forgot a dot and a new line... fixed in rev 1044747.

On 12 déc. 2010, at 01:13, Mark Thomas wrote:

 On 12/12/2010 00:10, slaur...@apache.org wrote:
 Author: slaurent
 Date: Sun Dec 12 00:10:39 2010
 New Revision: 1044746
 
 @@ -4862,10 +4862,10 @@ public class StandardContext extends Con
 if ((loader != null)  (loader instanceof Lifecycle))
 ((Lifecycle) loader).start();
 
 -// Unbinding thread
 +// since the loader just started, the webapp classloader is 
 now
 +// created by calling unbindThread and bindThread in a row, 
 we
 +// setup the current Thread CCL to be the webapp classloader
 unbindThread(oldCCL);
 -
 -// Binding thread
 oldCCL = bindThread();
 
 That new comment doesn't look right. The class loader is not created by
 calling unbindThread and bindThread in a row.
 
 Mark
 
 -
 To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: dev-h...@tomcat.apache.org
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Static reference to a Throwable causing ClassLoader leak

2010-12-11 Thread Konstantin Kolinko
Hi!

I was reviewing the reproduction recipe for java bug 6916498 [1]
and came to a conclusion that it is triggered by the following line in one
of the classes (see my comment in [1] for details):

public static final RuntimeException abort = new RuntimeException();

[1] Class loader leak goes unreported via JVMTI
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6916498

The leak happens when the stacktrace includes classes loaded by webapp's
classloader. It is understandable. The problem is that those references are
not visible in a profiler, e.g. in Eclipse MAT.

I do not know how to obtain a list of all Exceptions that are present
in memory, but
the following recipe is good for most cases. In Eclipse MAT:

1. Open a heap dump
2. Click Open Query Browser button on the toolbar. A menu appears.
3. Select List objects - with incoming references
4. Type the following expression as the class name:  .*Exception

That will list all classes whose name ends with Exception.


Additional notes:
1) The offending class in [1] is AbstractDOMParser, copied from Apache
Xerces. The current code of Xerces is different [2]. The current code
looks better, but I have not tested whether that fixes the leak or
not.

[2] 
http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/parsers/AbstractDOMParser.java?annotate=782187#l162

2) I found a scenario when such a leak is caused by a field in
org.apache.jasper.compiler.JspDocumentParser. I will add an issue into
Bugzilla.


Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 50460] New: First access to a jspx page causes classloader leak in JspDocumentParser

2010-12-11 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=50460

   Summary: First access to a jspx page causes classloader leak in
JspDocumentParser
   Product: Tomcat 6
   Version: 6.0.29
  Platform: PC
OS/Version: Windows XP
Status: NEW
  Severity: normal
  Priority: P2
 Component: Jasper
AssignedTo: dev@tomcat.apache.org
ReportedBy: knst.koli...@gmail.com


Running latest 6.0.x,

To reproduce:
1. Stop Tomcat
2. Deploy the examples webapp
3. Create /webapps/examples/foo.jsp file containing the following text:
jsp:include page=/jsp/jsp2/jspx/basic.jspx/

4. Make sure that the work folder of Tomcat is empty.
5. Start Tomcat
6. Go to http://localhost:8080/examples/foo.jsp
7. Go to the Manager web application and stop the examples webapp.
8. Press the Find leaks button there.
ACTUAL RESULT:
It is reported that /examples causes a leak.
EXPECTED RESULT:
No leaks.

This issue is apparently caused by an instance of
org.apache.jasper.compiler.JspDocumentParser$EnableDTDValidationException
that is being kept in a static final field.

More discussion of such leaks can be found in thread [1] on d...@.

[1] http://tomcat.markmail.org/thread/v4xmg5v5t6oa4mrs
http://marc.info/?l=tomcat-devm=129211856426188w=2

Additional comments:
1) This issue affects the first request that loads the JspDocumentParser class.
Subsequent requests do not cause the issue. Thus only a single webapp is
affected.
2) The issue does not happen when there is no webapp code in the call stack.
I.e., it does not happen if the JSPX page was requested directly.
That is why the reproduction recipe uses jsp:include/.

Possible solutions:
1) Preload the JspDocumentParser class when Tomcat starts.
2) Do not cache the Exception. Create a new instance each time.
3) Override the fillInStackTrace() method, like it was done in
AbstractDOMParser$Abort in Apache Xerces [2]. I do not know, whether that helps
or not.

[2]
http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/parsers/AbstractDOMParser.java?annotate=782187#l162

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



Re: Static reference to a Throwable causing ClassLoader leak

2010-12-11 Thread Konstantin Kolinko
2010/12/12 Konstantin Kolinko knst.koli...@gmail.com:
 2) I found a scenario when such a leak is caused by a field in
 org.apache.jasper.compiler.JspDocumentParser. I will add an issue into
 Bugzilla.

https://issues.apache.org/bugzilla/show_bug.cgi?id=50460

Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org