[GUMP@vmgump]: Project tomcat-taglibs-standard (in module tomcat-taglibs) failed

2012-09-26 Thread Gump
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-taglibs-standard has an issue affecting its community 
integration.
This issue affects 2 projects,
 and has been outstanding for 97 runs.
The current state of this project is 'Failed', with reason 'Build Failed'.
For reference only, the following projects are affected by this:
- tomcat-taglibs-standard :  Standard Taglib
- tomcat-taglibs-standard-install :  JSP Taglibs


Full details are available at:

http://vmgump.apache.org/gump/public/tomcat-taglibs/tomcat-taglibs-standard/index.html

That said, some information snippets are provided here.

The following annotations (debug/informational/warning/error messages) were 
provided:
 -INFO- Optional dependency httpunit failed with reason build failed
 -DEBUG- (Apache Gump generated) Apache Maven Settings in: 
/srv/gump/public/workspace/tomcat-taglibs/standard/gump_mvn_settings.xml
 -INFO- Failed with reason build failed
 -DEBUG- Maven POM in: 
/srv/gump/public/workspace/tomcat-taglibs/standard/pom.xml
 -INFO- Failed to extract fallback artifacts from Gump Repository



The following work was performed:
http://vmgump.apache.org/gump/public/tomcat-taglibs/tomcat-taglibs-standard/gump_work/build_tomcat-taglibs_tomcat-taglibs-standard.html
Work Name: build_tomcat-taglibs_tomcat-taglibs-standard (Type: Build)
Work ended in a state of : Failed
Elapsed: 20 secs
Command Line: /opt/maven2/bin/mvn --batch-mode -DskipTests=true --settings 
/srv/gump/public/workspace/tomcat-taglibs/standard/gump_mvn_settings.xml 
install 
[Working Directory: /srv/gump/public/workspace/tomcat-taglibs/standard]
M2_HOME: /opt/maven2
-
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Nothing to compile - all classes are up to date
[debug] execute contextualize
[INFO] [resources:testResources {execution: default-testResources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 
/srv/gump/public/workspace/tomcat-taglibs/standard/spec/src/test/resources
[INFO] Copying 3 resources
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] No sources to compile
[INFO] [surefire:test {execution: default-test}]
[INFO] Tests are skipped.
[INFO] [bundle:bundle {execution: default-bundle}]
[INFO] [install:install {execution: default-install}]
[INFO] Installing 
/srv/gump/public/workspace/tomcat-taglibs/standard/spec/target/taglibs-standard-spec-1.2-SNAPSHOT.jar
 to 
/srv/gump/public/workspace/mvnlocalrepo/shared/org/apache/taglibs/taglibs-standard-spec/1.2-SNAPSHOT/taglibs-standard-spec-1.2-SNAPSHOT.jar
[INFO] [bundle:install {execution: default-install}]
[INFO] Parsing 
file:/srv/gump/public/workspace/mvnlocalrepo/shared/repository.xml
[INFO] Installing 
org/apache/taglibs/taglibs-standard-spec/1.2-SNAPSHOT/taglibs-standard-spec-1.2-SNAPSHOT.jar
[INFO] Writing OBR metadata
[INFO] 
[INFO] Building JSTL Implementation
[INFO]task-segment: [install]
[INFO] 
[INFO] [remote-resources:process {execution: default}]
[INFO] snapshot org.apache.taglibs:taglibs-standard-spec:1.2-SNAPSHOT: checking 
for updates from apache.snapshots
[debug] execute contextualize
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 14 resources
[INFO] Copying 3 resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 96 source files to 
/srv/gump/public/workspace/tomcat-taglibs/standard/impl/target/classes
[INFO] -
[ERROR] COMPILATION ERROR : 
[INFO] -
[ERROR] 
/srv/gump/public/workspace/tomcat-taglibs/standard/impl/src/main/java/org/apache/taglibs/standard/tag/common/sql/DataSourceWrapper.java:[38,7]
 error: DataSourceWrapper is not abstract and does not override abstract method 
getParentLogger() in CommonDataSource
[INFO] 1 error
[INFO] -
[INFO] 
[ERROR] BUILD FAILURE
[INFO] 
[INFO] Compilation failure
/srv/gump/public/workspace/tomcat-taglibs/standard/impl/src/main/java/org/apache/taglibs/standard/tag/common/sql/DataSourceWrapper.java:[38,7]
 error: DataSourceWrapper is not abstract and does not override abstract method 
getParentLogger() in CommonDataSource

[INFO] 
[INFO] For more information, run Maven with the -e switch
[INFO] ---

[Bug 53199] Refactor ConnectionPool to use ScheduledExecutorService instead of TimerTask

2012-09-26 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=53199

--- Comment #2 from Patric Rufflar  ---
I just want to add that the current (TimerTask) implementation seems to have a
bug which causes that the PoolCleaner Thread will not be terminated/canceled in
some cases.
I am currently unable to reproduce this but I saw this issue several times.

-- 
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: r1390460 - /tomcat/trunk/java/org/apache/tomcat/util/collections/SynchronizedStack.java

2012-09-26 Thread markt
Author: markt
Date: Wed Sep 26 13:17:46 2012
New Revision: 1390460

URL: http://svn.apache.org/viewvc?rev=1390460&view=rev
Log:
Better comment

Modified:
tomcat/trunk/java/org/apache/tomcat/util/collections/SynchronizedStack.java

Modified: 
tomcat/trunk/java/org/apache/tomcat/util/collections/SynchronizedStack.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/collections/SynchronizedStack.java?rev=1390460&r1=1390459&r2=1390460&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/collections/SynchronizedStack.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/collections/SynchronizedStack.java 
Wed Sep 26 13:17:46 2012
@@ -18,7 +18,7 @@ package org.apache.tomcat.util.collectio
 
 /**
  * This is intended as a (mostly) GC-free alternative to
- * {@link java.util.concurrent.ConcurrentLinkedQueue} where the requirement is 
to
+ * {@link java.util.concurrent.ConcurrentLinkedQueue} when the requirement is 
to
  * create a pool of re-usable objects with no requirement to shrink the pool.
  * The aim is to provide the bare minimum of required functionality as quickly
  * as possible with minimum garbage.



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



svn commit: r1390484 - /tomcat/trunk/test/org/apache/tomcat/util/collections/TesterPerformanceSynchronizedStack.java

2012-09-26 Thread markt
Author: markt
Date: Wed Sep 26 13:42:54 2012
New Revision: 1390484

URL: http://svn.apache.org/viewvc?rev=1390484&view=rev
Log:
Additional name changes

Modified:

tomcat/trunk/test/org/apache/tomcat/util/collections/TesterPerformanceSynchronizedStack.java

Modified: 
tomcat/trunk/test/org/apache/tomcat/util/collections/TesterPerformanceSynchronizedStack.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/collections/TesterPerformanceSynchronizedStack.java?rev=1390484&r1=1390483&r2=1390484&view=diff
==
--- 
tomcat/trunk/test/org/apache/tomcat/util/collections/TesterPerformanceSynchronizedStack.java
 (original)
+++ 
tomcat/trunk/test/org/apache/tomcat/util/collections/TesterPerformanceSynchronizedStack.java
 Wed Sep 26 13:42:54 2012
@@ -32,7 +32,7 @@ public class TesterPerformanceSynchroniz
 private static final Queue QUEUE = new ConcurrentLinkedQueue<>();
 
 @Test
-public void testConcurrentStack() throws InterruptedException {
+public void testSynchronizedStack() throws InterruptedException {
 Thread[] threads = new Thread[THREAD_COUNT];
 for (int i = 0; i < THREAD_COUNT; i++) {
 threads[i] = new StackThread();
@@ -50,7 +50,7 @@ public class TesterPerformanceSynchroniz
 
 long end = System.currentTimeMillis();
 
-System.out.println("ConcurrentStack: " + (end - start) + "ms");
+System.out.println("SynchronizedStack: " + (end - start) + "ms");
 }
 
 public static class StackThread extends Thread {



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



svn commit: r1390486 - /tomcat/trunk/test/org/apache/tomcat/util/collections/TesterPerformanceSynchronizedStack.java

2012-09-26 Thread markt
Author: markt
Date: Wed Sep 26 13:47:08 2012
New Revision: 1390486

URL: http://svn.apache.org/viewvc?rev=1390486&view=rev
Log:
Lower thread count by default

Modified:

tomcat/trunk/test/org/apache/tomcat/util/collections/TesterPerformanceSynchronizedStack.java

Modified: 
tomcat/trunk/test/org/apache/tomcat/util/collections/TesterPerformanceSynchronizedStack.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/collections/TesterPerformanceSynchronizedStack.java?rev=1390486&r1=1390485&r2=1390486&view=diff
==
--- 
tomcat/trunk/test/org/apache/tomcat/util/collections/TesterPerformanceSynchronizedStack.java
 (original)
+++ 
tomcat/trunk/test/org/apache/tomcat/util/collections/TesterPerformanceSynchronizedStack.java
 Wed Sep 26 13:47:08 2012
@@ -23,7 +23,7 @@ import org.junit.Test;
 
 public class TesterPerformanceSynchronizedStack {
 
-private static final int THREAD_COUNT = 40;
+private static final int THREAD_COUNT = 4;
 private static final int ITERATIONS = 100;
 
 private static final SynchronizedStack STACK =
@@ -99,7 +99,7 @@ public class TesterPerformanceSynchroniz
 if (obj == null) {
 obj = new Object();
 }
-QUEUE.add(obj);
+QUEUE.offer(obj);
 }
 super.run();
 }



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



FormAuthenticatorTest for cases without cookies - implementation issues

2012-09-26 Thread Brian Burch

Thanks for all the help while I was developing the new test case for
https://issues.apache.org/bugzilla/show_bug.cgi?id=53584. The thread on 
the users mailing list is called "AuthenticatorBase 
setChangeSessionIdOnAuthentication without cookies".


I now have two new test cases working successfully against a 
recently-updated trunk. I hope to use them in future as boilerplates, to 
expand the set of tests, and also to examine SSO behaviour.


Before I open a bugzilla enhancement request and submit my patch files, 
I would like to discuss my implementation decisions in general, to 
ensure that my effort, and other developer's time, isn't wasted.


I found it necessary to modify both 
org.apache.catalina.authenticator.FormAuthenticatorTest, and its parent 
class org.apache.catalina.startup.SimpleHttpClient.


To save you looking it up, here is the unchanged class comment to 
SimpleHttpClient:


/**
 * Simple client for unit testing. It isn't robust, it isn't secure and
 * should not be used as the basis for production code. Its only purpose
 * is to do the bare minimum for the unit tests.
 */

FormAuthenticatorTest doesn't have a class-level comment at all, but I 
have written a new one based on the conclusions in my thread on the 
users list.


I would have preferred to make fairly localised changes to both of these 
classes, but the existing logic seems to incorporate some fundamental 
assumptions that made my intention too difficult to implement.


I am not at all proud of my code, but I believe it a) works, b) is 
fairly harmonious with the existing design, and c) is amenable to the 
extensions I intend to add in due course.


Firstly, I've written several small blocks of parser logic for urls and 
http headers, which are specific to the test environment and not very 
pretty. I looked for suitable parsers to re-use in the various tomcat 
utils packages, but haven't found them yet, even though tomcat MUST be 
doing similar work in an elegant and robust manner. I haven't found any 
unit tests, either.


Then, I looked at the apache HttpClient project. An ideal solution would 
have been to use the parsers from that project, or perhaps even the 
entire client. This would have required starting with a blank sheet of 
paper, and I am very reluctant to take that approach. I might have been 
swayed if I had found HttpClient already in use by other tomcat unit 
tests, but I couldn't find it in the dependencies and didn't want to add 
a new one.


Next,  the current version only supports cookies, so I had to add some 
extra boolean arguments to control the use of server and client cookies 
in each test case. In my professional work, I would have use singleton 
inner classes to achieve type-safety and make these crucial arguments 
self-documenting, but this wouldn't be compatible with the existing 
style of the various current authenticator unit test classes. Also, I 
wanted to make my initial change as transparent as possible, so it could 
be reviewed (and accepted) with as little effort from others as possible.


I didn't want to touch SimpleHttpClient at all, but that turned out to 
be unavoidable. This class does most of the http header processing, and 
so it seemed ugly to split this work between the two classes. On the 
other hand, all the url handling is done by FormAuthenticatorTest, so it 
felt ugly to start doing any of that work in SimpleHttpClient. The 
consequence is that the two classes need to be cross-wired to some 
extent. This was always the case, but I had to cross some more wires for 
the new test cases.


So, to summarise: I would like to make quite a bulky change to these two 
classes. I am somewhat embarrassed by my ugly style and DIY approach to 
parsing. Many of the line-changes in the patch are trivial, but a lot of 
lines will be hit at once. I haven't gone mad with comments, but have 
tried to add useful tips when an existing section of uncommented code 
didn't make sense to me. On the other hand, to maintain similar 
look'n'feel, I haven't been heavy-handed with comments in my new code. 
Of course, I will make sure it passes checkstyle before I actually cut 
the patches!


To put things in perspective, the tests only demonstrate that Mark's fix 
works - and that wasn't even in question. However, I'd like to get my 
change committed soon, so that I can move forward with additional test 
cases.


What do you think? Should I publish and be damned, or would you like me 
to do more work to eliminate some of my compromises?


Thanks for reading this...

Brian




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



[Tomcat Wiki] Update of "LocalBadContent" by KonstantinKolinko

2012-09-26 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Tomcat Wiki" for change 
notification.

The "LocalBadContent" page has been changed by KonstantinKolinko:
http://wiki.apache.org/tomcat/LocalBadContent?action=diff&rev1=56&rev2=57

  mamaiacazare
  masterjin\.com
  mathsolutions\.50webs\.com
+ maxref\.co\.cc
  meratolreviewblog\.com
  mnsp\.cn
  muscleandfitness\.net

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



[Bug 53936] New: Minimize classloader leaks from stacktrace elements in long-lived Exceptions

2012-09-26 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=53936

  Priority: P2
Bug ID: 53936
  Assignee: dev@tomcat.apache.org
   Summary: Minimize classloader leaks from stacktrace elements in
long-lived Exceptions
  Severity: enhancement
Classification: Unclassified
OS: Windows NT
  Reporter: timo.kinnu...@gmail.com
  Hardware: PC
Status: NEW
   Version: unspecified
 Component: Catalina
   Product: Tomcat 7

MemoryLeakProtection in the Tomcat wiki says: "Sun bug 6916498 - An exception
can keep a classloader in memory if the stack trace that was recorded when it
was created contains a reference to one of its classes." This bug may be
considered an acceptable performance tradeoff, so detection and mitigation in
the meantime is in my opinion desirable.

The leak is caused by a reference cycle that is only partially visible to the
garbage collector. The method fillInStackTrace() can be called on an Exception
object to alter its stacktrace, but to effectively break the cycle the method
call chain up to that point must be clean of any classes that shouldn't be
retained.

The attached test code contains two versions of the algorithm, for Java 1.6 and
1.7. The 1.6 version is intended to be effective only when loaded by a shared
classloader, the 1.7 version should be effective even if loaded by a webapp
classloader.

The methods are intended to be called before or during webapp
unloading/reloading on Exception objects stored in static variables.

Please review to see if I've made any mistakes and consider for enhancement :)

-- 
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 53936] Minimize classloader leaks from stacktrace elements in long-lived Exceptions

2012-09-26 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=53936

--- Comment #1 from Timo Kinnunen  ---
Created attachment 29421
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29421&action=edit
Cleaning Exception stacktrace by carefully calling fillInStackTrace

-- 
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 45392] No OCSP support for client SSL verification

2012-09-26 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=45392

--- Comment #12 from Aristotelis  ---
Since this feature has been added to apache tomcat 1.1.23 shouldn't this bug be
closed??

-- 
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 53937] New: Double call to apr_pool_destroy() if OCSP checking is enabled and OCSP server is unreachable leads to crash

2012-09-26 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=53937

  Priority: P2
Bug ID: 53937
  Assignee: dev@tomcat.apache.org
   Summary: Double call to apr_pool_destroy() if OCSP checking is
enabled and OCSP server is unreachable leads to crash
  Severity: regression
Classification: Unclassified
OS: Linux
  Reporter: ar...@noc.edunet.gr
  Hardware: All
Status: NEW
   Version: 1.1.24
 Component: Library
   Product: Tomcat Native

Created attachment 29422
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29422&action=edit
Bug Fix for the double apr_pool_destroy()

When OCSP checking is enabled, the code checks the OCSP server. If the OCSP
server is contacted everything goes fine. However if the OCSP server cannot be
contacted, this leads to a double apr_pool_destroy() that crashes the thread,
can lead to TOMCAT crash. The problem exists in 
static int ssl_ocsp_request(X509 *cert, X509 *issuer);

and the problem exists in the following code:

if (ocsp_urls != NULL) {
OCSP_RESPONSE *resp;
/* for the time being just check for the fist response .. a better  
   approach is to iterate for all the possible ocsp urls */
resp = get_ocsp_response(cert, issuer, ocsp_urls[0]);

apr_pool_destroy(p);
if (resp != NULL)
return process_ocsp_response(resp);
}
apr_pool_destroy(p);
return OCSP_STATUS_UNKNOWN;
}

If get_ocsp_response returns NULL, then apr_pool_destroy(p) is called twice.

I believe that this should also affect 1.1.23

A bug fix is included in the attached patch

-- 
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: r1390599 - in /tomcat/trunk: java/org/apache/tomcat/util/collections/SynchronizedQueue.java test/org/apache/tomcat/util/collections/TestSynchronizedQueue.java test/org/apache/tomcat/util/c

2012-09-26 Thread markt
Author: markt
Date: Wed Sep 26 16:55:56 2012
New Revision: 1390599

URL: http://svn.apache.org/viewvc?rev=1390599&view=rev
Log:
A slightly different alternative to ConcurrentLinkedQueue. This one is also 
largely GC free and has similar performance to the Stack version.

Added:
tomcat/trunk/java/org/apache/tomcat/util/collections/SynchronizedQueue.java 
  (with props)

tomcat/trunk/test/org/apache/tomcat/util/collections/TestSynchronizedQueue.java 
  (with props)

tomcat/trunk/test/org/apache/tomcat/util/collections/TesterPerformanceSynchronizedQueue.java
   (with props)

Added: 
tomcat/trunk/java/org/apache/tomcat/util/collections/SynchronizedQueue.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/collections/SynchronizedQueue.java?rev=1390599&view=auto
==
--- tomcat/trunk/java/org/apache/tomcat/util/collections/SynchronizedQueue.java 
(added)
+++ tomcat/trunk/java/org/apache/tomcat/util/collections/SynchronizedQueue.java 
Wed Sep 26 16:55:56 2012
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tomcat.util.collections;
+
+/**
+ * This is intended as a (mostly) GC-free alternative to
+ * {@link java.util.concurrent.ConcurrentLinkedQueue} when the requirement is 
to
+ * create an unbounded queue with no requirement to shrink the queue. The aim 
is
+ * to provide the bare minimum of required functionality as quickly as possible
+ * with minimum garbage.
+ */
+public class SynchronizedQueue {
+
+public static final int DEFAULT_SIZE = 128;
+
+private Object[] queue;
+private int size;
+private int insert = 0;
+private int remove = 0;
+
+public SynchronizedQueue() {
+this(DEFAULT_SIZE);
+}
+
+public SynchronizedQueue(int initialSize) {
+queue = new Object[initialSize];
+size = initialSize;
+}
+
+public synchronized boolean offer(T t) {
+queue[insert++] = t;
+
+// Wrap
+if (insert == size) {
+insert = 0;
+}
+
+if (insert == remove) {
+expand();
+}
+return true;
+}
+
+public synchronized T poll() {
+if (insert == remove) {
+// empty
+return null;
+}
+
+@SuppressWarnings("unchecked")
+T result = (T) queue[remove];
+queue[remove] = null;
+remove++;
+
+// Wrap
+if (remove == size) {
+remove = 0;
+}
+
+return result;
+}
+
+private void expand() {
+int newSize = size * 2;
+Object[] newQueue = new Object[newSize];
+
+System.arraycopy(queue, insert, newQueue, 0, size - insert);
+System.arraycopy(queue, 0, newQueue, size - insert, insert);
+
+insert = size;
+remove = 0;
+queue = newQueue;
+size = newSize;
+}
+
+public synchronized int size() {
+int result = insert - remove;
+if (result < 0) {
+result += size;
+}
+return result;
+}
+
+public synchronized void clear() {
+queue = new Object[size];
+insert = 0;
+remove = 0;
+}
+}

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

Added: 
tomcat/trunk/test/org/apache/tomcat/util/collections/TestSynchronizedQueue.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/collections/TestSynchronizedQueue.java?rev=1390599&view=auto
==
--- 
tomcat/trunk/test/org/apache/tomcat/util/collections/TestSynchronizedQueue.java 
(added)
+++ 
tomcat/trunk/test/org/apache/tomcat/util/collections/TestSynchronizedQueue.java 
Wed Sep 26 16:55:56 2012
@@ -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 un

[Tomcat Wiki] Update of "PoweredBy" by PredictiveDialer

2012-09-26 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Tomcat Wiki" for change 
notification.

The "PoweredBy" page has been changed by PredictiveDialer:
http://wiki.apache.org/tomcat/PoweredBy?action=diff&rev1=441&rev2=442

  
  [[http://www.acugis.com/|AcuGIS]]   Tomcat hosting solutions with emphasis on 
GIS (GeoServer and PostGIS). Tomcat 6 and 7 options with private JVM. High 
performance hosting with SAS 15k disks and 1 Gb public/private network on all 
hosting plans.
  
+ === Auto Dialer - Vioteck ===
+ [[http://www.hosteddialer.com/auto-dialer.html|Hosted Auto Dialer]] - 
Provides hosting solutions for the use of an auto dialer, making performance 
and affordability greater than non-hosted options.
+ 
  === Bestinweb.it ===
  {{http://images.bestinweb.it/logowebsite.jpg}} 
[[http://www.bestinweb.it/|Bestinweb]] is a little hosting provider that 
provides, hosting apart, many other services like: 
[[http://www.bestinweb.it/web-design/|Web Design]], 
[[http://www.bestinweb.it/|Sviluppo siti internet]] and 
[[http://www.bestinweb.it/|Posizionamento siti]].
  

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



[Bug 53938] New: Silent Install

2012-09-26 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=53938

  Priority: P2
Bug ID: 53938
  Assignee: dev@tomcat.apache.org
   Summary: Silent Install
  Severity: normal
Classification: Unclassified
  Reporter: j...@bolioshot.com
  Hardware: PC
Status: NEW
   Version: 7.0.30
 Component: Packaging
   Product: Tomcat 7

This is a feature request.  Currently installing Apache Tomcat 7 silently
defaults to C:\Program Files\Apache Software Foundation\Tomcat 7.0 even if a
previous install was in a different directory.  I am requesting that the silent
install switch (/S) installs Tomcat in the directory located in the registry
key HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software
Foundation\Tomcat\7.0\Tomcat7\InstallPath, which is the location of the
previous install, whether in the default location or not.
I am aware of the install switch /D=install directory, but if that switch isn't
used, it should default to the location of the previous install that is shown
in the registry.
If you are able to fix it for 7.0 could you also fix it for every supported
version of Tomcat?
Thanks -JB

-- 
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: r1390714 - in /tomcat/trunk/java/org/apache: coyote/ coyote/ajp/ coyote/http11/ tomcat/util/collections/ tomcat/util/net/

2012-09-26 Thread markt
Author: markt
Date: Wed Sep 26 20:09:35 2012
New Revision: 1390714

URL: http://svn.apache.org/viewvc?rev=1390714&view=rev
Log:
Switch to SynchronizedQueue for the event queues
Switch to SynchronizedStack for the Processor cache
These changes together reduce object allocation during my load test by ~22% 
compared to prior to these changes

Modified:
tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java
tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java
tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java
tomcat/trunk/java/org/apache/coyote/ajp/AjpProtocol.java
tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java
tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java
tomcat/trunk/java/org/apache/tomcat/util/collections/SynchronizedStack.java
tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java
tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java

Modified: tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java?rev=1390714&r1=1390713&r2=1390714&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java Wed Sep 26 
20:09:35 2012
@@ -19,7 +19,6 @@ package org.apache.coyote;
 import java.io.IOException;
 import java.net.InetAddress;
 import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentLinkedQueue;
 import java.util.concurrent.Executor;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicLong;
@@ -35,6 +34,7 @@ import org.apache.coyote.http11.upgrade.
 import org.apache.coyote.http11.upgrade.UpgradeProcessor;
 import org.apache.juli.logging.Log;
 import org.apache.tomcat.util.ExceptionUtils;
+import org.apache.tomcat.util.collections.SynchronizedStack;
 import org.apache.tomcat.util.modeler.Registry;
 import org.apache.tomcat.util.net.AbstractEndpoint;
 import org.apache.tomcat.util.net.AbstractEndpoint.Handler;
@@ -595,7 +595,7 @@ public abstract class AbstractProtocol i
 
 try {
 if (processor == null) {
-processor = recycledProcessors.poll();
+processor = recycledProcessors.pop();
 }
 if (processor == null) {
 processor = createProcessor();
@@ -750,9 +750,8 @@ public abstract class AbstractProtocol i
 }
 
 protected static class RecycledProcessors, S>
-extends ConcurrentLinkedQueue> {
+extends SynchronizedStack> {
 
-private static final long serialVersionUID = 1L;
 private final transient AbstractConnectionHandler handler;
 protected final AtomicInteger size = new AtomicInteger(0);
 
@@ -761,13 +760,13 @@ public abstract class AbstractProtocol i
 }
 
 @Override
-public boolean offer(Processor processor) {
+public boolean push(Processor processor) {
 int cacheSize = handler.getProtocol().getProcessorCache();
 boolean offer = cacheSize == -1 ? true : size.get() < cacheSize;
 //avoid over growing our cache or add after we have stopped
 boolean result = false;
 if (offer) {
-result = super.offer(processor);
+result = super.push(processor);
 if (result) {
 size.incrementAndGet();
 }
@@ -777,8 +776,8 @@ public abstract class AbstractProtocol i
 }
 
 @Override
-public Processor poll() {
-Processor result = super.poll();
+public Processor pop() {
+Processor result = super.pop();
 if (result != null) {
 size.decrementAndGet();
 }
@@ -787,10 +786,10 @@ public abstract class AbstractProtocol i
 
 @Override
 public void clear() {
-Processor next = poll();
+Processor next = pop();
 while (next != null) {
 handler.unregister(next);
-next = poll();
+next = pop();
 }
 super.clear();
 size.set(0);

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java?rev=1390714&r1=1390713&r2=1390714&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java Wed Sep 26 
20:09:35 2012
@@ -131,7 +131,7 @@ public class AjpAprProtocol extends Abst
 Processor processor, boolean isSoc

svn commit: r1390717 - /tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java

2012-09-26 Thread markt
Author: markt
Date: Wed Sep 26 20:31:11 2012
New Revision: 1390717

URL: http://svn.apache.org/viewvc?rev=1390717&view=rev
Log:
No need to create runnable and wake up the selector if it isn't going to do 
anything.

Modified:
tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java?rev=1390717&r1=1390716&r2=1390717&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java Wed 
Sep 26 20:31:11 2012
@@ -244,14 +244,15 @@ public class NioBlockingSelector {
 }
 
 public void add(final KeyAttachment key, final int ops, final 
KeyReference ref) {
+if ( key == null ) return;
+NioChannel nch = key.getChannel();
+if ( nch == null ) return;
+final SocketChannel ch = nch.getIOChannel();
+if ( ch == null ) return;
+
 Runnable r = new Runnable() {
 @Override
 public void run() {
-if ( key == null ) return;
-NioChannel nch = key.getChannel();
-if ( nch == null ) return;
-SocketChannel ch = nch.getIOChannel();
-if ( ch == null ) return;
 SelectionKey sk = ch.keyFor(selector);
 try {
 if (sk == null) {
@@ -274,14 +275,15 @@ public class NioBlockingSelector {
 }
 
 public void remove(final KeyAttachment key, final int ops) {
+if ( key == null ) return;
+NioChannel nch = key.getChannel();
+if ( nch == null ) return;
+final SocketChannel ch = nch.getIOChannel();
+if ( ch == null ) return;
+
 Runnable r = new Runnable() {
 @Override
 public void run() {
-if ( key == null ) return;
-NioChannel nch = key.getChannel();
-if ( nch == null ) return;
-SocketChannel ch = nch.getIOChannel();
-if ( ch == null ) return;
 SelectionKey sk = ch.keyFor(selector);
 try {
 if (sk == null) {



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



svn commit: r1390718 [2/2] - in /tomcat/sandbox/trunk-resources: ./ java/org/apache/catalina/connector/ java/org/apache/catalina/core/ java/org/apache/catalina/valves/ java/org/apache/coyote/ java/org

2012-09-26 Thread markt
Modified: 
tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/buf/B2CConverter.java
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/buf/B2CConverter.java?rev=1390718&r1=1390717&r2=1390718&view=diff
==
--- 
tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/buf/B2CConverter.java
 (original)
+++ 
tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/buf/B2CConverter.java
 Wed Sep 26 20:35:24 2012
@@ -81,12 +81,21 @@ public class B2CConverter {
 // Encoding names should all be ASCII
 String lowerCaseEnc = enc.toLowerCase(Locale.US);
 
+return getCharsetLower(lowerCaseEnc);
+}
+
+/**
+ * Only to be used when it is known that the encoding name is in lower 
case.
+ */
+public static Charset getCharsetLower(String lowerCaseEnc)
+throws UnsupportedEncodingException{
+
 Charset charset = encodingToCharsetCache.get(lowerCaseEnc);
 
 if (charset == null) {
 // Pre-population of the cache means this must be invalid
 throw new UnsupportedEncodingException(
-sm.getString("b2cConverter.unknownEncoding", enc));
+sm.getString("b2cConverter.unknownEncoding", 
lowerCaseEnc));
 }
 return charset;
 }

Modified: 
tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/net/NioBlockingSelector.java
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/net/NioBlockingSelector.java?rev=1390718&r1=1390717&r2=1390718&view=diff
==
--- 
tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/net/NioBlockingSelector.java
 (original)
+++ 
tomcat/sandbox/trunk-resources/java/org/apache/tomcat/util/net/NioBlockingSelector.java
 Wed Sep 26 20:35:24 2012
@@ -26,7 +26,6 @@ import java.nio.channels.SelectionKey;
 import java.nio.channels.Selector;
 import java.nio.channels.SocketChannel;
 import java.util.Iterator;
-import java.util.concurrent.ConcurrentLinkedQueue;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -34,6 +33,8 @@ import java.util.concurrent.atomic.Atomi
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.ExceptionUtils;
+import org.apache.tomcat.util.collections.SynchronizedQueue;
+import org.apache.tomcat.util.collections.SynchronizedStack;
 import org.apache.tomcat.util.net.NioEndpoint.KeyAttachment;
 
 public class NioBlockingSelector {
@@ -42,6 +43,9 @@ public class NioBlockingSelector {
 
 private static int threadCounter = 0;
 
+private final SynchronizedStack keyReferenceStack =
+new SynchronizedStack<>();
+
 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 = keyReferenceStack.pop();
+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;
+keyReferenceStack.push(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 = keyReferenceStack.pop();
+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;
+keyReferenceStack.push(reference);
 }
 return read;
 }
@@ -203,10 +215,10 @@ public class NioBlockingSelector {
 protected static class BlockPoller extends Thread {
 protected volatile boolean run = true;
 protected Selector selector = null;
-protected ConcurrentLinkedQueue events =
-   

Re: Resources - Is DirContext the right basis for the API?

2012-09-26 Thread Mark Thomas
On 19/09/2012 20:46, Mark Thomas wrote:
> On 09/09/2012 19:50, Mark Thomas wrote:
>> This is part of issue b) in Konstantin's comments in TOMCAT-NEXT.txt
>>
>> Konstantin has accurately summed up the issues with basing the API on
>> DirContext as:
>>  - Unnecessary objects, e.g. NamingException instead of null.
>>
>>  - Too many methods. Name vs. String. list() vs. listBindings().
>>
>>  - Limited API. As a workaround, there are non-standard methods that
>>are implemented on BaseDirContext instead, e.g. getRealPath(),
>>doListBindings(..).
>>
>> I do not believe that the resources implementation should be based
>> around DirContext. It adds a lot of unnecessary clutter and complexity
>> to something that is already fairly complex. A comparison of the
>> DirContext based implementation objects with the new implementation
>> demonstrates - in my view - how much simpler this could be.
> 
> This is the next issue I'd like to resolve.
> 
> Does anyone have any views one way or the other as to whether or not any
> refactoring of the Resources implementation should continue to be based
> around the JNDI DirContext interface?
> 
> My own view remains that DirContext adds complexity and clutter to code
> that needs simplicity and clarity.

There being no arguments against this in the last week, I am going to
move forward on the basis that is issue is resolved and that no-one
feels that DirContext is the right basis for the new resources
implementation.

Mark


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



svn commit: r1390733 - in /tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources: Cache.java CachedResource.java StandardRoot.java

2012-09-26 Thread markt
Author: markt
Date: Wed Sep 26 21:29:22 2012
New Revision: 1390733

URL: http://svn.apache.org/viewvc?rev=1390733&view=rev
Log:
Add the initial Cache implementation. Validation of individual resources 
against a TTL is implemented but there are several configuration and cache 
cleaning TODOs.

Added:

tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/Cache.java 
  (with props)

tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/CachedResource.java
   (with props)
Modified:

tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/StandardRoot.java

Added: 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/Cache.java
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/Cache.java?rev=1390733&view=auto
==
--- 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/Cache.java 
(added)
+++ 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/Cache.java 
Wed Sep 26 21:29:22 2012
@@ -0,0 +1,55 @@
+/*
+ * 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.catalina.webresources;
+
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+
+import org.apache.catalina.WebResource;
+
+public class Cache {
+
+private final StandardRoot root;
+
+private ConcurrentMap resourceCache =
+new ConcurrentHashMap<>();
+
+public Cache(StandardRoot root) {
+this.root = root;
+}
+
+protected WebResource getResource(String path) {
+// Multiple concurrent callers will end up with the same CachedResource
+// instance
+// TODO Config for TTL
+CachedResource newCacheEntry = new CachedResource(root, path, 5000);
+CachedResource result =
+resourceCache.putIfAbsent(path, newCacheEntry);
+
+if (result == null) {
+result = newCacheEntry;
+}
+
+// TODO check cache size and do minimum necessary to make room
+// TODO Cache size configuration
+result.validate();
+
+return result;
+}
+
+// TODO add background expiration
+}

Propchange: 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/Cache.java
--
svn:eol-style = native

Added: 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/CachedResource.java
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/CachedResource.java?rev=1390733&view=auto
==
--- 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/CachedResource.java
 (added)
+++ 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/CachedResource.java
 Wed Sep 26 21:29:22 2012
@@ -0,0 +1,230 @@
+/*
+ * 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.catalina.webresources;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.net.URL;
+
+import org.apache.catalina.WebResource;
+import org.apache.catalina.WebResourceRoot;
+
+/**
+ * This class is designed to wrap a 'raw' WebResource and providing caching for
+ * expensive operations. Inexpensive operations may be passed through to