[Bug 56441] New: Misleading error message in FilterBase cause by invalid regex

2014-04-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56441

Bug ID: 56441
   Summary: Misleading error message in FilterBase cause by
invalid regex
   Product: Tomcat 7
   Version: 7.0.29
  Hardware: All
OS: Linux
Status: NEW
  Severity: minor
  Priority: P2
 Component: Catalina
  Assignee: dev@tomcat.apache.org
  Reporter: matty_rid...@hotmail.com

An invalid regex in the allow parameter leads to raising of a misleading
exception: The property allow is not defined for filters of type
org.apache.catalina.filters.RemoteAddrFilter.


Test config in web.xml

  filter
 filter-nameTestFilter/filter-name
 filter-classorg.apache.catalina.filters.RemoteAddrFilter/filter-class
 init-param
param-nameallow/param-name
param-value127\.0\.\0.1/param-value
 /init-param
  /filter

  filter-mapping
 filter-nameTestFilter/filter-name 
 url-pattern*/url-pattern 
  /filter-mapping


Apr 22, 2014 3:50:10 PM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter TestFilter
javax.servlet.ServletException: The property allow is not defined for filters
of type org.apache.catalina.filters.RemoteAddrFilter
at org.apache.catalina.filters.FilterBase.init(FilterBase.java:53)
at
org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:269)
at
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
at
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)
at
org.apache.catalina.core.ApplicationFilterConfig.init(ApplicationFilterConfig.java:103)
at
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4650)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5306)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)

-- 
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: r1589035 - in /tomcat/trunk: java/org/apache/tomcat/websocket/server/WsServerContainer.java webapps/docs/changelog.xml webapps/docs/web-socket-howto.xml

2014-04-22 Thread markt
Author: markt
Date: Tue Apr 22 08:00:13 2014
New Revision: 1589035

URL: http://svn.apache.org/r1589035
Log:
Increase the default maximum size of the executor used for async writes

Modified:
tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java
tomcat/trunk/webapps/docs/changelog.xml
tomcat/trunk/webapps/docs/web-socket-howto.xml

Modified: 
tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java?rev=1589035r1=1589034r2=1589035view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java 
Tue Apr 22 08:00:13 2014
@@ -114,7 +114,7 @@ public class WsServerContainer extends W
 }
 // Executor config
 int executorCoreSize = 0;
-int executorMaxSize = 10;
+int executorMaxSize = 200;
 long executorKeepAliveTimeSeconds = 60;
 value = servletContext.getInitParameter(
 Constants.EXECUTOR_CORE_SIZE_INIT_PARAM);

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1589035r1=1589034r2=1589035view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Tue Apr 22 08:00:13 2014
@@ -121,6 +121,11 @@
 systems if a file named code\/code is encountered when scanning for
 TLDs. (mark)
   /fix
+  fix
+Increase the default maximum size of the executor used by the WebSocket
+implementation for call backs associated with asynchronous writes from
+10 to 200. (markt) 
+  /fix
 /changelog
   /subsection
   subsection name=Coyote

Modified: tomcat/trunk/webapps/docs/web-socket-howto.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/web-socket-howto.xml?rev=1589035r1=1589034r2=1589035view=diff
==
--- tomcat/trunk/webapps/docs/web-socket-howto.xml (original)
+++ tomcat/trunk/webapps/docs/web-socket-howto.xml Tue Apr 22 08:00:13 2014
@@ -121,7 +121,7 @@ implement its own timeout mechanism to h
  is used./li
  licodeorg.apache.tomcat.websocket.executorMaxSize/code: The maximum
  permitted size of the executor thread pool. If not set, the default of
- 10 is used./li
+ 200 is used./li
  licodeorg.apache.tomcat.websocket.executorKeepAliveTimeSeconds/code:
  The maximum time an idle thread will remain in the executor thread 
pool
  until it is terminated. If not specified, the default of 60 seconds is



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



svn commit: r1589037 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/websocket/server/WsServerContainer.java webapps/docs/changelog.xml webapps/docs/web-socket-howto.xml

2014-04-22 Thread markt
Author: markt
Date: Tue Apr 22 08:02:26 2014
New Revision: 1589037

URL: http://svn.apache.org/r1589037
Log:
Increase the default maximum size of the executor used for async writes

Modified:
tomcat/tc7.0.x/trunk/   (props changed)

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
tomcat/tc7.0.x/trunk/webapps/docs/web-socket-howto.xml

Propchange: tomcat/tc7.0.x/trunk/
--
  Merged /tomcat/trunk:r1589035

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java?rev=1589037r1=1589036r2=1589037view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java
 Tue Apr 22 08:02:26 2014
@@ -114,7 +114,7 @@ public class WsServerContainer extends W
 }
 // Executor config
 int executorCoreSize = 0;
-int executorMaxSize = 10;
+int executorMaxSize = 200;
 long executorKeepAliveTimeSeconds = 60;
 value = servletContext.getInitParameter(
 Constants.EXECUTOR_CORE_SIZE_INIT_PARAM);

Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1589037r1=1589036r2=1589037view=diff
==
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Tue Apr 22 08:02:26 2014
@@ -101,6 +101,11 @@
 systems if a file named code\/code is encountered when scanning for
 TLDs. (mark)
   /fix
+  fix
+Increase the default maximum size of the executor used by the WebSocket
+implementation for call backs associated with asynchronous writes from
+10 to 200. (markt) 
+  /fix
 /changelog
   /subsection
   subsection name=Jasper

Modified: tomcat/tc7.0.x/trunk/webapps/docs/web-socket-howto.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/web-socket-howto.xml?rev=1589037r1=1589036r2=1589037view=diff
==
--- tomcat/tc7.0.x/trunk/webapps/docs/web-socket-howto.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/web-socket-howto.xml Tue Apr 22 08:02:26 
2014
@@ -123,7 +123,7 @@ implement its own timeout mechanism to h
  is used./li
  licodeorg.apache.tomcat.websocket.executorMaxSize/code: The maximum
  permitted size of the executor thread pool. If not set, the default of
- 10 is used./li
+ 200 is used./li
  licodeorg.apache.tomcat.websocket.executorKeepAliveTimeSeconds/code:
  The maximum time an idle thread will remain in the executor thread 
pool
  until it is terminated. If not specified, the default of 60 seconds is



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



svn commit: r1589039 - /tomcat/trunk/webapps/docs/changelog.xml

2014-04-22 Thread markt
Author: markt
Date: Tue Apr 22 08:24:56 2014
New Revision: 1589039

URL: http://svn.apache.org/r1589039
Log:
WebSocket has own section in changelog.

Modified:
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1589039r1=1589038r2=1589039view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Tue Apr 22 08:24:56 2014
@@ -121,11 +121,6 @@
 systems if a file named code\/code is encountered when scanning for
 TLDs. (mark)
   /fix
-  fix
-Increase the default maximum size of the executor used by the WebSocket
-implementation for call backs associated with asynchronous writes from
-10 to 200. (markt) 
-  /fix
 /changelog
   /subsection
   subsection name=Coyote
@@ -213,6 +208,11 @@
 implementation is used with the Java WebSocket 1.0 API JAR from the
 reference implementation. (markt)
   /fix
+  fix
+Increase the default maximum size of the executor used by the WebSocket
+implementation for call backs associated with asynchronous writes from
+10 to 200. (markt) 
+  /fix
 /changelog
   /subsection
   subsection name=Web applications



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



svn commit: r1589040 - in /tomcat/tc7.0.x/trunk: ./ webapps/docs/changelog.xml

2014-04-22 Thread markt
Author: markt
Date: Tue Apr 22 08:25:28 2014
New Revision: 1589040

URL: http://svn.apache.org/r1589040
Log:
WebSocket has own section in changelog.

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc7.0.x/trunk/
--
  Merged /tomcat/trunk:r1589039

Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1589040r1=1589039r2=1589040view=diff
==
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Tue Apr 22 08:25:28 2014
@@ -101,11 +101,6 @@
 systems if a file named code\/code is encountered when scanning for
 TLDs. (mark)
   /fix
-  fix
-Increase the default maximum size of the executor used by the WebSocket
-implementation for call backs associated with asynchronous writes from
-10 to 200. (markt) 
-  /fix
 /changelog
   /subsection
   subsection name=Jasper
@@ -162,6 +157,11 @@
 implementation is used with the Java WebSocket 1.0 API JAR from the
 reference implementation. (markt)
   /fix
+  fix
+Increase the default maximum size of the executor used by the WebSocket
+implementation for call backs associated with asynchronous writes from
+10 to 200. (markt) 
+  /fix
 /changelog
   /subsection
   subsection name=Web applications



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



svn commit: r1589043 - in /tomcat/trunk: java/org/apache/tomcat/websocket/server/ webapps/docs/

2014-04-22 Thread markt
Author: markt
Date: Tue Apr 22 08:31:56 2014
New Revision: 1589043

URL: http://svn.apache.org/r1589043
Log:
Refactor server container shutdown into the destroy method
Destroy the thread group on shutdown
Log a warning if the thread group can't be destroyed

Modified:
tomcat/trunk/java/org/apache/tomcat/websocket/server/LocalStrings.properties
tomcat/trunk/java/org/apache/tomcat/websocket/server/WsContextListener.java
tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java
tomcat/trunk/webapps/docs/changelog.xml

Modified: 
tomcat/trunk/java/org/apache/tomcat/websocket/server/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/server/LocalStrings.properties?rev=1589043r1=1589042r2=1589043view=diff
==
--- 
tomcat/trunk/java/org/apache/tomcat/websocket/server/LocalStrings.properties 
(original)
+++ 
tomcat/trunk/java/org/apache/tomcat/websocket/server/LocalStrings.properties 
Tue Apr 22 08:31:56 2014
@@ -22,6 +22,7 @@ serverContainer.missingEndpoint=An Endpo
 serverContainer.pojoDeploy=POJO class [{0}] deploying to path [{1}] in 
ServletContext [{2}]
 serverContainer.servletContextMismatch=Attempted to register a POJO annotated 
for WebSocket at path [{0}] in the ServletContext with context path [{1}] when 
the WebSocket ServerContainer is allocated to the ServletContext with context 
path [{2}]
 serverContainer.servletContextMissing=No ServletContext was specified
+serverContainer.threadGroupNotDestroyed=Unable to destroy WebSocket thread 
group [{0}] as some threads were still running when the web application was 
stopped
 
 uriTemplate.duplicateParameter=The parameter [{0}] appears more than once in 
the path which is not permitted
 uriTemplate.emptySegment=The path [{0}] contains one or more empty segments 
which are is not permitted

Modified: 
tomcat/trunk/java/org/apache/tomcat/websocket/server/WsContextListener.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/server/WsContextListener.java?rev=1589043r1=1589042r2=1589043view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/websocket/server/WsContextListener.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/server/WsContextListener.java 
Tue Apr 22 08:31:56 2014
@@ -45,7 +45,6 @@ public class WsContextListener implement
 ServletContext sc = sce.getServletContext();
 Object obj = 
sc.getAttribute(Constants.SERVER_CONTAINER_SERVLET_CONTEXT_ATTRIBUTE);
 if (obj instanceof WsServerContainer) {
-((WsServerContainer) obj).shutdownExecutor();
 ((WsServerContainer) obj).destroy();
 }
 }

Modified: 
tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java?rev=1589043r1=1589042r2=1589043view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java 
Tue Apr 22 08:31:56 2014
@@ -49,6 +49,8 @@ import javax.websocket.server.ServerEndp
 import javax.websocket.server.ServerEndpointConfig;
 import javax.websocket.server.ServerEndpointConfig.Configurator;
 
+import org.apache.juli.logging.Log;
+import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.res.StringManager;
 import org.apache.tomcat.websocket.WsSession;
 import org.apache.tomcat.websocket.WsWebSocketContainer;
@@ -70,6 +72,8 @@ public class WsServerContainer extends W
 
 private static final StringManager sm =
 StringManager.getManager(Constants.PACKAGE_NAME);
+private static final Log log = LogFactory.getLog(WsServerContainer.class);
+
 private static final CloseReason AUTHENTICATED_HTTP_SESSION_CLOSED =
 new CloseReason(CloseCodes.VIOLATED_POLICY,
 This connection was established under an authenticated  +
@@ -88,6 +92,7 @@ public class WsServerContainer extends W
 private final ConcurrentHashMapString,SetWsSession 
authenticatedSessions =
 new ConcurrentHashMap();
 private final ExecutorService executorService;
+private final ThreadGroup threadGroup;
 private volatile boolean endpointsRegistered = false;
 
 WsServerContainer(ServletContext servletContext) {
@@ -152,7 +157,7 @@ public class WsServerContainer extends W
 } else {
 threadGroupName.append(servletContext.getContextPath());
 }
-ThreadGroup threadGroup = new ThreadGroup(threadGroupName.toString());
+threadGroup = new ThreadGroup(threadGroupName.toString());
 WsThreadFactory wsThreadFactory = new 

svn commit: r1589044 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/websocket/server/ webapps/docs/

2014-04-22 Thread markt
Author: markt
Date: Tue Apr 22 08:32:50 2014
New Revision: 1589044

URL: http://svn.apache.org/r1589044
Log:
Refactor server container shutdown into the destroy method
Destroy the thread group on shutdown
Log a warning if the thread group can't be destroyed

Modified:
tomcat/tc7.0.x/trunk/   (props changed)

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/LocalStrings.properties

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsContextListener.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc7.0.x/trunk/
--
  Merged /tomcat/trunk:r1589043

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/LocalStrings.properties?rev=1589044r1=1589043r2=1589044view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/LocalStrings.properties
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/LocalStrings.properties
 Tue Apr 22 08:32:50 2014
@@ -24,6 +24,7 @@ serverContainer.missingEndpoint=An Endpo
 serverContainer.pojoDeploy=POJO class [{0}] deploying to path [{1}] in 
ServletContext [{2}]
 serverContainer.servletContextMismatch=Attempted to register a POJO annotated 
for WebSocket at path [{0}] in the ServletContext with context path [{1}] when 
the WebSocket ServerContainer is allocated to the ServletContext with context 
path [{2}]
 serverContainer.servletContextMissing=No ServletContext was specified
+serverContainer.threadGroupNotDestroyed=Unable to destroy WebSocket thread 
group [{0}] as some threads were still running when the web application was 
stopped
 
 uriTemplate.duplicateParameter=The parameter [{0}] appears more than once in 
the path which is not permitted
 uriTemplate.emptySegment=The path [{0}] contains one or more empty segments 
which are is not permitted

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsContextListener.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsContextListener.java?rev=1589044r1=1589043r2=1589044view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsContextListener.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsContextListener.java
 Tue Apr 22 08:32:50 2014
@@ -45,7 +45,6 @@ public class WsContextListener implement
 ServletContext sc = sce.getServletContext();
 Object obj = 
sc.getAttribute(Constants.SERVER_CONTAINER_SERVLET_CONTEXT_ATTRIBUTE);
 if (obj instanceof WsServerContainer) {
-((WsServerContainer) obj).shutdownExecutor();
 ((WsServerContainer) obj).destroy();
 }
 }

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java?rev=1589044r1=1589043r2=1589044view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java
 Tue Apr 22 08:32:50 2014
@@ -49,6 +49,8 @@ import javax.websocket.server.ServerEndp
 import javax.websocket.server.ServerEndpointConfig;
 import javax.websocket.server.ServerEndpointConfig.Configurator;
 
+import org.apache.juli.logging.Log;
+import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.res.StringManager;
 import org.apache.tomcat.websocket.WsSession;
 import org.apache.tomcat.websocket.WsWebSocketContainer;
@@ -70,6 +72,8 @@ public class WsServerContainer extends W
 
 private static final StringManager sm =
 StringManager.getManager(Constants.PACKAGE_NAME);
+private static final Log log = LogFactory.getLog(WsServerContainer.class);
+
 private static final CloseReason AUTHENTICATED_HTTP_SESSION_CLOSED =
 new CloseReason(CloseCodes.VIOLATED_POLICY,
 This connection was established under an authenticated  +
@@ -88,6 +92,7 @@ public class WsServerContainer extends W
 private final ConcurrentHashMapString,SetWsSession 
authenticatedSessions =
 new ConcurrentHashMapString, SetWsSession();
 private final ExecutorService executorService;
+private final ThreadGroup threadGroup;
 private volatile boolean endpointsRegistered = false;
 
 WsServerContainer(ServletContext servletContext) {
@@ -150,7 +155,7 @@ public class 

svn commit: r1589100 - in /tomcat/trunk: java/org/apache/tomcat/websocket/ test/org/apache/tomcat/websocket/

2014-04-22 Thread markt
Author: markt
Date: Tue Apr 22 12:07:04 2014
New Revision: 1589100

URL: http://svn.apache.org/r1589100
Log:
Ensure that threads created to support WebSocket clients are stopped when those 
clients no longer need them.
Note that while this happens automatically for WebSocket client calls made by 
web applications, stand-along clients must call the Tomcat specific method 
WsWebSocketContainer.destroy().

Added:
tomcat/trunk/java/org/apache/tomcat/websocket/AsyncChannelGroupUtil.java   
(with props)
Modified:
tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties
tomcat/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java
tomcat/trunk/test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java

Added: tomcat/trunk/java/org/apache/tomcat/websocket/AsyncChannelGroupUtil.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/AsyncChannelGroupUtil.java?rev=1589100view=auto
==
--- tomcat/trunk/java/org/apache/tomcat/websocket/AsyncChannelGroupUtil.java 
(added)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/AsyncChannelGroupUtil.java 
Tue Apr 22 12:07:04 2014
@@ -0,0 +1,117 @@
+/*
+ *  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.websocket;
+
+import java.io.IOException;
+import java.nio.channels.AsynchronousChannelGroup;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.SynchronousQueue;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.apache.tomcat.util.res.StringManager;
+import org.apache.tomcat.util.threads.ThreadPoolExecutor;
+
+/**
+ * This is a utility class that enables multiple {@link WsWebSocketContainer}
+ * instances to share a single {@link AsynchronousChannelGroup} while ensuring
+ * that the group is destroyed when no longer required.
+ */
+public class AsyncChannelGroupUtil {
+
+private static final StringManager sm =
+StringManager.getManager(Constants.PACKAGE_NAME);
+
+private static AsynchronousChannelGroup group = null;
+private static int usageCount = 0;
+private static final Object lock = new Object();
+
+
+private AsyncChannelGroupUtil() {
+// Hide the default constructor
+}
+
+
+public static AsynchronousChannelGroup register() {
+synchronized (lock) {
+if (usageCount == 0) {
+group = createAsynchronousChannelGroup();
+}
+usageCount++;
+return group;
+}
+}
+
+
+public static void unregister() {
+synchronized (lock) {
+usageCount--;
+if (usageCount == 0) {
+group.shutdown();
+group = null;
+}
+}
+}
+
+
+private static AsynchronousChannelGroup createAsynchronousChannelGroup() {
+// Need to do this with the right thread context class loader else the
+// first web app to call this will trigger a leak
+ClassLoader original = Thread.currentThread().getContextClassLoader();
+
+try {
+Thread.currentThread().setContextClassLoader(
+AsyncIOThreadFactory.class.getClassLoader());
+
+// These are the same settings as the default
+// AsynchronousChannelGroup
+int initialSize = Runtime.getRuntime().availableProcessors();
+ExecutorService executorService = new ThreadPoolExecutor(
+0,
+Integer.MAX_VALUE,
+Long.MAX_VALUE, TimeUnit.MILLISECONDS,
+new SynchronousQueueRunnable(),
+new AsyncIOThreadFactory());
+
+try {
+return AsynchronousChannelGroup.withCachedThreadPool(
+executorService, initialSize);
+} catch (IOException e) {
+// No good reason for this to happen.
+throw new 
IllegalStateException(sm.getString(asyncChannelGroup.createFail));
+}
+} finally {
+

svn commit: r1589102 - /tomcat/trunk/webapps/docs/changelog.xml

2014-04-22 Thread markt
Author: markt
Date: Tue Apr 22 12:11:34 2014
New Revision: 1589102

URL: http://svn.apache.org/r1589102
Log:
Update changelog

Modified:
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1589102r1=1589101r2=1589102view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Tue Apr 22 12:11:34 2014
@@ -218,6 +218,12 @@
 write call backs can not be destroyed when the web application is
 stopped. (markt)
   /add
+  fix
+Ensure that threads created to support WebSocket clients are stopped
+when no longer required. This will happen automatically for WebSocket
+client connections initiated by web applications but stand alone 
clients
+must call codeWsWebSocketContainer.destroy()/code. (markt)
+  /fix
 /changelog
   /subsection
   subsection name=Web applications



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



svn commit: r1589103 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/websocket/ test/org/apache/tomcat/websocket/ webapps/docs/

2014-04-22 Thread markt
Author: markt
Date: Tue Apr 22 12:13:26 2014
New Revision: 1589103

URL: http://svn.apache.org/r1589103
Log:
Ensure that threads created to support WebSocket clients are stopped when those 
clients no longer need them.
Note that while this happens automatically for WebSocket client calls made by 
web applications, stand-alone clients must call the Tomcat specific method 
WsWebSocketContainer.destroy().

Added:

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/AsyncChannelGroupUtil.java
  - copied unchanged from r1589100, 
tomcat/trunk/java/org/apache/tomcat/websocket/AsyncChannelGroupUtil.java
Modified:
tomcat/tc7.0.x/trunk/   (props changed)

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java

tomcat/tc7.0.x/trunk/test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc7.0.x/trunk/
--
  Merged /tomcat/trunk:r1589100,1589102

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties?rev=1589103r1=1589102r2=1589103view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties 
(original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties 
Tue Apr 22 12:13:26 2014
@@ -13,6 +13,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+asyncChannelGroup.createFail=Unable to create dedicated 
AsynchronousChannelGroup for WebSocket clients which is required to prevent 
memory leaks in complex class loader environments like J2EE containers
+
 asyncChannelWrapperSecure.closeFail=Failed to close channel cleanly
 asyncChannelWrapperSecure.concurrentRead=Concurrent read operations are not 
permitted
 asyncChannelWrapperSecure.concurrentWrite=Concurrent write operations are not 
permitted
@@ -86,7 +88,6 @@ wsSession.unknownHandlerType=Unable to a
 # as many as 4 bytes.
 wsWebSocketContainer.shutdown=The web application is stopping
 
-wsWebSocketContainer.asynchronousChannelGroupFail=Unable to create dedicated 
AsynchronousChannelGroup for WebSocket clients which is required to prevent 
memory leaks in complex class loader environments like J2EE containers
 wsWebSocketContainer.asynchronousSocketChannelFail=Unable to open a connection 
to the server
 wsWebSocketContainer.defaultConfiguratorFaill=Failed to create the default 
configurator
 wsWebSocketContainer.endpointCreateFail=Failed to create a local endpoint of 
type [{0}]

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java?rev=1589103r1=1589102r2=1589103view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java 
(original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java 
Tue Apr 22 12:13:26 2014
@@ -42,13 +42,9 @@ import java.util.Random;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Future;
-import java.util.concurrent.SynchronousQueue;
-import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
-import java.util.concurrent.atomic.AtomicInteger;
 
 import javax.net.ssl.SSLContext;
 import javax.net.ssl.SSLEngine;
@@ -69,7 +65,6 @@ import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.codec.binary.Base64;
 import org.apache.tomcat.util.res.StringManager;
-import org.apache.tomcat.util.threads.ThreadPoolExecutor;
 import org.apache.tomcat.websocket.pojo.PojoEndpointClient;
 
 public class WsWebSocketContainer
@@ -109,43 +104,9 @@ public class WsWebSocketContainer
 StringManager.getManager(Constants.PACKAGE_NAME);
 private static final Random random = new Random();
 private static final byte[] crlf = new byte[] {13, 10};
-private static final AsynchronousChannelGroup asynchronousChannelGroup;
 
-static {
-AsynchronousChannelGroup result = null;
-
-// Need to do this with the right thread context class loader else the
-// first web app to call this will trigger a leak
-ClassLoader original = Thread.currentThread().getContextClassLoader();
-
-try {
-Thread.currentThread().setContextClassLoader(
- 

[Bug 56442] New: ClassNotFoundException does not produce error

2014-04-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56442

Bug ID: 56442
   Summary: ClassNotFoundException does not produce error
   Product: Tomcat 8
   Version: 8.0.5
  Hardware: PC
OS: Linux
Status: NEW
  Severity: minor
  Priority: P2
 Component: WebSocket
  Assignee: dev@tomcat.apache.org
  Reporter: th...@corrisoft.com

I was attempting to deploy my war file with an endpoint annotation defined in
it to my tomcat server. When I deployed it, I received no error messages, but
the endpoint was returning 404.

I switched to tomcat 7.0.52 and dropped the war file in there. I received a
stack trace because one of the dependent classes was not included in the war
file. Once I fixed the classptath problems, the error disappeared and the
endpoint showed up. I moved this back to tomcat 8.0.5 and it is now working
fine.

The problem is that the error does not show up in the log. An error on the
dependent class needs to show up in the log to tell the deployer there is a
problem with the endpoint instead of silently not standing it up.

This problem can be re-created by creating a basic endpoint with one dependent
class not in the class path.

-- 
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: r1589123 - /tomcat/tc6.0.x/trunk/STATUS.txt

2014-04-22 Thread remm
Author: remm
Date: Tue Apr 22 13:23:04 2014
New Revision: 1589123

URL: http://svn.apache.org/r1589123
Log:
Votes

Modified:
tomcat/tc6.0.x/trunk/STATUS.txt

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1589123r1=1589122r2=1589123view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Tue Apr 22 13:23:04 2014
@@ -35,20 +35,20 @@ PATCHES PROPOSED TO BACKPORT:
   Explicitly specify --LogPath path when uninstalling Windows service. (The
   default value for that option was %SystemRoot%\System32\LogFiles\Apache.)
   https://people.apache.org/~kkolinko/patches/2014-04-11_tc6_tomcat_nsi.patch
-  +1: kkolinko, markt
+  +1: kkolinko, markt, remm
   -1:
 
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56334
   Correct double unescaping
   
http://people.apache.org/~markt/patches/2014-04-17-attribute-escaping-tc6-v2.patch
-  +1: markt
+  +1: markt, remm
   -1:
 
 * Enabling building with Java 8
   
http://people.apache.org/~markt/patches/2014-04-12-build-with-java8-tc6-v1.patch
   (Note: It is easier to verify the AbstractReplicatedMap changes by diffing
  against the Tomcat 7 version of the class)
-  +1: markt
+  +1: markt, remm
   -1:
 
 * Fix http://issues.apache.org/bugzilla/show_bug.cgi?id=56143
@@ -87,7 +87,7 @@ PATCHES PROPOSED TO BACKPORT:
   - Print a warning in case if neither server nor client jvm is found.
 
   https://people.apache.org/~kkolinko/patches/2014-04-14_tc6_56143_v2.patch
-  +1: kkolinko, markt
+  +1: kkolinko, markt, remm
   -1:
 
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56369
@@ -96,7 +96,7 @@ PATCHES PROPOSED TO BACKPORT:
   listener.
   http://svn.apache.org/r1586897
   http://svn.apache.org/r1586960
-  +1: kkolinko, markt
+  +1: kkolinko, markt, remm
   -1:
 
 * Back-port patch to allow different kinds of FIPS configuration.
@@ -104,7 +104,7 @@ PATCHES PROPOSED TO BACKPORT:
   http://svn.apache.org/viewvc?view=revisionrevision=r1587379
   http://svn.apache.org/viewvc?view=revisionamp;revision=r1587723 (adapt)
   (Note: requires tcnative 1.1.30)
-  +1: schultz, markt
+  +1: schultz, markt, remm
   +0: kkolinko:
a) It needs backport of r1588102 as an Exception is thrown by native 
code
 
@@ -118,7 +118,7 @@ PATCHES PROPOSED TO BACKPORT:
 
 * Avoid memory leak and add small optimisation to default Servlet
   http://svn.apache.org/r1588199
-  +1: markt, kkolinko
+  +1: markt, kkolinko, remm
   -1:
 
 



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



[Bug 56415] EXCEPTION_ACCESS_VIOLATION (0xc0000005) in tcnative-1.dll

2014-04-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56415

Martin Hanus martin.ha...@ysoft.com changed:

   What|Removed |Added

 OS||All

--- Comment #3 from Martin Hanus martin.ha...@ysoft.com ---
Can you please advise how we can change to NIO Connectors?

-- 
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 56415] EXCEPTION_ACCESS_VIOLATION (0xc0000005) in tcnative-1.dll

2014-04-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56415

Martin Hanus martin.ha...@ysoft.com changed:

   What|Removed |Added

 OS|All |Windows Server 2008 R2

-- 
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]: Project tomcat-trunk-validate (in module tomcat-trunk) failed

2014-04-22 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-validate has an issue affecting its community integration.
This issue affects 1 projects.
The current state of this project is 'Failed', with reason 'Build Failed'.
For reference only, the following projects are affected by this:
- tomcat-trunk-validate :  Tomcat 8.x, a web server implementing the Java 
Servlet 3.1,
...


Full details are available at:

http://vmgump.apache.org/gump/public/tomcat-trunk/tomcat-trunk-validate/index.html

That said, some information snippets are provided here.

The following annotations (debug/informational/warning/error messages) were 
provided:
 -DEBUG- Dependency on checkstyle exists, no need to add for property 
checkstyle.jar.
 -INFO- Failed with reason build failed



The following work was performed:
http://vmgump.apache.org/gump/public/tomcat-trunk/tomcat-trunk-validate/gump_work/build_tomcat-trunk_tomcat-trunk-validate.html
Work Name: build_tomcat-trunk_tomcat-trunk-validate (Type: Build)
Work ended in a state of : Failed
Elapsed: 26 secs
Command Line: /usr/lib/jvm/java-7-oracle/bin/java -Djava.awt.headless=true 
-Dbuild.sysclasspath=only org.apache.tools.ant.Main 
-Dgump.merge=/srv/gump/public/gump/work/merge.xml 
-Dcheckstyle.jar=/srv/gump/public/workspace/checkstyle/target/checkstyle-5.7-SNAPSHOT.jar
 -Dexecute.validate=true validate 
[Working Directory: /srv/gump/public/workspace/tomcat-trunk]
CLASSPATH: 
/usr/lib/jvm/java-7-oracle/lib/tools.jar:/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/packages/antlr/antlr-3.1.3.jar:/srv/gump/public/workspace/checkstyle/target/checkstyle-5.7-SNAPSHOT.jar:/srv/gump/public/workspace/apache-commons/beanutils/dist/commons-beanutils-20140422.jar:/srv/gump/public/workspace/apache-commons/cli/target/commons-cli-1.3-SNAPSHOT.jar:/srv/gump/public/workspace/commons-collections-3.x/target/commons-collections-3.3-SNAPSHOT.jar:/srv/gump/public/workspace/apache-commons/exec/tar
 
get/commons-exec-1.3-SNAPSHOT.jar:/srv/gump/public/workspace/apache-commons/logging/target/commons-logging-20140422.jar:/srv/gump/public/workspace/apache-commons/logging/target/commons-logging-api-20140422.jar:/srv/gump/public/workspace/apache-commons/validator/dist/commons-validator-20140422.jar:/srv/gump/public/workspace/google-guava/guava/target/guava-18.0-SNAPSHOT.jar:/srv/gump/packages/javamail-1.4/mail.jar:/srv/gump/packages/javamail-1.4/lib/mailapi.jar:/srv/gump/packages/jaf-1.1ea/activation.jar
-
Buildfile: /srv/gump/public/workspace/tomcat-trunk/build.xml

build-prepare:
   [delete] Deleting directory 
/srv/gump/public/workspace/tomcat-trunk/output/build/temp
[mkdir] Created dir: 
/srv/gump/public/workspace/tomcat-trunk/output/build/temp

compile-prepare:

download-validate:

proxyflags:

setproxy:

testexist:
 [echo] Testing  for 
/srv/gump/public/workspace/checkstyle/target/checkstyle-5.7-SNAPSHOT.jar

downloadzip:

validate:
[mkdir] Created dir: 
/srv/gump/public/workspace/tomcat-trunk/output/res/checkstyle
[checkstyle] Running Checkstyle 5.7-SNAPSHOT on 2778 files
[checkstyle] 
/srv/gump/public/workspace/tomcat-trunk/webapps/docs/changelog.xml:214: Line 
matches the illegal pattern '\s+$'.

BUILD FAILED
/srv/gump/public/workspace/tomcat-trunk/build.xml:539: Got 1 errors and 0 
warnings.

Total time: 26 seconds
-

To subscribe to this information via syndicated feeds:
- RSS: 
http://vmgump.apache.org/gump/public/tomcat-trunk/tomcat-trunk-validate/rss.xml
- Atom: 
http://vmgump.apache.org/gump/public/tomcat-trunk/tomcat-trunk-validate/atom.xml

== Gump Tracking Only ===
Produced by Apache Gump(TM) version 2.3.
Gump Run 20140422120004, vmgump.apache.org:vmgump:20140422120004
Gump E-mail Identifier (unique within run) #1.

--
Apache Gump
http://gump.apache.org/ [Instance: vmgump]

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



svn commit: r1589165 - /tomcat/trunk/webapps/docs/changelog.xml

2014-04-22 Thread markt
Author: markt
Date: Tue Apr 22 15:20:25 2014
New Revision: 1589165

URL: http://svn.apache.org/r1589165
Log:
Whitespace police

Modified:
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1589165r1=1589164r2=1589165view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Tue Apr 22 15:20:25 2014
@@ -211,7 +211,7 @@
   fix
 Increase the default maximum size of the executor used by the WebSocket
 implementation for call backs associated with asynchronous writes from
-10 to 200. (markt) 
+10 to 200. (markt)
   /fix
   add
 Add a warning if the thread group created for WebSocket asynchronous



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



svn commit: r1589166 - /tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties

2014-04-22 Thread kkolinko
Author: kkolinko
Date: Tue Apr 22 15:21:48 2014
New Revision: 1589166

URL: http://svn.apache.org/r1589166
Log:
Reviewing r1589103
s/J2EE/JavaEE/ in a message

Modified:
tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties

Modified: tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties?rev=1589166r1=1589165r2=1589166view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties Tue 
Apr 22 15:21:48 2014
@@ -13,7 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-asyncChannelGroup.createFail=Unable to create dedicated 
AsynchronousChannelGroup for WebSocket clients which is required to prevent 
memory leaks in complex class loader environments like J2EE containers
+asyncChannelGroup.createFail=Unable to create dedicated 
AsynchronousChannelGroup for WebSocket clients which is required to prevent 
memory leaks in complex class loader environments like JavaEE containers
 
 asyncChannelWrapperSecure.closeFail=Failed to close channel cleanly
 asyncChannelWrapperSecure.concurrentRead=Concurrent read operations are not 
permitted



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



svn commit: r1589170 - /tomcat/trunk/webapps/docs/changelog.xml

2014-04-22 Thread kkolinko
Author: kkolinko
Date: Tue Apr 22 15:33:36 2014
New Revision: 1589170

URL: http://svn.apache.org/r1589170
Log:
Correct a typo
Add changelog entry for Tomcat Native upgrade

Modified:
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1589170r1=1589169r2=1589170view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Tue Apr 22 15:33:36 2014
@@ -119,7 +119,7 @@
   fix
 bug56409/bug: Avoid codeStackOverflowError/code on non-Windows
 systems if a file named code\/code is encountered when scanning for
-TLDs. (mark)
+TLDs. (markt)
   /fix
 /changelog
   /subsection
@@ -254,6 +254,10 @@
 one installed by the *.exe installer. Print a warning in case if 
neither
 server nor client jvm is found by codeservice.bat/code. (kkolinko)
   /fix
+  update
+bug56363/bug: Update to version 1.1.30 of Tomcat Native library.
+(schultz)
+  /update
 /changelog
   /subsection
 /section



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



svn commit: r1589175 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/websocket/LocalStrings.properties webapps/docs/changelog.xml

2014-04-22 Thread kkolinko
Author: kkolinko
Date: Tue Apr 22 15:37:02 2014
New Revision: 1589175

URL: http://svn.apache.org/r1589175
Log:
Merged revisions r1589166, r1589165, r1589170 from tomcat/trunk:
Reviewing r1589103
s/J2EE/JavaEE/ in a message
Correct a typo in changelog
Add changelog entry for Tomcat Native upgrade

Modified:
tomcat/tc7.0.x/trunk/   (props changed)

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc7.0.x/trunk/
--
  Merged /tomcat/trunk:r1589165-1589166,1589170

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties?rev=1589175r1=1589174r2=1589175view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties 
(original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties 
Tue Apr 22 15:37:02 2014
@@ -13,7 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-asyncChannelGroup.createFail=Unable to create dedicated 
AsynchronousChannelGroup for WebSocket clients which is required to prevent 
memory leaks in complex class loader environments like J2EE containers
+asyncChannelGroup.createFail=Unable to create dedicated 
AsynchronousChannelGroup for WebSocket clients which is required to prevent 
memory leaks in complex class loader environments like JavaEE containers
 
 asyncChannelWrapperSecure.closeFail=Failed to close channel cleanly
 asyncChannelWrapperSecure.concurrentRead=Concurrent read operations are not 
permitted

Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1589175r1=1589174r2=1589175view=diff
==
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Tue Apr 22 15:37:02 2014
@@ -99,7 +99,7 @@
   fix
 bug56409/bug: Avoid codeStackOverflowError/code on non-Windows
 systems if a file named code\/code is encountered when scanning for
-TLDs. (mark)
+TLDs. (markt)
   /fix
 /changelog
   /subsection
@@ -160,7 +160,7 @@
   fix
 Increase the default maximum size of the executor used by the WebSocket
 implementation for call backs associated with asynchronous writes from
-10 to 200. (markt) 
+10 to 200. (markt)
   /fix
   add
 Add a warning if the thread group created for WebSocket asynchronous
@@ -199,6 +199,10 @@
 one installed by the *.exe installer. Print a warning in case if 
neither
 server nor client jvm is found by codeservice.bat/code. (kkolinko)
   /fix
+  update
+bug56363/bug: Update to version 1.1.30 of Tomcat Native library.
+(schultz)
+  /update
 /changelog
   /subsection
 /section



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



[Bug 56442] ClassNotFoundException does not produce error

2014-04-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56442

Mark Thomas ma...@apache.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |WORKSFORME

--- Comment #1 from Mark Thomas ma...@apache.org ---
The CNFE is already logged with a clean install of 8.0.x.

-- 
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 56391] test error for NIO and org.apache.tomcat.util.net.TestSsl

2014-04-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56391

Mark Thomas ma...@apache.org changed:

   What|Removed |Added

 Status|NEW |NEEDINFO

--- Comment #5 from Mark Thomas ma...@apache.org ---
Is this repeatable? It is possible that the test behaves differently on Solaris
and we simply don't handle it.

-- 
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: r1589195 - /tomcat/tc6.0.x/trunk/STATUS.txt

2014-04-22 Thread kkolinko
Author: kkolinko
Date: Tue Apr 22 16:15:49 2014
New Revision: 1589195

URL: http://svn.apache.org/r1589195
Log:
veto, as I think the new options do not work

Modified:
tomcat/tc6.0.x/trunk/STATUS.txt

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1589195r1=1589194r2=1589195view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Tue Apr 22 16:15:49 2014
@@ -105,10 +105,17 @@ PATCHES PROPOSED TO BACKPORT:
   http://svn.apache.org/viewvc?view=revisionamp;revision=r1587723 (adapt)
   (Note: requires tcnative 1.1.30)
   +1: schultz, markt, remm
-  +0: kkolinko:
-   a) It needs backport of r1588102 as an Exception is thrown by native 
code
+  -1: kkolinko:
+   a) I cannot test (without FIPS-enabled library), but from my code review
+  the new options will not work because you are not setting
+  fipsModeActive field in AprLifecycleListener.
 
-   b) enterFipsMode = 1 != fipsModeState; code and comment before it are 
wrong.
+  Thus AprLifecycleListener.isFIPSModeActive() will return false
+  and startup will be aborted.
+
+   b) It needs backport of r1588102 as an Exception is thrown by native 
code
+
+   c) enterFipsMode = 1 != fipsModeState; code and comment before it are 
wrong.
 
   FIPS_mode() function of OpenSSL is documented to return non-zero
   value when in FIPS mode. You cannot expect it to be '1'.



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



[Bug 56391] test error for NIO and org.apache.tomcat.util.net.TestSsl

2014-04-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56391

--- Comment #6 from Rainer Jung rainer.j...@kippdata.de ---
Not here. Just ran that test 10 times for Tomcat 8 trunk with NIO, BIO and APR
each on Solaris 10 Sparc using Java 1.7.0_51. No failures.

Petr: Can you reproduce?

-- 
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 56391] test error for NIO and org.apache.tomcat.util.net.TestSsl

2014-04-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56391

--- Comment #7 from Remy Maucherat r...@apache.org ---
I could randomly reproduce it (on Linux), same stack trace. But it is odd, it
does not happen with NIO2 for me, and I don't see why it wouldn't (the SSL code
is the same use of SSL engine). I can't reproduce it if I run as a single test,
but I can (one out of four times, I'd say) if running the full TestSsl series.

Minor issue IMO since this doesn't happen much and this renegotiation test is
just protocol abuse anyway.

-- 
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 56391] test error for NIO and org.apache.tomcat.util.net.TestSsl

2014-04-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56391

--- Comment #8 from Mark Thomas ma...@apache.org ---
I can't reproduce this on Windows or OSX (tried 10+ runs) either.

-- 
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 56430] Extension mapping that includes a dot in the extension does not work

2014-04-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56430

--- Comment #5 from Karl Peterbauer k...@peterbauer.cc ---
I think both the Servlet spec and Tomcat's implementation are quite
unfortunate. Patterns like '*.jsp' or '*.my.txt' closely resemble the venerable
UNIX glob style pattern matching, and consequenty they should behave
accordingly. For example, the UNIX command ls *.my.txt does match a file
named test.my.txt.

-- 
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 56415] EXCEPTION_ACCESS_VIOLATION (0xc0000005) in tcnative-1.dll

2014-04-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56415

Christopher Schultz ch...@christopherschultz.net changed:

   What|Removed |Added

 OS||All

--- Comment #4 from Christopher Schultz ch...@christopherschultz.net ---
There are two performance-related items of note when switching from APR to NIO.

The first is with SSL. If you are having Tomcat terminate SSL, you will see a
noticeable drop in performance when compared to OpenSSL (which APR uses).
Something like a 25% drop wouldn't surprise me. It will depend upon your load
profile.

The second is that you will notice CPU usage on the server increase a bit over
use of APR. You may notice CPU usage triple or quadruple when compared to
running APR without any other load on the server. PLEASE NOTE THAT I'M
COMPARING ONLY THE OVERHEAD OF TOMCAT'S CONNECTORS, HERE. That means that if
your server is running at 60% CPU load most of the time, I'm not claiming that
you'll suddenly need 240% of your CPU in order to keep up. Remember that
Tomcat's connector only uses a tiny slice of the CPU compared to whatever your
own web application is doing.

To switch to the NIO connector, please read Tomcat's user guide. There is a
section on Connectors which for some reason does not link to the Connectors
section in the Configuration guide. The configuration guide is what you want.

-- 
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 56430] Extension mapping that includes a dot in the extension does not work

2014-04-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56430

Christopher Schultz ch...@christopherschultz.net changed:

   What|Removed |Added

 Resolution|WORKSFORME  |INVALID

--- Comment #6 from Christopher Schultz ch...@christopherschultz.net ---
Thanks for the further clarification, Konstantin. I stopped reading too soon. I
see Tomcat as implementing the spec faithfully, here, so there is no bug.
Marking INVALID.

If you'd like to request an enhancement, please REOPEN this bug and state your
request.

-- 
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 56441] Misleading error message in FilterBase cause by invalid regex

2014-04-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56441

--- Comment #1 from Christopher Schultz ch...@christopherschultz.net ---
Confirmed.

It seems that IntrospectionUtils.setProperty catches things like
InvocationTargetException and logs them at the DEBUG level. I assert that such
things should be logged at the WARN level.

Without DEBUG logging enabled, a user cannot see the underlying error.

-- 
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 propchange: r1588102 - svn:log

2014-04-22 Thread Christopher Schultz
Mark/Konstantin,

On 4/18/14, 11:29 AM, kkoli...@apache.org wrote:
 Author: kkolinko
 Revision: 1588102
 Modified property: svn:log
 
 Modified: svn:log at Fri Apr 18 15:29:06 2014
 --
 --- svn:log (original)
 +++ svn:log Fri Apr 18 15:29:06 2014
 @@ -1 +1,3 @@
  Fix an Eclipse nag
 +Correct signature of SSL.fipsModeGet(),
 +as native code is implemented as throwing an Exception in this method.

Why single-out this method only to have its method signature changed?

Nearly every native method in SSL.java can throw an exception. I was
just following convention.

-chris



signature.asc
Description: OpenPGP digital signature


Re: svn propchange: r1588102 - svn:log

2014-04-22 Thread Mark Thomas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 22/04/2014 20:53, Christopher Schultz wrote:
 Mark/Konstantin,
 
 On 4/18/14, 11:29 AM, kkoli...@apache.org wrote:
 Author: kkolinko Revision: 1588102 Modified property: svn:log
 
 Modified: svn:log at Fri Apr 18 15:29:06 2014 
 --

 
- --- svn:log (original)
 +++ svn:log Fri Apr 18 15:29:06 2014 @@ -1 +1,3 @@ Fix an Eclipse
 nag +Correct signature of SSL.fipsModeGet(), +as native code is
 implemented as throwing an Exception in this method.
 
 Why single-out this method only to have its method signature
 changed?
 
 Nearly every native method in SSL.java can throw an exception. I
 was just following convention.

Because you documented the Exception in the Javadoc without declaring
it in the code and that triggered an IDE warning. The 8.0.x code is
kept warning free so either the Javadoc had to be removed or the
declaration corrected. Correcting the declaration seemed to be the
better option since it is possible for an exception to be thrown in
this case.

Mark

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJTVsnKAAoJEBDAHFovYFnnPDoP/Roc+9RwZnCSnZIj7Kf+Xrt9
Mu7VcrkxthxM4+QOtWXv75iQ9IWr+q2NGwwt6WbFjkfDRl3dYlMvvBwKlDYYTyZG
PSLOJ38+LK+bufCLaFF2ZuXKnlQsEwiD3Sn9EqOJljlOtLhv+BjzOIEESMzaUTPC
sgZs/d2GfiFBiYyiq6T2+zwisSbWCRw1/yE3Dv+cj1EKaC1oNlp8wv4yvap+wIRr
RcszeZeIK3uID7gezZ74hu6eODRHPOYZeqtsu4jGLD7fD9Zh0B8hK4u3o/Mu2Al5
NGYDYAXmXGwS7PJIK37AonBO9vN4tEGbRhqhn4+F+ERGt30t4crbtXVziwJKJWYQ
CV74o+nJhjd7nCUMmNqKuNzGsIKzE8b1nI61taI1pyMSa13CxXcVvDcdiCSnDqAT
bgYF9bGyPi1YWAY5JwL4J8T5PwsGc996z/LyQQaPu65UGqNblyfT7WyUO79Pg4DS
sW+eItWLiPbr1eAIEk2LEu7jlCmZ+ZQnDqzmcFSjvAQZYJwEZAIvSEDgsZ8H7TQJ
7dM/4DqQAXfi5RtsGXPmTp7V4tAE6e7zckIbJ+LZUtej6PsuApnMmTIIgoCwAkuz
cIYyaaYik6eArPUjz7zsVIOsK/PO5wYebIxNCObPCGQ2D3eoC+VzQvl3vgu2SWLW
n+5/rpv0/twEGzc13dxp
=yA+j
-END PGP SIGNATURE-

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



Re: svn propchange: r1588102 - svn:log

2014-04-22 Thread Konstantin Kolinko
2014-04-22 23:53 GMT+04:00 Christopher Schultz ch...@christopherschultz.net:
 Mark/Konstantin,

 On 4/18/14, 11:29 AM, kkoli...@apache.org wrote:
 Author: kkolinko
 Revision: 1588102
 Modified property: svn:log

 Modified: svn:log at Fri Apr 18 15:29:06 2014
 --
 --- svn:log (original)
 +++ svn:log Fri Apr 18 15:29:06 2014
 @@ -1 +1,3 @@
  Fix an Eclipse nag
 +Correct signature of SSL.fipsModeGet(),
 +as native code is implemented as throwing an Exception in this method.

 Why single-out this method only to have its method signature changed?

 Nearly every native method in SSL.java can throw an exception. I was
 just following convention.


Good catch.
Then those other methods that throw exceptions in their native code
need them documented and their signatures fixed as well.

E.g. fipsModeSet()


Best regards,
Konstantin Kolinko

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



Re: svn propchange: r1588102 - svn:log

2014-04-22 Thread Christopher Schultz
Mark,

On 4/22/14, 3:58 PM, Mark Thomas wrote:
 On 22/04/2014 20:53, Christopher Schultz wrote:
 Mark/Konstantin,
 
 On 4/18/14, 11:29 AM, kkoli...@apache.org wrote:
 Author: kkolinko Revision: 1588102 Modified property: svn:log

 Modified: svn:log at Fri Apr 18 15:29:06 2014 
 --


 --- svn:log (original)
 +++ svn:log Fri Apr 18 15:29:06 2014 @@ -1 +1,3 @@ Fix an Eclipse
 nag +Correct signature of SSL.fipsModeGet(), +as native code is
 implemented as throwing an Exception in this method.
 
 Why single-out this method only to have its method signature
 changed?
 
 Nearly every native method in SSL.java can throw an exception. I
 was just following convention.
 
 Because you documented the Exception in the Javadoc without declaring
 it in the code and that triggered an IDE warning. The 8.0.x code is
 kept warning free so either the Javadoc had to be removed or the
 declaration corrected. Correcting the declaration seemed to be the
 better option since it is possible for an exception to be thrown in
 this case.

Fair enough. Shall we change the other methods in SSL.java as well?

Any particular reason you removed the 'final' from fipsModeState?

-chris



signature.asc
Description: OpenPGP digital signature


Re: svn propchange: r1588102 - svn:log

2014-04-22 Thread Mark Thomas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 22/04/2014 21:15, Christopher Schultz wrote:
 Mark,
 
 On 4/22/14, 3:58 PM, Mark Thomas wrote:
 On 22/04/2014 20:53, Christopher Schultz wrote:
 Mark/Konstantin,
 
 On 4/18/14, 11:29 AM, kkoli...@apache.org wrote:
 Author: kkolinko Revision: 1588102 Modified property:
 svn:log
 
 Modified: svn:log at Fri Apr 18 15:29:06 2014 
 --



 
- --- svn:log (original)
 +++ svn:log Fri Apr 18 15:29:06 2014 @@ -1 +1,3 @@ Fix an
 Eclipse nag +Correct signature of SSL.fipsModeGet(), +as
 native code is implemented as throwing an Exception in this
 method.
 
 Why single-out this method only to have its method signature 
 changed?
 
 Nearly every native method in SSL.java can throw an exception.
 I was just following convention.
 
 Because you documented the Exception in the Javadoc without
 declaring it in the code and that triggered an IDE warning. The
 8.0.x code is kept warning free so either the Javadoc had to be
 removed or the declaration corrected. Correcting the declaration
 seemed to be the better option since it is possible for an
 exception to be thrown in this case.
 
 Fair enough. Shall we change the other methods in SSL.java as
 well?

That is worth doing but I'd do that as a separate clean up task.

 Any particular reason you removed the 'final' from fipsModeState?

Yes. If the reason is not immediately obvious to you I suggest you
restore it and then try and compile the class.

Mark

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJTVs6mAAoJEBDAHFovYFnnivYQAKQDeQa4bFO0ewqFhQz9UQt1
zPYIBzK/grOID+SPdPLWbmL4bq2G4K1PuZFvvjwfGYzdYVFoLZ0a5sauGc3WWv2/
seGQ00kqOLCr4SiXslvyYTq35hewoJTcrCONzQ880IHqQ5VgrB0G2ZAKewpJBX+S
6bvr90CZLgBTP/Myl16RkBr6fW5y2yOIh6RMnYwbCby+Nw7fqxzsNTdCFyvtfpIQ
G/41Xa3c2msNL+0uReKrOBM9fgN9Y/HPIWc5NTlqHC/RB9RcmX9C6pP/GSomIwBs
XEJ8WUoLfvc2ynH0HjWw33Cu2/+IwlG8xoubJE2ragOBSKGOCHUle2SNF7/1/itc
vZsR/G3GB46BuMFMShQ726mEX3g4UFnriAg+9Jz+s5CMx64QPgro1cVWVsgXTb6v
DUNDQkzAAaATxeurvaog6B8Yo3HIGONk5IooA/PwyN4rDTDhaoWYGNfleZvVfbxt
98Mt1T5Dbkr/bqhxb5Rwht3al7gUMZ2RGxf1rhid5AFv8pdcPcpqLU7jVzfNFo46
1CMpO8HYpMe1Wa1nfeN5Yjl3h5YiqMCDhnse23JYr1N9m0JvLy73EQJE1vuPnr7T
K1ngelviByJom3SAuxjPS7EfVVDn1k2HLwn7gKz1iO971tANyrm12i/MHRq66v/1
DqmvW9ZsUQSxtfLNgsAy
=nMMw
-END PGP SIGNATURE-

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



Re: svn commit: r1589195 - /tomcat/tc6.0.x/trunk/STATUS.txt

2014-04-22 Thread Christopher Schultz
Konstantin,

On 4/22/14, 12:15 PM, kkoli...@apache.org wrote:
 Author: kkolinko
 Date: Tue Apr 22 16:15:49 2014
 New Revision: 1589195
 
 URL: http://svn.apache.org/r1589195
 Log:
 veto, as I think the new options do not work
 
 Modified:
 tomcat/tc6.0.x/trunk/STATUS.txt
 
 Modified: tomcat/tc6.0.x/trunk/STATUS.txt
 URL: 
 http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1589195r1=1589194r2=1589195view=diff
 ==
 --- tomcat/tc6.0.x/trunk/STATUS.txt (original)
 +++ tomcat/tc6.0.x/trunk/STATUS.txt Tue Apr 22 16:15:49 2014
 @@ -105,10 +105,17 @@ PATCHES PROPOSED TO BACKPORT:
http://svn.apache.org/viewvc?view=revisionamp;revision=r1587723 (adapt)
(Note: requires tcnative 1.1.30)
+1: schultz, markt, remm
 -  +0: kkolinko:
 -   a) It needs backport of r1588102 as an Exception is thrown by native 
 code
 +  -1: kkolinko:
 +   a) I cannot test (without FIPS-enabled library), but from my code 
 review
 +  the new options will not work because you are not setting
 +  fipsModeActive field in AprLifecycleListener.

Perhaps my eyes are not finding this. I see 3 places in the
AprLifecycleListener where fipsModeActive flag is set to an explicit value.

There does appear to be a bug in that fipsModeActive is not being set to
true in the case where OpenSSL was already in FIPS mode, and we aren't
going to bother to try to enter it (i.e. FIPSMode=require and OpenSSL
is already in FIPS mode). I'll fix that in trunk and add it to the proposal.

 -   b) enterFipsMode = 1 != fipsModeState; code and comment before it 
 are wrong.
 +  Thus AprLifecycleListener.isFIPSModeActive() will return false
 +  and startup will be aborted.
 +
 +   b) It needs backport of r1588102 as an Exception is thrown by native 
 code

No, it doesn't need that to be backported. One could argue it never
needed to be committed in the first place. I would have been happier
throwing a better exception than java.lang.Exception, but it seemed like
java.lang.Exception was being used everywhere already.


 +   c) enterFipsMode = 1 != fipsModeState; code and comment before it 
 are wrong.
  
FIPS_mode() function of OpenSSL is documented to return non-zero
value when in FIPS mode. You cannot expect it to be '1'.

We *must* expect it to be '1'. I've gone through great pains to add
in-line documentation explaining the stupidity behind OpenSSL's
confusing documentation that any non-zero value will work as long as
that non-zero value is 1. Perhaps this is a case where I should have
used FIPS_ON. One could argue that checking for any non-zero value would
be more appropriate, here, but it's not /wrong/.

-chris



signature.asc
Description: OpenPGP digital signature


Re: svn propchange: r1588102 - svn:log

2014-04-22 Thread Christopher Schultz
Mark,

On 4/22/14, 4:18 PM, Mark Thomas wrote:
 On 22/04/2014 21:15, Christopher Schultz wrote:
 Mark,
 
 On 4/22/14, 3:58 PM, Mark Thomas wrote:
 On 22/04/2014 20:53, Christopher Schultz wrote:
 Mark/Konstantin,

 On 4/18/14, 11:29 AM, kkoli...@apache.org wrote:
 Author: kkolinko Revision: 1588102 Modified property:
 svn:log

 Modified: svn:log at Fri Apr 18 15:29:06 2014 
 --




 --- svn:log (original)
 +++ svn:log Fri Apr 18 15:29:06 2014 @@ -1 +1,3 @@ Fix an
 Eclipse nag +Correct signature of SSL.fipsModeGet(), +as
 native code is implemented as throwing an Exception in this
 method.

 Why single-out this method only to have its method signature 
 changed?

 Nearly every native method in SSL.java can throw an exception.
 I was just following convention.

 Because you documented the Exception in the Javadoc without
 declaring it in the code and that triggered an IDE warning. The
 8.0.x code is kept warning free so either the Javadoc had to be
 removed or the declaration corrected. Correcting the declaration
 seemed to be the better option since it is possible for an
 exception to be thrown in this case.
 
 Fair enough. Shall we change the other methods in SSL.java as
 well?
 
 That is worth doing but I'd do that as a separate clean up task.
 
 Any particular reason you removed the 'final' from fipsModeState?
 
 Yes. If the reason is not immediately obvious to you I suggest you
 restore it and then try and compile the class.

Before posting, I checked just so I wouldn't embarrass myself. It worked
just fine. My guess is that you changed the implementation to throw an
exception after removing the 'final' which then makes the 'final' legal
again.

-chris



signature.asc
Description: OpenPGP digital signature


Re: svn propchange: r1588102 - svn:log

2014-04-22 Thread Mark Thomas
On 22/04/2014 21:21, Christopher Schultz wrote:

 Before posting, I checked just so I wouldn't embarrass myself. It
 worked just fine. My guess is that you changed the implementation
 to throw an exception after removing the 'final' which then makes
 the 'final' legal again.

I don't see any variation that includes final that compiles.

Option 1:

int final fipsModeState;
try {
fipsModeState = SSL.fipsModeGet();
} catch (Exception e) {
throw new IllegalStateException(e);
}


This failure looks correct to me since it should be illegal to change
the value of a final variable after it has been declared.


Option 2:
try {
int final fipsModeState = SSL.fipsModeGet();
} catch (Exception e) {
throw new IllegalStateException(e);
}

This code snippet it OK but compilation fails as the scope of
fipsModeState is now limited to the try block and it is needed outside
of that so again, compilation fails.


How do you propose to mark fipsModeState as final and still have the
code compile?

Mark

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



Re: svn propchange: r1588102 - svn:log

2014-04-22 Thread Konstantin Kolinko
2014-04-23 0:30 GMT+04:00 Mark Thomas ma...@apache.org:
 On 22/04/2014 21:21, Christopher Schultz wrote:

 Before posting, I checked just so I wouldn't embarrass myself. It
 worked just fine. My guess is that you changed the implementation
 to throw an exception after removing the 'final' which then makes
 the 'final' legal again.

 I don't see any variation that includes final that compiles.

 Option 1:

 int final fipsModeState;
 try {
 fipsModeState = SSL.fipsModeGet();
 } catch (Exception e) {
 throw new IllegalStateException(e);
 }


 This failure looks correct to me since it should be illegal to change
 the value of a final variable after it has been declared.

1. s/ declared / assigned /

2. The syntax is
final int fipsModeState;

;)

Best regards,
Konstantin Kolinko

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



Re: svn propchange: r1588102 - svn:log

2014-04-22 Thread Christopher Schultz
Mark,

On 4/22/14, 4:30 PM, Mark Thomas wrote:
 On 22/04/2014 21:21, Christopher Schultz wrote:
 
 Before posting, I checked just so I wouldn't embarrass myself. It
 worked just fine. My guess is that you changed the implementation
 to throw an exception after removing the 'final' which then makes
 the 'final' legal again.
 
 I don't see any variation that includes final that compiles.
 
 Option 1:
 
 int final fipsModeState;
 try {
 fipsModeState = SSL.fipsModeGet();
 } catch (Exception e) {
 throw new IllegalStateException(e);
 }
 
 
 This failure looks correct to me since it should be illegal to change
 the value of a final variable after it has been declared.
 
 
 Option 2:
 try {
 int final fipsModeState = SSL.fipsModeGet();
 } catch (Exception e) {
 throw new IllegalStateException(e);
 }
 
 This code snippet it OK but compilation fails as the scope of
 fipsModeState is now limited to the try block and it is needed outside
 of that so again, compilation fails.
 
 
 How do you propose to mark fipsModeState as final and still have the
 code compile?

$ cat FinalTest.java
public class FinalTest {
  public static void main(String[] args) {
final int fipsModeState;

try {
  fipsModeState = 1;
} catch (Exception e) {
  // Do nothing
}
  }
}
$ javac -J-showversion FinalTest.java
java version 1.7.0_55
Java(TM) SE Runtime Environment (build 1.7.0_55-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.55-b03, mixed mode)
[no warnings. no errors]

Honestly, I was surprised to see that the compiler allows a code path
where fipsModeState was not set. It seems that the compiler allows you
to get by until you try to actually use the value, at which point you'll
get an uninitialized local error.

-chris



signature.asc
Description: OpenPGP digital signature


Re: svn propchange: r1588102 - svn:log

2014-04-22 Thread Mark Thomas
On 22/04/2014 21:35, Konstantin Kolinko wrote:
 2014-04-23 0:30 GMT+04:00 Mark Thomas ma...@apache.org:
 On 22/04/2014 21:21, Christopher Schultz wrote:

 Before posting, I checked just so I wouldn't embarrass myself. It
 worked just fine. My guess is that you changed the implementation
 to throw an exception after removing the 'final' which then makes
 the 'final' legal again.

 I don't see any variation that includes final that compiles.

 Option 1:

 int final fipsModeState;
 try {
 fipsModeState = SSL.fipsModeGet();
 } catch (Exception e) {
 throw new IllegalStateException(e);
 }


 This failure looks correct to me since it should be illegal to change
 the value of a final variable after it has been declared.
 
 1. s/ declared / assigned /
 
 2. The syntax is
 final int fipsModeState;
 
 ;)

Doh!

No objection to the final being restored, it is good practice to use
final when possible.

It isn't something that has been used much elsewhere in the Tomcat code
base. Is there much benefit to going through and adding it everywhere it
could be used? If I recall correctly, the UCDetector plugin can flag up
all the places where this can be done and probably add them as well.

Mark


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



Re: svn commit: r1589195 - /tomcat/tc6.0.x/trunk/STATUS.txt

2014-04-22 Thread Konstantin Kolinko
2014-04-23 0:13 GMT+04:00 Christopher Schultz ch...@christopherschultz.net:
 Konstantin,

 On 4/22/14, 12:15 PM, kkoli...@apache.org wrote:
 Author: kkolinko
 Date: Tue Apr 22 16:15:49 2014
 New Revision: 1589195


 +   c) enterFipsMode = 1 != fipsModeState; code and comment before it 
 are wrong.

FIPS_mode() function of OpenSSL is documented to return non-zero
value when in FIPS mode. You cannot expect it to be '1'.

 We *must* expect it to be '1'. I've gone through great pains to add
 in-line documentation explaining the stupidity behind OpenSSL's
 confusing documentation that any non-zero value will work as long as
 that non-zero value is 1. Perhaps this is a case where I should have
 used FIPS_ON. One could argue that checking for any non-zero value would
 be more appropriate, here, but it's not /wrong/.


http://wiki.openssl.org/index.php/FIPS_mode%28%29
says
values other than 1 may have additional significance such as
designating an additional restriction to Suite B algorithms.

If you really expect 1  (or let's assume that the value of FIPS_ON
is configurable),
then non-1 value does not mean that FIPS mode is off.
It means FIPS mode value is different from expected and would better
have a separate error message.

Best regards,
Konstantin Kolinko

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



[Bug 56430] Extension mapping that includes a dot in the extension does not work

2014-04-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56430

--- Comment #7 from Remy Maucherat r...@apache.org ---
As an enhancement, it should be fine to say the rewrite valve should be used.
It is a generic solution that can take care of any matching scenario, but it
would be bad to add tiny proprietary extensions however.

-- 
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 propchange: r1588102 - svn:log

2014-04-22 Thread Konstantin Kolinko
2014-04-23 0:43 GMT+04:00 Mark Thomas ma...@apache.org:
 On 22/04/2014 21:35, Konstantin Kolinko wrote:
 2014-04-23 0:30 GMT+04:00 Mark Thomas ma...@apache.org:
 On 22/04/2014 21:21, Christopher Schultz wrote:

 Before posting, I checked just so I wouldn't embarrass myself. It
 worked just fine. My guess is that you changed the implementation
 to throw an exception after removing the 'final' which then makes
 the 'final' legal again.

 I don't see any variation that includes final that compiles.

 Option 1:

 int final fipsModeState;
 try {
 fipsModeState = SSL.fipsModeGet();
 } catch (Exception e) {
 throw new IllegalStateException(e);
 }


 This failure looks correct to me since it should be illegal to change
 the value of a final variable after it has been declared.

 1. s/ declared / assigned /

 2. The syntax is
 final int fipsModeState;

 ;)

 Doh!

 No objection to the final being restored, it is good practice to use
 final when possible.

 It isn't something that has been used much elsewhere in the Tomcat code
 base. Is there much benefit to going through and adding it everywhere it
 could be used? If I recall correctly, the UCDetector plugin can flag up
 all the places where this can be done and probably add them as well.

I think that it does not change the generated byte code, thus no real
difference.
It is good from documentation point of view (to express you intention
to do not change the variable).

If one goes pedantic way,  I have seen code where 'final' was added to
all parameters of every method. I do not like that code style.

Best regards,
Konstantin Kolinko

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



svn commit: r1589295 - in /tomcat/trunk/test/org/apache/tomcat/util/net: TestClientCert.java TestCustomSsl.java TestSsl.java TesterSupport.java

2014-04-22 Thread markt
Author: markt
Date: Tue Apr 22 21:28:03 2014
New Revision: 1589295

URL: http://svn.apache.org/r1589295
Log:
Tomcat 8 uses Java 7 where RFC 5746 is supported in all versions so remove 
unused/unnecessary code.

Modified:
tomcat/trunk/test/org/apache/tomcat/util/net/TestClientCert.java
tomcat/trunk/test/org/apache/tomcat/util/net/TestCustomSsl.java
tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java
tomcat/trunk/test/org/apache/tomcat/util/net/TesterSupport.java

Modified: tomcat/trunk/test/org/apache/tomcat/util/net/TestClientCert.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/net/TestClientCert.java?rev=1589295r1=1589294r2=1589295view=diff
==
--- tomcat/trunk/test/org/apache/tomcat/util/net/TestClientCert.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/net/TestClientCert.java Tue Apr 22 
21:28:03 2014
@@ -96,11 +96,6 @@ public class TestClientCert extends Tomc
 
 @Override
 public void setUp() throws Exception {
-if (!TesterSupport.RFC_5746_SUPPORTED) {
-// Make sure SSL renegotiation is not disabled in the JVM
-System.setProperty(sun.security.ssl.allowUnsafeRenegotiation, 
true);
-}
-
 super.setUp();
 
 Tomcat tomcat = getTomcatInstance();

Modified: tomcat/trunk/test/org/apache/tomcat/util/net/TestCustomSsl.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/net/TestCustomSsl.java?rev=1589295r1=1589294r2=1589295view=diff
==
--- tomcat/trunk/test/org/apache/tomcat/util/net/TestCustomSsl.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/net/TestCustomSsl.java Tue Apr 22 
21:28:03 2014
@@ -97,12 +97,6 @@ public class TestCustomSsl extends Tomca
 private void doTestCustomTrustManager(boolean serverTrustAll)
 throws Exception {
 
-if (!TesterSupport.RFC_5746_SUPPORTED) {
-// Make sure SSL renegotiation is not disabled in the JVM
-System.setProperty(sun.security.ssl.allowUnsafeRenegotiation,
-true);
-}
-
 Tomcat tomcat = getTomcatInstance();
 
 Assume.assumeTrue(SSL renegotiation has to be supported for this 
test,

Modified: tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java?rev=1589295r1=1589294r2=1589295view=diff
==
--- tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java Tue Apr 22 
21:28:03 2014
@@ -24,8 +24,6 @@ import java.io.InputStreamReader;
 import java.io.OutputStream;
 import java.io.Reader;
 
-import javax.net.ssl.HandshakeCompletedEvent;
-import javax.net.ssl.HandshakeCompletedListener;
 import javax.net.ssl.SSLContext;
 import javax.net.ssl.SSLSocket;
 import javax.net.ssl.SSLSocketFactory;
@@ -34,7 +32,6 @@ import static org.junit.Assert.assertTru
 import static org.junit.Assert.fail;
 
 import org.junit.Assert;
-import org.junit.Assume;
 import org.junit.Test;
 
 import org.apache.catalina.Context;
@@ -92,82 +89,13 @@ public class TestSsl extends TomcatBaseT
 assertTrue(res.toString().indexOf(h1Hello World!/h1)  0);
 }
 
-boolean handshakeDone = false;
-
-@Test
-public void testRenegotiateFail() throws Exception {
-
-// If RFC5746 is supported, renegotiation will always work (and will
-// always be secure)
-if (TesterSupport.RFC_5746_SUPPORTED) {
-return;
-}
-
-Tomcat tomcat = getTomcatInstance();
-
-File appDir = new File(getBuildDirectory(), webapps/examples);
-// app dir is relative to server home
-tomcat.addWebapp(null, /examples, appDir.getAbsolutePath());
-
-TesterSupport.initSsl(tomcat);
-
-// Default - MITM attack prevented
-
-tomcat.start();
-SSLContext sslCtx = SSLContext.getInstance(TLS);
-sslCtx.init(null, TesterSupport.getTrustManagers(), null);
-SSLSocketFactory socketFactory = sslCtx.getSocketFactory();
-SSLSocket socket = (SSLSocket) socketFactory.createSocket(localhost, 
getPort());
-
-socket.addHandshakeCompletedListener(new HandshakeCompletedListener() {
-@Override
-public void handshakeCompleted(HandshakeCompletedEvent event) {
-handshakeDone = true;
-}
-});
-
-OutputStream os = socket.getOutputStream();
-os.write(GET /examples/servlets/servlet/HelloWorldExample 
HTTP/1.0\n.getBytes());
-os.flush();
-
-
-InputStream is = socket.getInputStream();
-
-// Make sure the NIO connector has read the request before the 
handshake
-Thread.sleep(100);
-
-   

svn commit: r1589296 - /tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java

2014-04-22 Thread markt
Author: markt
Date: Tue Apr 22 21:28:53 2014
New Revision: 1589296

URL: http://svn.apache.org/r1589296
Log:
Restore accidently commented out code

Modified:
tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java

Modified: tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java?rev=1589296r1=1589295r2=1589296view=diff
==
--- tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java Tue Apr 22 
21:28:53 2014
@@ -32,6 +32,7 @@ import static org.junit.Assert.assertTru
 import static org.junit.Assert.fail;
 
 import org.junit.Assert;
+import org.junit.Assume;
 import org.junit.Test;
 
 import org.apache.catalina.Context;
@@ -94,8 +95,8 @@ public class TestSsl extends TomcatBaseT
 public void testRenegotiateWorks() throws Exception {
 Tomcat tomcat = getTomcatInstance();
 
-//Assume.assumeTrue(SSL renegotiation has to be supported for this 
test,
-//TesterSupport.isRenegotiationSupported(getTomcatInstance()));
+Assume.assumeTrue(SSL renegotiation has to be supported for this 
test,
+TesterSupport.isRenegotiationSupported(getTomcatInstance()));
 
 File appDir = new File(getBuildDirectory(), webapps/examples);
 // app dir is relative to server home



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



svn commit: r1589299 - /tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java

2014-04-22 Thread markt
Author: markt
Date: Tue Apr 22 21:59:26 2014
New Revision: 1589299

URL: http://svn.apache.org/r1589299
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56391
Re-write renegotiation test to test that renegotiation works rather than to 
test that an exception is not triggered it it is attempted.

Modified:
tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java

Modified: tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java?rev=1589299r1=1589298r2=1589299view=diff
==
--- tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java Tue Apr 22 
21:59:26 2014
@@ -16,7 +16,6 @@
  */
 package org.apache.tomcat.util.net;
 
-import java.io.BufferedReader;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
@@ -24,18 +23,21 @@ import java.io.InputStreamReader;
 import java.io.OutputStream;
 import java.io.Reader;
 
+import javax.net.ssl.HandshakeCompletedEvent;
+import javax.net.ssl.HandshakeCompletedListener;
 import javax.net.ssl.SSLContext;
 import javax.net.ssl.SSLSocket;
 import javax.net.ssl.SSLSocketFactory;
 
 import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
 
 import org.junit.Assert;
 import org.junit.Assume;
 import org.junit.Test;
 
 import org.apache.catalina.Context;
+import org.apache.catalina.Wrapper;
+import org.apache.catalina.startup.TesterServlet;
 import org.apache.catalina.startup.Tomcat;
 import org.apache.catalina.startup.TomcatBaseTest;
 import org.apache.tomcat.util.buf.ByteChunk;
@@ -98,12 +100,11 @@ public class TestSsl extends TomcatBaseT
 Assume.assumeTrue(SSL renegotiation has to be supported for this 
test,
 TesterSupport.isRenegotiationSupported(getTomcatInstance()));
 
-File appDir = new File(getBuildDirectory(), webapps/examples);
-// app dir is relative to server home
-Context ctxt = tomcat.addWebapp(null, /examples,
-appDir.getAbsolutePath());
-ctxt.addApplicationListener(new ApplicationListener(
-WsContextListener.class.getName(), false));
+Context root = tomcat.addContext(, TEMP_DIR);
+Wrapper w =
+Tomcat.addServlet(root, tester, new TesterServlet());
+w.setAsyncSupported(true);
+root.addServletMapping(/, tester);
 
 TesterSupport.initSsl(tomcat);
 
@@ -116,33 +117,71 @@ public class TestSsl extends TomcatBaseT
 getPort());
 
 OutputStream os = socket.getOutputStream();
+InputStream is = socket.getInputStream();
+Reader r = new InputStreamReader(is);
 
-os.write(GET /examples/servlets/servlet/HelloWorldExample 
HTTP/1.1\n.getBytes());
-os.flush();
+doRequest(os, r);
+
+TesterHandshakeListener listener = new TesterHandshakeListener();
+socket.addHandshakeCompletedListener(listener);
 
 socket.startHandshake();
 
-try {
-os.write(Host: localhost\n\n.getBytes());
-} catch (IOException ex) {
-ex.printStackTrace();
-fail(Re-negotiation failed);
+// One request should be sufficient
+int requestCount = 0;
+while (!listener.isComplete()  requestCount  5) {
+doRequest(os, r);
+requestCount++;
 }
 
-InputStream is = socket.getInputStream();
-Reader r = new InputStreamReader(is);
-BufferedReader br = new BufferedReader(r);
-String line = br.readLine();
-Assert.assertEquals(HTTP/1.1 200 OK, line);
-while (line != null) {
-// For debugging System.out.println(line);
-// Linux clients see a Connection Reset in some circumstances and a
-// clean close in others.
-try {
-line = br.readLine();
-} catch (IOException ioe) {
-line = null;
+Assert.assertTrue(listener.isComplete());
+System.out.println(Renegotiation completed after  + requestCount +  
requests);
+}
+
+private void doRequest(OutputStream os, Reader r) throws IOException {
+char[] expectedResponseLine = HTTP/1.1 200 OK\r\n.toCharArray();
+
+os.write(GET /tester HTTP/1.1\r\n.getBytes());
+os.write(Host: localhost\r\n.getBytes());
+os.write(Connection: Keep-Alive\r\n\r\n.getBytes());
+os.flush();
+
+// First check we get the expected response line
+for (char c : expectedResponseLine) {
+int read = r.read();
+Assert.assertEquals(c, read);
+}
+
+// Skip to the end of the headers
+char[] endOfHeaders =\r\n\r\n.toCharArray();
+int found = 0;
+while (found != endOfHeaders.length) {
+if (r.read() == 

svn commit: r1589300 - /tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java

2014-04-22 Thread markt
Author: markt
Date: Tue Apr 22 22:07:58 2014
New Revision: 1589300

URL: http://svn.apache.org/r1589300
Log:
Windows OK. Seeing failures on Linux - add debug code.

Modified:
tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java

Modified: tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java?rev=1589300r1=1589299r2=1589300view=diff
==
--- tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java Tue Apr 22 
22:07:58 2014
@@ -129,9 +129,15 @@ public class TestSsl extends TomcatBaseT
 
 // One request should be sufficient
 int requestCount = 0;
-while (!listener.isComplete()  requestCount  5) {
-doRequest(os, r);
-requestCount++;
+try {
+while (!listener.isComplete()  requestCount  5) {
+requestCount++;
+doRequest(os, r);
+}
+} catch (IOException ioe) {
+Assert.fail(Failed on request number  + requestCount +
+ after startHandshake());
+throw ioe;
 }
 
 Assert.assertTrue(listener.isComplete());



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



[Bug 56391] test error for NIO and org.apache.tomcat.util.net.TestSsl

2014-04-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56391

Mark Thomas ma...@apache.org changed:

   What|Removed |Added

 Status|NEEDINFO|NEW

--- Comment #9 from Mark Thomas ma...@apache.org ---
I've re-written the unit test. It still passes on Windows but now fails much
more frequently on Windows. Getting to the bottom of why it fails is the next
task.

-- 
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 56391] test error for NIO and org.apache.tomcat.util.net.TestSsl

2014-04-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56391

--- Comment #10 from Konstantin Kolinko knst.koli...@gmail.com ---
With trunk at r1589300 the test now fails for me consistently in 10 of 10 runs
on Windows 7 + JDK 7u55 32-bit.

I am running with

execute.validate=false
execute.test.bio=false
execute.test.nio=true
execute.test.apr=false
execute.test.nio2=false
test.accesslog=false
test.entry=org.apache.tomcat.util.net.TestSsl
test.entry.methods=testSimpleSsl,testKeyPass,testRenegotiateWorks,testRenegotiateFail

The last property is to fix order of the methods.

All 10 failures are with the same 72 vs -1 failure:
[[[
Testcase: testSimpleSsl took 4,581 sec
Testcase: testKeyPass took 0,926 sec
Testcase: testRenegotiateWorks took 3,418 sec
FAILED
expected:72 but was:-1
junit.framework.AssertionFailedError: expected:72 but was:-1
at org.apache.tomcat.util.net.TestSsl.doRequest(TestSsl.java:158)
at
org.apache.tomcat.util.net.TestSsl.testRenegotiateWorks(TestSsl.java:135)
]]]

Apparently there is no more testRenegotiateFail test, so only 3 tests methods
were run.

-- 
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 56391] test error for NIO and org.apache.tomcat.util.net.TestSsl

2014-04-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56391

--- Comment #11 from Remy Maucherat r...@apache.org ---
On Linux it fails 100% of the time too now (it used to be about 50%). NIO2
still does not fail for whatever reason. I can investigate tomorrow if needed.

My trace is on Linux is:
Testcase: testRenegotiateWorks took 3.216 sec
FAILED
Failed on request number 1 after startHandshake()
junit.framework.AssertionFailedError: Failed on request number 1 after
startHandshake()
at
org.apache.tomcat.util.net.TestSsl.testRenegotiateWorks(TestSsl.java:138)

Yes, testRenegotiateFail is gone, it is not needed as trunk requires Java 7,
according to the commit.

BTW http://ci.apache.org/builders/tomcat-trunk is up again, but not running
anything.

-- 
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 56430] Extension mapping that includes a dot in the extension does not work

2014-04-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56430

Benjamin Plocek sm...@benjaminplocek.com changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|INVALID |---

--- Comment #8 from Benjamin Plocek sm...@benjaminplocek.com ---
Using the rewrite valve is not an enhancement. It's a workaround that doesn't
work with Tomcat 7.

Please, read my comment #3. I now see why Tomcat doesn't support extension
mappings including multiple dots. But hey, then please fix your code so that it
is consistent.

In StandardContext.java you have a method validateURLPattern which is used at
startup. For this method the String '*.my.txt' _is valid_, but when it comes to
using this pattern, it does not have an effect, because the rest of the code
seems to agree with your explanation and takes this pattern as invalid.

So, again, I REOPEN this issue and request this enhancement: Fix the check at
startup, so that it is clear why the given filter mapping with multiple dots
does not work. It's a pain, when you have to find out why your filter does not
work and you don't even get a warning in your logs.

-- 
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: r1589303 - /tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java

2014-04-22 Thread kkolinko
Author: kkolinko
Date: Tue Apr 22 23:04:40 2014
New Revision: 1589303

URL: http://svn.apache.org/r1589303
Log:
Additional information for debugging the test:
log on which iteration it failed.

(It is possible to chain AssertionErrors, but JUnit does not print stack trace 
for the nested AE. Thus I am resorting to writing them to the log).

Modified:
tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java

Modified: tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java?rev=1589303r1=1589302r2=1589303view=diff
==
--- tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java Tue Apr 22 
23:04:40 2014
@@ -134,10 +134,11 @@ public class TestSsl extends TomcatBaseT
 requestCount++;
 doRequest(os, r);
 }
-} catch (IOException ioe) {
-Assert.fail(Failed on request number  + requestCount +
- after startHandshake());
-throw ioe;
+} catch (AssertionError | IOException e) {
+String message = Failed on request number  + requestCount
++  after startHandshake().  + e.getMessage();
+log.error(message, e);
+Assert.fail(message);
 }
 
 Assert.assertTrue(listener.isComplete());



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



[Bug 56391] test error for NIO and org.apache.tomcat.util.net.TestSsl

2014-04-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56391

--- Comment #12 from Konstantin Kolinko knst.koli...@gmail.com ---
Created attachment 31550
  -- https://issues.apache.org/bugzilla/attachment.cgi?id=31550action=edit
test log (r1589303, Win7)

Test log on Windows with trunk at r1589303.

Failed on request number 2 after startHandshake(). expected:72 but was:-1

-- 
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 56391] test error for NIO and org.apache.tomcat.util.net.TestSsl

2014-04-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56391

--- Comment #13 from Mark Thomas ma...@apache.org ---
I have been able to make a little progress debugging this. I still have not
been able to reproduce this on Windows.

1. The issue appears to be timing related. On OSX I see the error when running
from the command line but not when running through Eclipse.

2. It looks like the read() and write() methods in SecureNioChannel make
assumptions about the return value of tasks() that are not correct if the
client has triggered renegotiation.

-- 
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 56430] Extension mapping that includes a dot in the extension does not work

2014-04-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56430

Remy Maucherat r...@apache.org changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |INVALID

-- 
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 56446] New: Handling InvocationTargetException for PojoMessageHandlerWholeBase and PojoMessageHandlerPartialBase.onMessage()

2014-04-22 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56446

Bug ID: 56446
   Summary: Handling InvocationTargetException for
PojoMessageHandlerWholeBase and
PojoMessageHandlerPartialBase.onMessage()
   Product: Tomcat 8
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: WebSocket
  Assignee: dev@tomcat.apache.org
  Reporter: bluewolf.ch...@gmail.com

Both two methods handle InvocationTargetException from Endpoint @OnMessage
method like this:

try {
result = method.invoke(pojo, parameters);
} catch (IllegalAccessException | InvocationTargetException e) {
throw new IllegalArgumentException(e);
}

I'd like to suggest to use

org.apache.tomcat.util.ExceptionUtils#unwrapInvocationTargetException() and
RuntimeException

, which is like below:

try {
result = method.invoke(pojo, parameters);
} catch (IllegalAccessException | InvocationTargetException e) {
Throwable throwable =
ExceptionUtils.unwrapInvocationTargetException(e);
if (throwable instanceof RuntimeException) {
throw (RuntimeException) throwable;
} else {
throw new RuntimeException(throwable);
}
}

-- 
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]: Project tomcat-trunk-test-nio (in module tomcat-trunk) failed

2014-04-22 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-nio has an issue affecting its community integration.
This issue affects 1 projects,
 and has been outstanding for 23 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-nio :  Tomcat 8.x, a web server implementing the Java 
Servlet 3.1,
...


Full details are available at:

http://vmgump.apache.org/gump/public/tomcat-trunk/tomcat-trunk-test-nio/index.html

That said, some information snippets are provided here.

The following annotations (debug/informational/warning/error messages) were 
provided:
 -DEBUG- Dependency on commons-daemon exists, no need to add for property 
commons-daemon.native.src.tgz.
 -DEBUG- Dependency on commons-daemon exists, no need to add for property 
tomcat-native.tar.gz.
 -DEBUG- Dependency on tomcat-trunk exists, no need to add for property 
tomcat-dbcp.home.
 -INFO- Failed with reason build failed
 -INFO- Project Reports in: 
/srv/gump/public/workspace/tomcat-trunk/output/build/logs



The following work was performed:
http://vmgump.apache.org/gump/public/tomcat-trunk/tomcat-trunk-test-nio/gump_work/build_tomcat-trunk_tomcat-trunk-test-nio.html
Work Name: build_tomcat-trunk_tomcat-trunk-test-nio (Type: Build)
Work ended in a state of : Failed
Elapsed: 24 mins 14 secs
Command Line: /usr/lib/jvm/java-7-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.12-SNAPSHOT.jar 
-Dobjenesis.jar=/srv/gump/public/workspace/objenesis/main/target/objenesis-2.2-SNAPSHOT.jar
 
-Dtomcat-native.tar.gz=/srv/gump/public/workspace/apache-commons/daemon/dist/bin/commons-daemon-20140423-native-src.tar.gz
 -Dexamples.sources.skip=true 
-Dtomcat-dbcp.home=/srv/gump/public/workspace/tomcat-trunk/tomcat-deps 
-Djdt.jar=/srv/gump/packages/eclipse/plugins/P20140317-1600/ecj-P20140317-1600.jar
 
-Dcommons-daemon.jar=/srv/gump/public/workspace/apache-commons/daemon/dist/commons-daemon-20140423.jar
 
-Dcommons-daemon.native.src.tgz=/srv/gump/public/workspace/apache-commons/daemon/dist/bin/commons-daemon-20140423-native-src.tar.gz
 -Dexecute.test.nio=true -Dtest.accesslog=true 
-Dcommons-pool.home=/srv/gump/public/workspace/apache-comm
 ons/pool -Dcommons-dbcp.home=/srv/gump/public/workspace/apache-commons/dbcp 
-Dexecute.test.nio2=false -Dexecute.test.bio=false 
-Deasymock.jar=/srv/gump/public/workspace/easymock/easymock/target/easymock-3.3-SNAPSHOT.jar
 
-Dhamcrest.jar=/srv/gump/public/workspace/hamcrest/hamcrest-java/build/hamcrest-core-20140423.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-7-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/servle