Re: svn commit: r1574167 - /tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java

2014-03-05 Thread Konstantin Kolinko
2014-03-04 22:10 GMT+04:00  r...@apache.org:
 Author: remm
 Date: Tue Mar  4 18:10:56 2014
 New Revision: 1574167

 URL: http://svn.apache.org/r1574167
 Log:
 Avoid possible NPE.

 Modified:
 tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java

 Modified: tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
 URL: 
 http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java?rev=1574167r1=1574166r2=1574167view=diff
 ==
 --- tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java 
 (original)
 +++ tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java Tue 
 Mar  4 18:10:56 2014
 @@ -426,10 +426,12 @@ public class CoyoteAdapter implements Ad
  if (!request.isAsync()  !comet) {
  request.finishRequest();
  response.finishResponse();
 -request.getMappingData().context.logAccess(
 -request, response,
 -System.currentTimeMillis() - req.getStartTime(),
 -false);
 +if (request.getMappingData().context != null) {
 +request.getMappingData().context.logAccess(
 +request, response,
 +System.currentTimeMillis() - req.getStartTime(),
 +false);
 +}
  }

  } catch (IOException e) {



In my opinion, this is wrong. One should not skip access logging.
If context==null, it can be logged via CoyoteAdapter.log(...) that
logs into (ROOT app or Host or Engine).

There are several other places in CoyoteAdapter where
context.logAccess(..) is called. Some are with similar NPE checks,
some are not.

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



Re: svn commit: r1574167 - /tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java

2014-03-05 Thread Rémy Maucherat
2014-03-05 11:07 GMT+01:00 Konstantin Kolinko knst.koli...@gmail.com:

 In my opinion, this is wrong. One should not skip access logging.
 If context==null, it can be logged via CoyoteAdapter.log(...) that
 logs into (ROOT app or Host or Engine).


Ok, I'll try to improve it. I see the call at the end of event is unsafe as
well, since it would skip recycling if something bad happens.


 There are several other places in CoyoteAdapter where
 context.logAccess(..) is called. Some are with similar NPE checks,
 some are not.

 Rémy


svn commit: r1574413 - /tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java

2014-03-05 Thread remm
Author: remm
Date: Wed Mar  5 10:33:16 2014
New Revision: 1574413

URL: http://svn.apache.org/r1574413
Log:
Use the log fallback to log access anyway when something unexpected occurs. Do 
the same at the end of event to avoid the possibility of skipping recycling.

Modified:
tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java

Modified: tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java?rev=1574413r1=1574412r2=1574413view=diff
==
--- tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java Wed Mar  
5 10:33:16 2014
@@ -260,10 +260,15 @@ public class CoyoteAdapter implements Ad
 req.getRequestProcessor().setWorkerThreadName(null);
 // Recycle the wrapper request and response
 if (error || response.isClosed() || !request.isComet()) {
-request.getMappingData().context.logAccess(
-request, response,
-System.currentTimeMillis() - req.getStartTime(),
-false);
+if (request.getMappingData().context != null) {
+request.getMappingData().context.logAccess(
+request, response,
+System.currentTimeMillis() - req.getStartTime(),
+false);
+} else {
+// Should normally not happen
+log(req, res, System.currentTimeMillis() - 
req.getStartTime());
+}
 request.recycle();
 request.setFilterChain(null);
 response.recycle();
@@ -431,6 +436,9 @@ public class CoyoteAdapter implements Ad
 request, response,
 System.currentTimeMillis() - req.getStartTime(),
 false);
+} else {
+// Should normally not happen
+log(req, res, System.currentTimeMillis() - 
req.getStartTime());
 }
 }
 



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



[Bug 56219] New: Failure to parse MergedWebXml in Jasper in 7.0.52 when in Strict Compliance mode for 2.5 and earlier web apps

2014-03-05 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56219

Bug ID: 56219
   Summary: Failure to parse MergedWebXml in Jasper in 7.0.52 when
in Strict Compliance mode for 2.5 and earlier web apps
   Product: Tomcat 7
   Version: 7.0.52
  Hardware: PC
Status: NEW
  Severity: regression
  Priority: P2
 Component: Jasper
  Assignee: dev@tomcat.apache.org
  Reporter: knst.koli...@gmail.com

(Filing an issue for an already fixed bug, to better document it)

This was observed for Web Applications that
1. use Servlet 2.5 or earlier schemas/dtds in their web.xml file.
2. and have a Filter configured.

Steps to reproduce:

1. Put Tomcat 7.0.52 into scrict servlet compliance mode by adding the
following line to conf/catalina.properties:

[[[
org.apache.catalina.STRICT_SERVLET_COMPLIANCE=true
]]]

2. Replace webapps/ROOT/WEB-INF/web.xml with the following text
(It is web.xml from Tomcat 6 ROOT app  plus a added a filter):

[[[
?xml version=1.0 encoding=ISO-8859-1?
!--
 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.
--

web-app xmlns=http://java.sun.com/xml/ns/javaee;
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xsi:schemaLocation=http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd;
   version=2.5

  display-nameWelcome to Tomcat/display-name
  description
 Welcome to Tomcat
  /description

filter
filter-namesetCharacterEncodingFilter/filter-name
   
filter-classorg.apache.catalina.filters.SetCharacterEncodingFilter/filter-class
init-param
param-nameencoding/param-name
param-valueUTF-8/param-value
/init-param
/filter
filter-mapping
filter-namesetCharacterEncodingFilter/filter-name
url-pattern/*/url-pattern
/filter-mapping

/web-app
]]]

3. Start Tomcat and access a JSP page:
http://localhost:8080/index.jsp

Expected: Tomcat Welcome page.
Actual: It fails with error 500 and
[[[
org.xml.sax.SAXParseException; systemId: file:///CATALINA
HOME/bin/org.apache.tomcat.util.scan.MergedWebXml; lineNumber: 13;
columnNumber: 22; cvc-complex-type.2.4.a: Invalid content was found starting
with element 'async-supported'. One of
'{http://java.sun.com/xml/ns/javaee:init-param}' is expected.

com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
 (...)

com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:347)
 org.apache.jasper.xmlparser.ParserUtils.parseXMLDocument(ParserUtils.java:114)
 org.apache.jasper.compiler.JspConfig.processWebDotXml(JspConfig.java:95)
 org.apache.jasper.compiler.JspConfig.init(JspConfig.java:243)
 org.apache.jasper.compiler.JspConfig.findJspProperty(JspConfig.java:302)
 org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:114)
 org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)
 org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
 org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)

org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:657)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
]]]


The cause is that MergedWebXml that is used to pass configuration from Tomcat
(Catalina) to JSP Engine (Jasper) was generated incorrectly for the specified
version.

The XML text generated for a filter had 
async-supportedfalse/async-supported, but such option is available for
filters only starting with Servlet 3.0


Notes:
1. The generated XML can be logged with Context logEffectiveWebXml=true /
http://tomcat.apache.org/tomcat-7.0-doc/config/context.html

2. Tomcat 6 and 8 are not affected.
Tomcat 6 does not have web.xml merging, as support for web fragments is in
Servlet 3.0 and later.
Tomcat 8 uses different mechanism to pass configuration to Jasper.

Mail Threads:
http://marc.info/?t=13927185154r=1w=2

-- 
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 56219] Failure to parse MergedWebXml in Jasper in 7.0.52 when in Strict Compliance mode for 2.5 and earlier web apps

2014-03-05 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56219

Konstantin Kolinko knst.koli...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
 OS||All

--- Comment #1 from Konstantin Kolinko knst.koli...@gmail.com ---
Fixed in 7.0 and will be in 7.0.53.

-- 
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: r1574456 - /tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

2014-03-05 Thread kkolinko
Author: kkolinko
Date: Wed Mar  5 12:41:47 2014
New Revision: 1574456

URL: http://svn.apache.org/r1574456
Log:
Add bug number

Modified:
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

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=1574456r1=1574455r2=1574456view=diff
==
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Wed Mar  5 12:41:47 2014
@@ -64,6 +64,7 @@
 codeWebappClassLoader/code. (markt)
   /add
   fix
+bug56219/bug:
 Improve merging process for web.xml files to take account of the
 elements and attributes supported by the Servlet version of the merged
 file. (markt)



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



Re: NIO 2 connector

2014-03-05 Thread Christopher Schultz
Rémy,

On 3/4/14, 2:23 PM, Rémy Maucherat wrote:
 2014-03-04 19:26 GMT+01:00 Mark Thomas ma...@apache.org:

 Can you wait until we split 8.0.x from trunk or did you want to get this
 into 8.0.x?

 
 Depends, if you want to branch soon or not. It would have to be
 experimental for a while anyway, but it will likely bring something useful.

+1 for putting this into Tomcat 8.0.x as an experimental connector. You
won't get a lot of real-world testing on it if you delay until Tomcat 9,
but you might get some pioneers who will trust the stability of the rest
of Tomcat 8 and might be willing to give a new connector a try -- if
even for a short period of time.

-chris



signature.asc
Description: OpenPGP digital signature


svn commit: r1574479 - in /tomcat/trunk: java/org/apache/catalina/manager/StatusTransformer.java webapps/docs/changelog.xml

2014-03-05 Thread markt
Author: markt
Date: Wed Mar  5 13:36:31 2014
New Revision: 1574479

URL: http://svn.apache.org/r1574479
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56217
Left align makes more sense entries might be very long

Modified:
tomcat/trunk/java/org/apache/catalina/manager/StatusTransformer.java
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/manager/StatusTransformer.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/StatusTransformer.java?rev=1574479r1=1574478r2=1574479view=diff
==
--- tomcat/trunk/java/org/apache/catalina/manager/StatusTransformer.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/manager/StatusTransformer.java Wed 
Mar  5 13:36:31 2014
@@ -493,7 +493,7 @@ public class StatusTransformer {
 writer.write(filter(mBeanServer.getAttribute
 (pName, virtualHost)));
 writer.write(/td);
-writer.write(td nowrap);
+writer.write(td nowrap class=\row-left\);
 if (showRequest) {
 writer.write(filter(mBeanServer.getAttribute
 (pName, method)));

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1574479r1=1574478r2=1574479view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Wed Mar  5 13:36:31 2014
@@ -124,6 +124,11 @@
 bug56093/bug: Add the SSL Valve to the documentation web
 application. (markt)
   /add
+  fix
+bug56217/bug: Improve readability by using left alignment for the
+table cell containing the request information on the Manager 
application
+status page. (markt)
+  /fix
 /changelog
   /subsection
   subsection name=Other



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



svn commit: r1574482 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/manager/StatusTransformer.java webapps/docs/changelog.xml

2014-03-05 Thread markt
Author: markt
Date: Wed Mar  5 13:37:47 2014
New Revision: 1574482

URL: http://svn.apache.org/r1574482
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56217
Left align makes more sense as entries might be very long

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/StatusTransformer.java
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

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

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/StatusTransformer.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/StatusTransformer.java?rev=1574482r1=1574481r2=1574482view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/StatusTransformer.java 
(original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/StatusTransformer.java 
Wed Mar  5 13:37:47 2014
@@ -494,7 +494,7 @@ public class StatusTransformer {
 writer.write(filter(mBeanServer.getAttribute
 (pName, virtualHost)));
 writer.write(/td);
-writer.write(td nowrap);
+writer.write(td nowrap class=\row-left\);
 if (showRequest) {
 writer.write(filter(mBeanServer.getAttribute
 (pName, method)));

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=1574482r1=1574481r2=1574482view=diff
==
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Wed Mar  5 13:37:47 2014
@@ -113,6 +113,11 @@
 bug56093/bug: Add the SSL Valve to the documentation web
 application. (markt)
   /add
+  fix
+bug56217/bug: Improve readability by using left alignment for the
+table cell containing the request information on the Manager 
application
+status page. (markt)
+  /fix
 /changelog
   /subsection
   subsection name=Other



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



[Bug 56217] Regarding Tomcat Manager Application Status Page

2014-03-05 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56217

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

   What|Removed |Added

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

--- Comment #1 from Mark Thomas ma...@apache.org ---
Thanks for the report. This has been fixed in 8.0.x for 8.0.4 and in 7.0.x for
7.0.53.

-- 
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 56213] Many KeyReference Objects Cause Long CMS-remark GC Times

2014-03-05 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56213

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

   What|Removed |Added

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

--- Comment #1 from Mark Thomas ma...@apache.org ---
This has been fixed in 7.0.x and will be included in 7.0.53 onwards.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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



svn commit: r1574484 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/util/net/NioBlockingSelector.java webapps/docs/changelog.xml

2014-03-05 Thread markt
Author: markt
Date: Wed Mar  5 13:41:58 2014
New Revision: 1574484

URL: http://svn.apache.org/r1574484
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56213
Reduce GC when NIO connector is under load. Results in a small performance 
improvement. KeyReferences and finalizer references were accounting for 30%+ of 
the heap during my load tests before this patch.

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

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

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

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java?rev=1574484r1=1574483r2=1574484view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java 
(original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java 
Wed Mar  5 13:41:58 2014
@@ -26,6 +26,7 @@ import java.nio.channels.SelectionKey;
 import java.nio.channels.Selector;
 import java.nio.channels.SocketChannel;
 import java.util.Iterator;
+import java.util.Queue;
 import java.util.concurrent.ConcurrentLinkedQueue;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
@@ -42,6 +43,9 @@ public class NioBlockingSelector {
 
 private static int threadCounter = 0;
 
+private QueueKeyReference keyReferenceQueue =
+new ConcurrentLinkedQueueKeyReference();
+
 protected Selector sharedSelector;
 
 protected BlockPoller poller;
@@ -82,7 +86,10 @@ public class NioBlockingSelector {
 throws IOException {
 SelectionKey key = 
socket.getIOChannel().keyFor(socket.getPoller().getSelector());
 if ( key == null ) throw new IOException(Key no longer registered);
-KeyReference reference = new KeyReference();
+KeyReference reference = keyReferenceQueue.poll();
+if (reference == null) {
+reference = new KeyReference();
+}
 KeyAttachment att = (KeyAttachment) key.attachment();
 int written = 0;
 boolean timedout = false;
@@ -131,6 +138,7 @@ public class NioBlockingSelector {
 poller.cancelKey(reference.key);
 }
 reference.key = null;
+keyReferenceQueue.add(reference);
 }
 return written;
 }
@@ -150,7 +158,10 @@ public class NioBlockingSelector {
 public int read(ByteBuffer buf, NioChannel socket, long readTimeout) 
throws IOException {
 SelectionKey key = 
socket.getIOChannel().keyFor(socket.getPoller().getSelector());
 if ( key == null ) throw new IOException(Key no longer registered);
-KeyReference reference = new KeyReference();
+KeyReference reference = keyReferenceQueue.poll();
+if (reference == null) {
+reference = new KeyReference();
+}
 KeyAttachment att = (KeyAttachment) key.attachment();
 int read = 0;
 boolean timedout = false;
@@ -195,6 +206,7 @@ public class NioBlockingSelector {
 poller.cancelKey(reference.key);
 }
 reference.key = null;
+keyReferenceQueue.add(reference);
 }
 return read;
 }

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=1574484r1=1574483r2=1574484view=diff
==
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Wed Mar  5 13:41:58 2014
@@ -78,6 +78,10 @@
 NIO connector and a request is sent using more than one AJP message.
 Patch provided by Amund Elstad. (markt)
   /fix
+  fix
+bug56213/bug: Reduce garbage collection when the NIO connector is
+under heavy load. (markt)
+  /fix
 /changelog
   /subsection
   subsection name=Jasper



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



[Bug 56204] build target downloadgz-2 's dependence on target setproxy is redundant

2014-03-05 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56204

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

   What|Removed |Added

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

--- Comment #1 from Mark Thomas ma...@apache.org ---
Fixed in 8.0.x for 8.0.4 onwards.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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



svn commit: r1574488 - in /tomcat/trunk: build.xml webapps/docs/changelog.xml

2014-03-05 Thread markt
Author: markt
Date: Wed Mar  5 13:52:25 2014
New Revision: 1574488

URL: http://svn.apache.org/r1574488
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56204
Clean-up

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

Modified: tomcat/trunk/build.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/build.xml?rev=1574488r1=1574487r2=1574488view=diff
==
--- tomcat/trunk/build.xml (original)
+++ tomcat/trunk/build.xml Wed Mar  5 13:52:25 2014
@@ -2854,7 +2854,7 @@ Apache Tomcat ${version} native binaries
 delete file=${base.path}/file.tar.gz/
   /target
 
-  target name=downloadgz-2 unless=exist depends=setproxy,testexist
+  target name=downloadgz-2 unless=exist depends=testexist
 !-- Download and extract the package from the two alternative locations 
--
 delete file=${base.path}/file.tar quiet=true /
 delete file=${base.path}/file.tar.gz quiet=true /

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1574488r1=1574487r2=1574488view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Wed Mar  5 13:52:25 2014
@@ -183,6 +183,10 @@
 bug56189/bug: Remove used file cpappend.bat from the distribution.
 (markt)
   /fix
+  fix
+bug56204/bug: Remove unnecessary dependency between tasks in the
+build script. (markt)
+  /fix
 /changelog
   /subsection
 /section



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



svn commit: r1574493 - in /tomcat/trunk: java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java webapps/docs/changelog.xml

2014-03-05 Thread markt
Author: markt
Date: Wed Mar  5 14:09:19 2014
New Revision: 1574493

URL: http://svn.apache.org/r1574493
Log:
FindBugs: Avoid NPE when flushing batched WebSocket messages.

Modified:
tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java
tomcat/trunk/webapps/docs/changelog.xml

Modified: 
tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java?rev=1574493r1=1574492r2=1574493view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java 
Wed Mar  5 14:09:19 2014
@@ -234,7 +234,9 @@ public abstract class WsRemoteEndpointIm
 } else {
 f2sh.get(timeout, TimeUnit.MILLISECONDS);
 }
-payload.clear();
+if (payload != null) {
+payload.clear();
+}
 } catch (InterruptedException | ExecutionException |
 TimeoutException e) {
 throw new IOException(e);

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1574493r1=1574492r2=1574493view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Wed Mar  5 14:09:19 2014
@@ -116,6 +116,9 @@
 Avoid a possible deadlock when one thread is shutting down a connection
 while another thread is trying to write to it. (markt)
   /fix
+  fix
+Avoid NPE when flushing batched messages. (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: r1574495 - /tomcat/trunk/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java

2014-03-05 Thread markt
Author: markt
Date: Wed Mar  5 14:19:49 2014
New Revision: 1574495

URL: http://svn.apache.org/r1574495
Log:
Findbugs: Remove pointless null check. Refactor.

Modified:

tomcat/trunk/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java

Modified: 
tomcat/trunk/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java?rev=1574495r1=1574494r2=1574495view=diff
==
--- 
tomcat/trunk/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
 (original)
+++ 
tomcat/trunk/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
 Wed Mar  5 14:19:49 2014
@@ -25,6 +25,7 @@ import java.util.ArrayList;
 import java.util.Enumeration;
 import java.util.Hashtable;
 import java.util.List;
+import java.util.Map.Entry;
 
 import javax.management.ObjectName;
 
@@ -331,11 +332,10 @@ public class MbeansDescriptorsIntrospect
 mbean.addAttribute(ai);
 }
 
-en=invokeAttMap.keys();
-while( en.hasMoreElements() ) {
-String name = en.nextElement();
-Method m = invokeAttMap.get(name);
-if( m!=null  name != null ) {
+for (EntryString,Method entry : invokeAttMap.entrySet()) {
+String name = entry.getKey();
+Method m = entry.getValue();
+if(m != null) {
 OperationInfo op=new OperationInfo();
 op.setName(name);
 op.setReturnType(m.getReturnType().getName());
@@ -350,7 +350,7 @@ public class MbeansDescriptorsIntrospect
 }
 mbean.addOperation(op);
 } else {
-log.error(Null arg  + name +   + m );
+log.error(Null arg method for [ + name + ]);
 }
 }
 



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



svn commit: r1574497 - in /tomcat/site/trunk: docs/stylesheets/tomcat.css xdocs/stylesheets/tomcat.css

2014-03-05 Thread kpreisser
Author: kpreisser
Date: Wed Mar  5 14:21:49 2014
New Revision: 1574497

URL: http://svn.apache.org/r1574497
Log:
Fix rendering effects on browsers like IE.

Modified:
tomcat/site/trunk/docs/stylesheets/tomcat.css
tomcat/site/trunk/xdocs/stylesheets/tomcat.css

Modified: tomcat/site/trunk/docs/stylesheets/tomcat.css
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/docs/stylesheets/tomcat.css?rev=1574497r1=1574496r2=1574497view=diff
==
--- tomcat/site/trunk/docs/stylesheets/tomcat.css (original)
+++ tomcat/site/trunk/docs/stylesheets/tomcat.css Wed Mar  5 14:21:49 2014
@@ -125,10 +125,10 @@ main {
 }
 
 #mainLeft  div {
-  margin-top: -1px; /* to overwrite border of element above */
+  margin-top: -2px; /* to overwrite border of element above - use 1 additional 
pixel to hide rendering effects */
   padding-left: 16px;
   padding-right: 14px;
-  padding-top: 6px;
+  padding-top: 7px;
   padding-bottom: 15px;
   background-color: #F8F3E4;
   border-right: 1px solid #bbb;

Modified: tomcat/site/trunk/xdocs/stylesheets/tomcat.css
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/xdocs/stylesheets/tomcat.css?rev=1574497r1=1574496r2=1574497view=diff
==
--- tomcat/site/trunk/xdocs/stylesheets/tomcat.css (original)
+++ tomcat/site/trunk/xdocs/stylesheets/tomcat.css Wed Mar  5 14:21:49 2014
@@ -125,10 +125,10 @@ main {
 }
 
 #mainLeft  div {
-  margin-top: -1px; /* to overwrite border of element above */
+  margin-top: -2px; /* to overwrite border of element above - use 1 additional 
pixel to hide rendering effects */
   padding-left: 16px;
   padding-right: 14px;
-  padding-top: 6px;
+  padding-top: 7px;
   padding-bottom: 15px;
   background-color: #F8F3E4;
   border-right: 1px solid #bbb;



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



svn commit: r1574502 - /tomcat/trunk/java/org/apache/jasper/compiler/JspDocumentParser.java

2014-03-05 Thread markt
Author: markt
Date: Wed Mar  5 14:22:19 2014
New Revision: 1574502

URL: http://svn.apache.org/r1574502
Log:
FindBugs: Remove unnecessary null check

Modified:
tomcat/trunk/java/org/apache/jasper/compiler/JspDocumentParser.java

Modified: tomcat/trunk/java/org/apache/jasper/compiler/JspDocumentParser.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/JspDocumentParser.java?rev=1574502r1=1574501r2=1574502view=diff
==
--- tomcat/trunk/java/org/apache/jasper/compiler/JspDocumentParser.java 
(original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/JspDocumentParser.java Wed Mar 
 5 14:22:19 2014
@@ -317,55 +317,53 @@ class JspDocumentParser
 startMark = new Mark(ctxt, path, locator.getLineNumber(),
  locator.getColumnNumber());
 
-if (attrs != null) {
-/*
- * Notice that due to a bug in the underlying SAX parser, the
- * attributes must be enumerated in descending order.
- */
-boolean isTaglib = false;
-for (int i = attrs.getLength() - 1; i = 0; i--) {
-isTaglib = false;
-String attrQName = attrs.getQName(i);
-if (!attrQName.startsWith(xmlns)) {
-if (nonTaglibAttrs == null) {
-nonTaglibAttrs = new AttributesImpl();
+/*
+ * Notice that due to a bug in the underlying SAX parser, the
+ * attributes must be enumerated in descending order.
+ */
+boolean isTaglib = false;
+for (int i = attrs.getLength() - 1; i = 0; i--) {
+isTaglib = false;
+String attrQName = attrs.getQName(i);
+if (!attrQName.startsWith(xmlns)) {
+if (nonTaglibAttrs == null) {
+nonTaglibAttrs = new AttributesImpl();
+}
+nonTaglibAttrs.addAttribute(
+attrs.getURI(i),
+attrs.getLocalName(i),
+attrs.getQName(i),
+attrs.getType(i),
+attrs.getValue(i));
+} else {
+if (attrQName.startsWith(xmlns:jsp)) {
+isTaglib = true;
+} else {
+String attrUri = attrs.getValue(i);
+// TaglibInfo for this uri already established in
+// startPrefixMapping
+isTaglib = pageInfo.hasTaglib(attrUri);
+}
+if (isTaglib) {
+if (taglibAttrs == null) {
+taglibAttrs = new AttributesImpl();
 }
-nonTaglibAttrs.addAttribute(
+taglibAttrs.addAttribute(
 attrs.getURI(i),
 attrs.getLocalName(i),
 attrs.getQName(i),
 attrs.getType(i),
 attrs.getValue(i));
 } else {
-if (attrQName.startsWith(xmlns:jsp)) {
-isTaglib = true;
-} else {
-String attrUri = attrs.getValue(i);
-// TaglibInfo for this uri already established in
-// startPrefixMapping
-isTaglib = pageInfo.hasTaglib(attrUri);
-}
-if (isTaglib) {
-if (taglibAttrs == null) {
-taglibAttrs = new AttributesImpl();
-}
-taglibAttrs.addAttribute(
-attrs.getURI(i),
-attrs.getLocalName(i),
-attrs.getQName(i),
-attrs.getType(i),
-attrs.getValue(i));
-} else {
-if (nonTaglibXmlnsAttrs == null) {
-nonTaglibXmlnsAttrs = new AttributesImpl();
-}
-nonTaglibXmlnsAttrs.addAttribute(
-attrs.getURI(i),
-attrs.getLocalName(i),
-attrs.getQName(i),
-attrs.getType(i),
-attrs.getValue(i));
+if (nonTaglibXmlnsAttrs == null) {
+nonTaglibXmlnsAttrs = new AttributesImpl();
 }
+nonTaglibXmlnsAttrs.addAttribute(
+attrs.getURI(i),
+attrs.getLocalName(i),
+attrs.getQName(i),
+attrs.getType(i),
+attrs.getValue(i));
 }
 }
 }




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

2014-03-05 Thread markt
Author: markt
Date: Wed Mar  5 14:23:42 2014
New Revision: 1574503

URL: http://svn.apache.org/r1574503
Log:
Add FindBugs fixes to change log

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=1574503r1=1574502r2=1574503view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Wed Mar  5 14:23:42 2014
@@ -78,6 +78,9 @@
 Avoid codeNullPointerException/code in resource cache when making 
an
 invalid request for a resource outside of the web application. (markt)
   /fix
+  fix
+Remove an unnecessary null check identified by FindBugs. (markt) 
+  /fix
 /changelog
   /subsection
   subsection name=Coyote
@@ -108,6 +111,9 @@
 with a tag library JAR that is located outside of the web application.
 (markt)
   /fix
+  fix
+Remove an unnecessary null check identified by FindBugs. (markt) 
+  /fix
 /changelog
   /subsection
   subsection name=WebSocket



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



svn commit: r1574507 - /tomcat/trunk/res/findbugs/filter-false-positives.xml

2014-03-05 Thread markt
Author: markt
Date: Wed Mar  5 14:32:44 2014
New Revision: 1574507

URL: http://svn.apache.org/r1574507
Log:
Update false positives

Modified:
tomcat/trunk/res/findbugs/filter-false-positives.xml

Modified: tomcat/trunk/res/findbugs/filter-false-positives.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/res/findbugs/filter-false-positives.xml?rev=1574507r1=1574506r2=1574507view=diff
==
--- tomcat/trunk/res/findbugs/filter-false-positives.xml (original)
+++ tomcat/trunk/res/findbugs/filter-false-positives.xml Wed Mar  5 14:32:44 
2014
@@ -520,6 +520,11 @@
 
   !-- Test code --
   Match
+!-- Code is deliberately unused --
+Class name=javax.servlet.http.TestCookie /
+Bug pattern=DLS_DEAD_LOCAL_STORE/
+  /Match
+  Match
 !-- Code is intentionally unused --
 Class name=org.apache.catalina.authenticator.TestBasicAuthParser/
 Method name=testAuthMethodBadMethod/
@@ -634,8 +639,8 @@
   Match
 !-- Code is deliberately unused --
 Or
-  Class name=org.apache.catalina.webresources.TestDirResourceSet /
-  Class name=org.apache.catalina.webresources.TestFileResourceSet /
+  Class 
name=org.apache.catalina.webresources.AbstractTestDirResourceSet /
+  Class 
name=org.apache.catalina.webresources.AbstractTestFileResourceSet /
   Class name=org.apache.catalina.webresources.TestJarResourceSet /
   Class 
name=org.apache.catalina.webresources.TestJarResourceSetInternal /
 /Or



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



svn commit: r1574508 - in /tomcat/trunk: java/org/apache/catalina/loader/LocalStrings.properties java/org/apache/catalina/loader/WebappClassLoader.java webapps/docs/changelog.xml

2014-03-05 Thread kkolinko
Author: kkolinko
Date: Wed Mar  5 14:37:38 2014
New Revision: 1574508

URL: http://svn.apache.org/r1574508
Log:
When reporting threads that are still running while web application is being 
stopped, print their stack traces to the log.

Minor fixes:
Remember result of Thread.getName() as that method is not trivial.
Strip trailing whitespaces from changelog.

Modified:
tomcat/trunk/java/org/apache/catalina/loader/LocalStrings.properties
tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/loader/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/loader/LocalStrings.properties?rev=1574508r1=1574507r2=1574508view=diff
==
--- tomcat/trunk/java/org/apache/catalina/loader/LocalStrings.properties 
(original)
+++ tomcat/trunk/java/org/apache/catalina/loader/LocalStrings.properties Wed 
Mar  5 14:37:38 2014
@@ -39,6 +39,8 @@ webappClassLoader.jarsModified=One or mo
 webappClassLoader.jarsRemoved=One or more JARs have been removed from the web 
application [{0}]
 webappClassLoader.javaseClassLoaderNull=The j2seClassLoader attribute may not 
be null
 webappClassLoader.resourceModified=Resource [{0}] has been modified. The last 
modified time was [{1}] and is now [{2}]
+webappClassLoader.stackTrace=Stack trace of thread {0}:{1}
+webappClassLoader.stackTraceRequestThread=Stack trace of request processing 
thread {0}:{1}
 webappClassLoader.stopThreadFail=Failed to terminate thread named [{0}] for 
web application [{1}]
 webappClassLoader.stopTimerThreadFail=Failed to terminate TimerThread named 
[{0}] for web application [{1}]
 webappClassLoader.validationErrorJarPath=Unable to validate JAR entry with 
name {0}

Modified: tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java?rev=1574508r1=1574507r2=1574508view=diff
==
--- tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java Wed Mar 
 5 14:37:38 2014
@@ -1772,6 +1772,8 @@ public class WebappClassLoader extends U
 continue;
 }
 
+final String threadName = thread.getName();
+
 // JVM controlled threads
 ThreadGroup tg = thread.getThreadGroup();
 if (tg != null 
@@ -1779,7 +1781,7 @@ public class WebappClassLoader extends U
 
 // HttpClient keep-alive threads
 if (clearReferencesHttpClientKeepAliveThread 
-thread.getName().equals(Keep-Alive-Timer)) {
+threadName.equals(Keep-Alive-Timer)) {
 thread.setContextClassLoader(parent);
 log.debug(sm.getString(
 
webappClassLoader.checkThreadsHttpClient));
@@ -1805,10 +1807,14 @@ public class WebappClassLoader extends U
 
 if (isRequestThread(thread)) {
 
log.error(sm.getString(webappClassLoader.warnRequestThread,
-getContextName(), thread.getName()));
+getContextName(), threadName));
+
log.error(sm.getString(webappClassLoader.stackTraceRequestThread,
+threadName, getStackTrace(thread)));
 } else {
 log.error(sm.getString(webappClassLoader.warnThread,
-getContextName(), thread.getName()));
+getContextName(), threadName));
+log.error(sm.getString(webappClassLoader.stackTrace,
+threadName, getStackTrace(thread)));
 }
 
 // Don't try an stop the threads unless explicitly
@@ -2125,6 +2131,14 @@ public class WebappClassLoader extends U
 return name;
 }
 
+private String getStackTrace(Thread thread) {
+StringBuilder builder = new StringBuilder();
+for (StackTraceElement ste : thread.getStackTrace()) {
+builder.append(\n ).append(ste);
+}
+return builder.toString();
+}
+
 /**
  * @param o object to test, may be null
  * @return codetrue/code if o has been loaded by the current 
classloader

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1574508r1=1574507r2=1574508view=diff
==
--- 

[Bug 56215] sendError doesn't send error page with AsyncContext

2014-03-05 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56215

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

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |INVALID

--- Comment #1 from Mark Thomas ma...@apache.org ---
See r1297017 and/or section 10.9.2 (last paragraph) of the Servlet 3
specification for an explanation of why the container does not write an error
response in this case.

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

2014-03-05 Thread markt
Author: markt
Date: Wed Mar  5 15:00:17 2014
New Revision: 1574517

URL: http://svn.apache.org/r1574517
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=1574517r1=1574516r2=1574517view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Wed Mar  5 15:00:17 2014
@@ -37,7 +37,7 @@ PATCHES PROPOSED TO BACKPORT:
 * Make the xmlBlockExternal option in Catalina and Jasper to be true by 
default.
   
https://people.apache.org/~kkolinko/patches/2014-02-17_tc6_xmlBlockExternalTrue.patch
   (backport of r1564747)
-  +1: kkolinko
+  +1: kkolinko, markt
   -1:
 
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56208
@@ -47,14 +47,14 @@ PATCHES PROPOSED TO BACKPORT:
   (The r1564747 backport proposal above have to be applied first, as it
   modified adjacent lines to this one)
   http://svn.apache.org/r1570163
-  +1: kkolinko
+  +1: kkolinko, markt
   -1:
 
 * Don't log to standard out in SSLValve.
   Simplify: s/new String(xxx)/xxx/
   http://svn.apache.org/r1081118
   
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/SSLValve.java?r1=1041511r2=1041510pathrev=1041511
-  +1: kkolinko
+  +1: kkolinko, markt
   -1:
 
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56010
@@ -62,7 +62,7 @@ PATCHES PROPOSED TO BACKPORT:
   JspFactory.getPageContext API.
   http://svn.apache.org/r1558811
   http://svn.apache.org/r1574004 (documentation)
-  +1: kkolinko
+  +1: kkolinko, markt
   -1:
 
 



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



buildbot failure in ASF Buildbot on tomcat-trunk

2014-03-05 Thread buildbot
The Buildbot has detected a new failure on builder tomcat-trunk while building 
ASF Buildbot.
Full details are available at:
 http://ci.apache.org/builders/tomcat-trunk/builds/

Buildbot URL: http://ci.apache.org/

Buildslave for this Build: bb-vm_ubuntu

Build Reason: scheduler
Build Source Stamp: [branch tomcat/trunk] 1574479
Blamelist: markt

BUILD FAILED: failed compile_1

sincerely,
 -The Buildbot





svn commit: r1574541 - in /tomcat/trunk/webapps/docs: jndi-datasource-examples-howto.xml jndi-resources-howto.xml

2014-03-05 Thread schultz
Author: schultz
Date: Wed Mar  5 15:47:11 2014
New Revision: 1574541

URL: http://svn.apache.org/r1574541
Log:
Align documentation of DBCP examples to match changes from DBCP 1 - DBCP 2. 
Specifically, change maxActive - maxTotal and maxWait - maxWaitMillis 
in all examples.

Modified:
tomcat/trunk/webapps/docs/jndi-datasource-examples-howto.xml
tomcat/trunk/webapps/docs/jndi-resources-howto.xml

Modified: tomcat/trunk/webapps/docs/jndi-datasource-examples-howto.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/jndi-datasource-examples-howto.xml?rev=1574541r1=1574540r2=1574541view=diff
==
--- tomcat/trunk/webapps/docs/jndi-datasource-examples-howto.xml (original)
+++ tomcat/trunk/webapps/docs/jndi-datasource-examples-howto.xml Wed Mar  5 
15:47:11 2014
@@ -106,7 +106,7 @@ a codeServletContextListener/code.
 
 /section
 
-section name=Database Connection Pool (DBCP) Configurations
+section name=Database Connection Pool (DBCP 2) Configurations
 
 pThe default database connection pool implementation in Apache Tomcat
 relies on the libraries from the
@@ -251,7 +251,7 @@ resource to your a href=config/context
 pFor example:/p
 source![CDATA[Context
 
-!-- maxActive: Maximum number of database connections in pool. Make sure 
you
+!-- maxTotal: Maximum number of database connections in pool. Make sure 
you
  configure your mysqld max_connections large enough to handle
  all of your db connections. Set to -1 for no limit.
  --
@@ -261,7 +261,7 @@ resource to your a href=config/context
  and the minEvictableIdleTimeMillis configuration parameter.
  --
 
-!-- maxWait: Maximum time to wait for a database connection to become 
available
+!-- maxWaitMillis: Maximum time to wait for a database connection to 
become available
  in ms, in this example 10 seconds. An Exception is thrown if
  this timeout is exceeded.  Set to -1 to wait indefinitely.
  --
@@ -277,7 +277,7 @@ resource to your a href=config/context
  --
 
   Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource
-   maxActive=100 maxIdle=30 maxWait=1
+   maxTotal=100 maxIdle=30 maxWaitMillis=1
username=javauser password=javadude 
driverClassName=com.mysql.jdbc.Driver
url=jdbc:mysql://localhost:3306/javatest/
 
@@ -374,8 +374,8 @@ user scott./p
 source![CDATA[Resource name=jdbc/myoracle auth=Container
   type=javax.sql.DataSource 
driverClassName=oracle.jdbc.OracleDriver
   url=jdbc:oracle:thin:@127.0.0.1:1521:mysid
-  username=scott password=tiger maxActive=20 maxIdle=10
-  maxWait=-1/]]/source
+  username=scott password=tiger maxTotal=20 maxIdle=10
+  maxWaitMillis=-1/]]/source
 
 h52.web.xml configuration/h5
 pYou should ensure that you respect the element ordering defined by the DTD 
when you
@@ -427,7 +427,7 @@ Clarification would be appreciated here.
 source![CDATA[Resource name=jdbc/postgres auth=Container
   type=javax.sql.DataSource driverClassName=org.postgresql.Driver
   url=jdbc:postgresql://127.0.0.1:5432/mydb
-  username=myuser password=mypasswd maxActive=20 maxIdle=10 
maxWait=-1/]]/source
+  username=myuser password=mypasswd maxTotal=20 maxIdle=10 
maxWaitMillis=-1/]]/source
 h62b. Application-specific resource configuration/h6
 
 p
@@ -446,8 +446,8 @@ The Context element should look somethin
 Resource name=jdbc/postgres auth=Container
   type=javax.sql.DataSource driverClassName=org.postgresql.Driver
   url=jdbc:postgresql://127.0.0.1:5432/mydb
-  username=myuser password=mypasswd maxActive=20 maxIdle=10
-maxWait=-1/
+  username=myuser password=mypasswd maxTotal=20 maxIdle=10
+maxWaitMillis=-1/
 /Context]]/source
 
 h53. web.xml configuration/h5
@@ -577,7 +577,7 @@ than one second.  The remainder will onl
 if ever should a GC take more than 10 seconds./p
 
 pMake sure that the db connection timeout is set to 10-15 seconds.
-For the DBCP you set this using the parameter codemaxWait/code./p
+For the DBCP you set this using the parameter codemaxWaitMillis/code./p
 
 /subsection
 

Modified: tomcat/trunk/webapps/docs/jndi-resources-howto.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/jndi-resources-howto.xml?rev=1574541r1=1574540r2=1574541view=diff
==
--- tomcat/trunk/webapps/docs/jndi-resources-howto.xml (original)
+++ tomcat/trunk/webapps/docs/jndi-resources-howto.xml Wed Mar  5 15:47:11 2014
@@ -644,7 +644,7 @@ conn.close();]]/source
 password=dbpassword
 driverClassName=org.hsql.jdbcDriver
 url=jdbc:HypersonicSQL:database
-maxActive=8
+maxTotal=8
 maxIdle=4/
   ...
 /Context]]/source

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

2014-03-05 Thread remm
Author: remm
Date: Wed Mar  5 15:51:14 2014
New Revision: 1574543

URL: http://svn.apache.org/r1574543
Log:
Pick some of r1560702. Call onError if the onClose call throws an exception.

Modified:
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsSession.java
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsSession.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsSession.java?rev=1574543r1=1574542r2=1574543view=diff
==
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsSession.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsSession.java Wed 
Mar  5 15:51:14 2014
@@ -45,6 +45,7 @@ import javax.websocket.WebSocketContaine
 
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
+import org.apache.tomcat.util.ExceptionUtils;
 import org.apache.tomcat.util.res.StringManager;
 
 public class WsSession implements Session {
@@ -456,6 +457,9 @@ public class WsSession implements Sessio
 t.setContextClassLoader(applicationClassLoader);
 try {
 localEndpoint.onClose(this, closeReason);
+} catch (Throwable throwable) {
+ExceptionUtils.handleThrowable(throwable);
+localEndpoint.onError(this, throwable);
 } finally {
 t.setContextClassLoader(cl);
 }

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=1574543r1=1574542r2=1574543view=diff
==
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Wed Mar  5 15:51:14 2014
@@ -105,6 +105,10 @@
 Avoid a possible deadlock when one thread is shutting down a connection
 while another thread is trying to write to it. (markt)
   /fix
+  fix
+Call onError if an exception is thrown calling onClose when closing
+a session. (remm)
+  /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



Documentation for Tomcat 6/7 + DBCP 1

2014-03-05 Thread Christopher Schultz
All,

Tomcat 8 uses DBCP 2 which has changed the name of some configuration
parameters, specifically maxActive-maxTotal and maxWait-maxWaitMillis.
I have just fixed the JNDI DataSource examples to reflect that.

However, the documentation for Tomcat 6, 7, and 8 all point to DBCP's
configuration page, which currently shows the DBCP 2 configuration which
will not work on DBCP 1. That means we have a sync problem with the
Tomcat 6 and 7 documentation.

I was unable to find the configuration page for the old DBCP version
on the DBCP site, otherwise I would have updated the documentation directly.

Does anyone have any suggestions for how best to link from Tomcat's user
guide to the DBCP configuration page in a sane way?

Further, Tomcat 8 does not seem to complain when the maxActive and
maxWait configuration attributes are used on a Resource. Is this
because BasicDataSourceFactory implements a createDataSource(Properties)
method which is used rather than creating a blank DataSource and then
calling individual property setters on it (which would then fail as not
being found)?

-chris



signature.asc
Description: OpenPGP digital signature


buildbot failure in ASF Buildbot on tomcat-7-trunk

2014-03-05 Thread buildbot
The Buildbot has detected a new failure on builder tomcat-7-trunk while 
building ASF Buildbot.
Full details are available at:
 http://ci.apache.org/builders/tomcat-7-trunk/builds/1790

Buildbot URL: http://ci.apache.org/

Buildslave for this Build: bb-vm_ubuntu

Build Reason: scheduler
Build Source Stamp: [branch tomcat/tc7.0.x/trunk] 1574543
Blamelist: remm

BUILD FAILED: failed compile_1

sincerely,
 -The Buildbot




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



buildbot success in ASF Buildbot on tomcat-trunk

2014-03-05 Thread buildbot
The Buildbot has detected a restored build on builder tomcat-trunk while 
building ASF Buildbot.
Full details are available at:
 http://ci.apache.org/builders/tomcat-trunk/builds/5556

Buildbot URL: http://ci.apache.org/

Buildslave for this Build: bb-vm_ubuntu

Build Reason: scheduler
Build Source Stamp: [branch tomcat/trunk] 1574508
Blamelist: kkolinko,markt

Build succeeded!

sincerely,
 -The Buildbot





[Bug 56221] New: Crash when using tomcat version 7.0.52 when calling setImplementation method of LogFactory.java

2014-03-05 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56221

Bug ID: 56221
   Summary: Crash when using tomcat version 7.0.52 when calling
setImplementation method of LogFactory.java
   Product: Tomcat 7
   Version: 7.0.52
  Hardware: PC
Status: NEW
  Severity: normal
  Priority: P2
 Component: Catalina
  Assignee: dev@tomcat.apache.org
  Reporter: anurag_guj...@yahoo.com

Hi All,
We are testing apache tomcat release 7.0.52 , we are seeing a crash in the
tomcat code.
We stepped through the issue and have found that it is failing in the Apache
code when trying to initialize the logger, with the following error:
java.lang.ClassCastException: org.apache.ibatis.logging.slf4j.Slf4jImpl cannot
be cast to org.apache.ibatis.logging.Log

This is occurring in LogFactory.java, in the setImplementation method, at the
following line: Log log = candidate.newInstance(new
Object[]{LogFactory.class});

This cast will successfully occur in 7.0.47 version of tomcat. We think they
must have changed some hierarchy with regard to their logging but have as of
yet been unable to track this down. Would somebody there with more expertise
with regard to Tomcat be able to shed some light on the situation?

Thanks in advance for your help.
Anurag

-- 
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: Documentation for Tomcat 6/7 + DBCP 1

2014-03-05 Thread Mark Thomas
On 05/03/2014 15:53, Christopher Schultz wrote:
 All,
 
 Tomcat 8 uses DBCP 2 which has changed the name of some 
 configuration parameters, specifically maxActive-maxTotal and 
 maxWait-maxWaitMillis. I have just fixed the JNDI DataSource 
 examples to reflect that.
 
 However, the documentation for Tomcat 6, 7, and 8 all point to 
 DBCP's configuration page, which currently shows the DBCP 2 
 configuration which will not work on DBCP 1. That means we have a 
 sync problem with the Tomcat 6 and 7 documentation.
 
 I was unable to find the configuration page for the old DBCP 
 version on the DBCP site, otherwise I would have updated the 
 documentation directly.
 
 Does anyone have any suggestions for how best to link from
 Tomcat's user guide to the DBCP configuration page in a sane way?

Hmm. I'm not aware of the DBCP 1.x config being available on-line. Not
sure how to fix that.

 Further, Tomcat 8 does not seem to complain when the maxActive and
  maxWait configuration attributes are used on a Resource. Is this
  because BasicDataSourceFactory implements a 
 createDataSource(Properties) method which is used rather than 
 creating a blank DataSource and then calling individual property 
 setters on it (which would then fail as not being found)?

Correct. Some mapping from old to new names is called for. DBCP is
probably the best place for it.

Mark


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



[Bug 56221] Crash when using tomcat version 7.0.52 when calling setImplementation method of LogFactory.java

2014-03-05 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56221

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

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |INVALID
 OS||All

--- Comment #1 from Mark Thomas ma...@apache.org ---
None of the quoted code involves Apache Tomcat.

Further, Bugzilla is not a support forum.

The Apache Tomcat users amiling list is the correct location for support
questions but it is unclear form the information that this is even a Tomcat
question.

-- 
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 56199] Re-implement validateXml option in JspC of Tomcat 8, or remove it from documentation

2014-03-05 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56199

--- Comment #2 from Mark Thomas ma...@apache.org ---
I'll re-add the feature to 8.0.x for JspC. Folks using JspC may wish to use
validation.

-- 
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: r1574657 - in /tomcat/trunk: java/org/apache/jasper/Constants.java java/org/apache/jasper/JspC.java java/org/apache/jasper/servlet/JspCServletContext.java webapps/docs/changelog.xml

2014-03-05 Thread markt
Author: markt
Date: Wed Mar  5 21:01:50 2014
New Revision: 1574657

URL: http://svn.apache.org/r1574657
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56199
Restore validateXml option to JspC

Modified:
tomcat/trunk/java/org/apache/jasper/Constants.java
tomcat/trunk/java/org/apache/jasper/JspC.java
tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/jasper/Constants.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/Constants.java?rev=1574657r1=1574656r2=1574657view=diff
==
--- tomcat/trunk/java/org/apache/jasper/Constants.java (original)
+++ tomcat/trunk/java/org/apache/jasper/Constants.java Wed Mar  5 21:01:50 2014
@@ -162,6 +162,16 @@ public class Constants {
 org.apache.jasper.XML_VALIDATE_TLD;
 
 /**
+ * Name of the ServletContext init-param that determines if the XML parser
+ * used for web.xml files will be validating or not. Note that this is only
+ * used when using JspC. In normal operation, Jasper obtains the JspConfig
+ * information directly from the ServletContext and therefore does not need
+ * to parse web.xml.
+ */
+public static final String XML_VALIDATION_INIT_PARAM =
+org.apache.jasper.XML_VALIDATE;
+
+/**
  * Name of the ServletContext init-param that determines if the XML parsers
  * will block the resolution of external entities.
  * p

Modified: tomcat/trunk/java/org/apache/jasper/JspC.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/JspC.java?rev=1574657r1=1574656r2=1574657view=diff
==
--- tomcat/trunk/java/org/apache/jasper/JspC.java (original)
+++ tomcat/trunk/java/org/apache/jasper/JspC.java Wed Mar  5 21:01:50 2014
@@ -134,6 +134,7 @@ public class JspC extends Task implement
 protected static final String SWITCH_SMAP = -smap;
 protected static final String SWITCH_DUMP_SMAP = -dumpsmap;
 protected static final String SWITCH_VALIDATE_TLD = -validateTld;
+protected static final String SWITCH_VALIDATE_XML = -validateXml;
 protected static final String SWITCH_BLOCK_EXTERNAL = -blockExternal;
 protected static final String SWITCH_NO_BLOCK_EXTERNAL = 
-no-blockExternal;
 protected static final String SHOW_SUCCESS =-s;
@@ -167,6 +168,7 @@ public class JspC extends Task implement
 protected boolean trimSpaces = false;
 protected boolean genStringAsCharArray = false;
 protected boolean validateTld;
+protected boolean validateXml;
 protected boolean blockExternal = true;
 protected boolean xpoweredBy;
 protected boolean mappedFile = false;
@@ -376,6 +378,8 @@ public class JspC extends Task implement
 smapDumped = true;
 } else if (tok.equals(SWITCH_VALIDATE_TLD)) {
 setValidateTld(true);
+} else if (tok.equals(SWITCH_VALIDATE_XML)) {
+setValidateXml(true);
 } else if (tok.equals(SWITCH_BLOCK_EXTERNAL)) {
 setBlockExternal(true);
 } else if (tok.equals(SWITCH_NO_BLOCK_EXTERNAL)) {
@@ -867,6 +871,14 @@ public class JspC extends Task implement
 return validateTld;
 }
 
+public void setValidateXml( boolean b ) {
+this.validateXml = b;
+}
+
+public boolean isValidateXml() {
+return validateXml;
+}
+
 public void setBlockExternal( boolean b ) {
 this.blockExternal = b;
 }
@@ -1455,9 +1467,14 @@ public class JspC extends Task implement
 if (isValidateTld()) {
 context.setInitParameter(Constants.XML_VALIDATION_TLD_INIT_PARAM, 
true);
 }
+if (isValidateXml()) {
+context.setInitParameter(Constants.XML_VALIDATION_INIT_PARAM, 
true);
+}
 context.setInitParameter(Constants.XML_BLOCK_EXTERNAL_INIT_PARAM,
 String.valueOf(isBlockExternal()));
 
+context.processWebXml();
+
 TldScanner scanner = new TldScanner(
 context, true, isValidateTld(), isBlockExternal());
 scanner.setClassLoader(classLoader);

Modified: tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java?rev=1574657r1=1574656r2=1574657view=diff
==
--- tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java 
(original)
+++ tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java Wed Mar 
 5 21:01:50 2014
@@ -97,10 +97,10 @@ public class JspCServletContext implemen
 /**
  * Merged web.xml for the application.
  */
-private final WebXml webXml;
+private WebXml webXml;
 
 
-

[Bug 56199] Re-implement validateXml option in JspC of Tomcat 8, or remove it from documentation

2014-03-05 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56199

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

   What|Removed |Added

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

--- Comment #3 from Mark Thomas ma...@apache.org ---
This has been fixed for 8.0.x and will be included in 8.0.4 onwards.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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



[Bug 56190] Connection keep-alive not working with asynchronous servlet

2014-03-05 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56190

--- Comment #8 from Mark Thomas ma...@apache.org ---
I've been back and re-read both the Servlet 3.0 and Servlet 3.1 specifications.
I don't know where I got the idea from that the response always had to be
writable after the call to complete() but that is clearly wrong.

There is the requirement that when called before the container-initiated
dispatch that called startAsync() has returned to the container then the
complete() call doesn't take effect until after that thread returns but when it
does take effect it still needs to close the response.

I'll take a look at getting this fixed.

This might break some applications (it might even break some of our test cases)
but the spec is clear on the required behavior so I think any such breakage is
acceptable.

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



buildbot failure in ASF Buildbot on tomcat-trunk

2014-03-05 Thread buildbot
The Buildbot has detected a new failure on builder tomcat-trunk while building 
ASF Buildbot.
Full details are available at:
 http://ci.apache.org/builders/tomcat-trunk/builds/5558

Buildbot URL: http://ci.apache.org/

Buildslave for this Build: bb-vm_ubuntu

Build Reason: scheduler
Build Source Stamp: [branch tomcat/trunk] 1574657
Blamelist: markt

BUILD FAILED: failed compile_1

sincerely,
 -The Buildbot





[Bug 54315] Redeploying webapp causes NullPointerException in managerBase

2014-03-05 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=54315

Konstantin Kolinko knst.koli...@gmail.com changed:

   What|Removed |Added

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

--- Comment #12 from Konstantin Kolinko knst.koli...@gmail.com ---
Lorenzo's thread on users@ for Tomcat 7.0.50:
http://marc.info/?t=13935118604r=1w=2


Just some guesses

1. This should not happen, because StandardWrapperValve.invoke() takes care of
it.

If web application is being stopped while some requests are still being
processed, Tomcat logs the following message is logged like the following:

[[[
05-Mar-2014 19:59:33.701 INFO [localhost-startStop-1]
org.apache.catalina.core.StandardWrapper.unload Waiting for 1 instance(s) to be
deallocated for Servlet [jsp]
05-Mar-2014 19:59:34.701 INFO [localhost-startStop-1]
org.apache.catalina.core.StandardWrapper.unload Waiting for 1 instance(s) to be
deallocated for Servlet [jsp]
]]]

If such errors are logged,
it is explainable that other errors may follow.

Note though that the messages are logged at INFO level. Sometimes logs are
configured to skip those.

Note that
1) StandardContext.stopInternal() stops its wrappers (=children) before all
other subcomponents
2) The issue is reported as occurring in a filter. Invoking the filter chain is
performed in StandardWrapperValve.invoke()  in between wrapper.allocate() and
wrapper.deallocate() calls.  As such, it should be protected by the same
allocation counter that protects the servlet that is being called here.


2. In StandardWrapper.allocate()
I think the following code:
[[[
if (unloading)
throw new ServletException
  (sm.getString(standardWrapper.unloading, getName()));
]]]
would better be copied inside synchronized (this) {} block below.

The 'unloading' field may change while we are waiting to get into synchronized
block.  That is if there is the following sequence of events:

TH1: in StandardWrapper.allocate() checks for unloading
TH1: in StandardWrapper.allocate() waits for synchronized block
TH2: executes StandardWrapper.unload()
TH1: in StandardWrapper.allocate() obtains the monitor and allocates a servlet
Expected: TH1 should not be able to allocate one, as unloading has already
happened.


3. I think the o.a.c.core.StandardContext.paused field would better be marked
volatile.

The redeployment happens in background thread, but the field is read in
CoyoteAdapter.postParseRequest() in a request processing thread. It might read
a stale value.

(It would not cause this NullPointerException as reported here. It can cause
503 Unavailable response from StandardWrapperValve.invoke() or
ServletException(standardWrapper.unloading) from StandardWrapper.allocate()).


4. In StandardWrapper.invoke() the check for if
(!context.getState().isAvailable()) is done before wrapper.allocate() call.

There is small time window between those checks.
(It would not cause this NullPointerException as reported here. It can cause
ServletException(standardWrapper.unloading) from StandardWrapper.allocate()).

Anyway, in this case I do not see how it could be done better.
The LifecycleBase.state field is already marked as 'volatile'. Asking for it
twice seems like a waste. The checks in allocate() should protect here/



Resume:
for 1.: Beware if logging is configured to skip INFO messages.

Of course, if context is stopped before request processing on it completes,
some things are expected to fail. Tomcat waits here, the timeout is
configurable. It is a tradeoff. An infinite wait is usually undesirable.

See unloadDelay setting on Context. The default value is 2 seconds.
http://tomcat.apache.org/tomcat-7.0-doc/config/context.html

for 2. and 3.: These can be improved.

for 4.: OK, nothing to do.

-- 
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: buildbot failure in ASF Buildbot on tomcat-trunk

2014-03-05 Thread Konstantin Kolinko
2014-03-06 2:46 GMT+04:00  build...@apache.org:
 The Buildbot has detected a new failure on builder tomcat-trunk while 
 building ASF Buildbot.
 Full details are available at:
  http://ci.apache.org/builders/tomcat-trunk/builds/5558

 Buildbot URL: http://ci.apache.org/

 Buildslave for this Build: bb-vm_ubuntu

 Build Reason: scheduler
 Build Source Stamp: [branch tomcat/trunk] 1574657
 Blamelist: markt

 BUILD FAILED: failed compile_1


It is indeed a failing test:

[junit] Test org.apache.jasper.servlet.TestJspCServletContext FAILED
for both BIO and NIO

[[[
Testcase: testWebresources took 0.076 sec
Caused an ERROR
null
java.lang.NullPointerException
at 
org.apache.jasper.servlet.JspCServletContext.getEffectiveMajorVersion(JspCServletContext.java:677)
at 
org.apache.jasper.servlet.TestJspCServletContext.testWebresources(TestJspCServletContext.java:121)
]]]

It is the same NPE error for all test cases.

http://ci.apache.org/projects/tomcat/tomcat8/logs/1574657/TEST-org.apache.jasper.servlet.TestJspCServletContext.BIO.txt

Best regards,
Konstantin Kolinko

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



[Bug 56223] New: ServletContext#setInitParameter(..) does not throw IllegalStateException after it's been initialized

2014-03-05 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56223

Bug ID: 56223
   Summary: ServletContext#setInitParameter(..) does not throw
IllegalStateException after it's been initialized
   Product: Tomcat 8
   Version: 8.0.3
  Hardware: PC
Status: NEW
  Severity: normal
  Priority: P2
 Component: Specification APIs
  Assignee: dev@tomcat.apache.org
  Reporter: sotodel...@hotmail.com

Created attachment 31369
  -- https://issues.apache.org/bugzilla/attachment.cgi?id=31369action=edit
.war with single Servlet

The Java EE javadoc for ServletContext#setInitParameter(String, String), here:
http://docs.oracle.com/javaee/7/api/javax/servlet/ServletContext.html#setInitParameter(java.lang.String,
java.lang.String), states that the method should throw an IllegalStateException
if the ServletContext has already been initialized.

Once a Servlet is ready to handle requests, the ServletContext must have been
initialized. However, no exception is thrown if you try to invoke the method in
an HttpServlet's doGet(..).

Steps to reproduce:

1) Add an HttpServlet that invokes the method in its doGet(..) method

@WebServlet(urlPatterns = /init)
public class InitParameterServlet extends HttpServlet {
private static final long serialVersionUID = 1L;

public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {

ServletContext context = getServletContext();
context.setInitParameter(init-param, value);

}
}

2) Send an HTTP GET request to (the appropriate)
'http://localhost:8080/context/init`.

Actual results: No exception is thrown. Server sends back 200 OK.

Expected results: An exception should have been thrown. Server should have sent
back 500 status code.

Tomcat 8.0.3 (and 7.0.42) and Windows 7

Additional information: You can also try calling, for example, the
addFilter(..) method which will fail stating that the ServletContext is already
initialized.

-- 
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 (in module tomcat-trunk) failed

2014-03-05 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 has an issue affecting its community integration.
This issue affects 1 projects,
 and has been outstanding for 93 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 :  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/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/gump_work/build_tomcat-trunk_tomcat-trunk-test.html
Work Name: build_tomcat-trunk_tomcat-trunk-test (Type: Build)
Work ended in a state of : Failed
Elapsed: 55 mins 47 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-20140306-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/org.eclipse.jdt.core_3.4.2/jdtcore.jar
 
-Dcommons-daemon.jar=/srv/gump/public/workspace/apache-commons/daemon/dist/commons-daemon-20140306.jar
 
-Dcommons-daemon.native.src.tgz=/srv/gump/public/workspace/apache-commons/daemon/dist/bin/commons-daemon-20140306-native-src.tar.gz
 -Dtest.accesslog=true 
-Dcommons-pool.home=/srv/gump/public/workspace/apache-commons/pool 
-Dcommons-dbcp
 .home=/srv/gump/public/workspace/apache-commons/dbcp 
-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-20140306.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
 
t-api.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/jsp-api.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/el-api.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/websocket-api.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/catalina.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/catalina-ant.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/catalina-storeconfig.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/tomcat-coyote.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/jasper.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/jasper-el.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/catalina-tribes.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/catalina-ha.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/tomcat-api.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/tomcat-jni.jar:/srv/gump/public/workspace/tomcat
 

svn commit: r1574785 - in /tomcat/trunk: java/org/apache/jasper/JspC.java java/org/apache/jasper/servlet/JspCServletContext.java test/org/apache/jasper/servlet/TestJspCServletContext.java

2014-03-05 Thread markt
Author: markt
Date: Thu Mar  6 07:40:12 2014
New Revision: 1574785

URL: http://svn.apache.org/r1574785
Log:
Better fix for BZ56199
Fix failing unit tests caused by original fix.

Modified:
tomcat/trunk/java/org/apache/jasper/JspC.java
tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java
tomcat/trunk/test/org/apache/jasper/servlet/TestJspCServletContext.java

Modified: tomcat/trunk/java/org/apache/jasper/JspC.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/JspC.java?rev=1574785r1=1574784r2=1574785view=diff
==
--- tomcat/trunk/java/org/apache/jasper/JspC.java (original)
+++ tomcat/trunk/java/org/apache/jasper/JspC.java Thu Mar  6 07:40:12 2014
@@ -1463,17 +1463,11 @@ public class JspC extends Task implement
 PrintWriter log = new PrintWriter(System.out);
 URL resourceBase = new 
File(uriRoot).getCanonicalFile().toURI().toURL();
 
-context = new JspCServletContext(log, resourceBase, classLoader);
+context = new JspCServletContext(log, resourceBase, classLoader,
+isValidateXml(), isBlockExternal());
 if (isValidateTld()) {
 context.setInitParameter(Constants.XML_VALIDATION_TLD_INIT_PARAM, 
true);
 }
-if (isValidateXml()) {
-context.setInitParameter(Constants.XML_VALIDATION_INIT_PARAM, 
true);
-}
-context.setInitParameter(Constants.XML_BLOCK_EXTERNAL_INIT_PARAM,
-String.valueOf(isBlockExternal()));
-
-context.processWebXml();
 
 TldScanner scanner = new TldScanner(
 context, true, isValidateTld(), isBlockExternal());

Modified: tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java?rev=1574785r1=1574784r2=1574785view=diff
==
--- tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java 
(original)
+++ tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java Thu Mar 
 6 07:40:12 2014
@@ -45,7 +45,6 @@ import javax.servlet.SessionCookieConfig
 import javax.servlet.SessionTrackingMode;
 import javax.servlet.descriptor.JspConfigDescriptor;
 
-import org.apache.jasper.Constants;
 import org.apache.jasper.JasperException;
 import org.apache.jasper.compiler.Localizer;
 import org.apache.jasper.util.ExceptionUtils;
@@ -115,35 +114,28 @@ public class JspCServletContext implemen
  *
  * @param aLogWriter PrintWriter which is used for codelog()/code calls
  * @param aResourceBaseURL Resource base URL
+ * @param classLoader   Class loader for this {@link ServletContext}
+ * @param validate  Should a validating parser be used to parse 
web.xml?
+ * @param blockExternal Should external entities be blocked when parsing
+ *  web.xml?
  * @throws JasperException
  */
-public JspCServletContext(PrintWriter aLogWriter, URL aResourceBaseURL, 
ClassLoader classLoader)
-throws JasperException {
+public JspCServletContext(PrintWriter aLogWriter, URL aResourceBaseURL,
+ClassLoader classLoader, boolean validate, boolean blockExternal)
+throws JasperException {
 
 myAttributes = new HashMap();
 myParameters = new ConcurrentHashMap();
 myLogWriter = aLogWriter;
 myResourceBaseURL = aResourceBaseURL;
 this.loader = classLoader;
-}
-
-public void processWebXml() throws JasperException {
-this.webXml = buildMergedWebXml();
+this.webXml = buildMergedWebXml(validate, blockExternal);
 jspConfigDescriptor = webXml.getJspConfigDescriptor();
 }
 
-private WebXml buildMergedWebXml() throws JasperException {
+private WebXml buildMergedWebXml(boolean validate, boolean blockExternal)
+throws JasperException {
 WebXml webXml = new WebXml();
-String blockExternalString = getInitParameter(
-Constants.XML_BLOCK_EXTERNAL_INIT_PARAM);
-boolean blockExternal;
-if (blockExternalString == null) {
-blockExternal = true;
-} else {
-blockExternal = Boolean.parseBoolean(blockExternalString);
-}
-boolean validate = Boolean.parseBoolean(
-getInitParameter(Constants.XML_VALIDATION_INIT_PARAM));
 WebXmlParser webXmlParser = new WebXmlParser(validate, validate, 
blockExternal);
 // Use this class's classloader as Ant will have set the TCCL to its 
own
 webXmlParser.setClassLoader(getClass().getClassLoader());

Modified: 
tomcat/trunk/test/org/apache/jasper/servlet/TestJspCServletContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/jasper/servlet/TestJspCServletContext.java?rev=1574785r1=1574784r2=1574785view=diff