DO NOT REPLY [Bug 51181] Add support for Web Sockets

2012-01-10 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51181

--- Comment #25 from Pid  2012-01-10 09:35:09 UTC ---

>   // WebSocket event processor
>   public void event(WebSocketEvent event) throws IOException, ServletException
> {
> WebSocketServletRequest request = event.getHttpServletRequest();
> WebSocketServletResponse response = event.getHttpServletResponse();
> // initial connection
> if (event.getEventType() == WebSocketEvent.EventType.BEGIN) {
>   ...
> }
> // 
> if (event.getEventType() == WebSocketEvent.EventType.MESSAGE) {
>   // Get message
>   WebSocketMessage inboundMessage = request.getMessage();
>   // Send message back to the client
>   response.sendMessage(new WebSocketMessage(...));

The server end probably also needs to be able to handle the receipt/issue of a
WebSocketFrame (e.g. PING/PONG frames). It's possible to send a CLOSE event in
between other frames and you might want to clean up before shutdown.

Sidenote: I think a Jetty & Tomcat collaboration would be pragmatic.

IMHO extending javax.servlet.http.WebSocketServlet would be a good final
outcome.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

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



DO NOT REPLY [Bug 52440] Wrong getValueReference behaviour with Facelets parameter expressions

2012-01-10 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=52440

--- Comment #2 from JustasR  2012-01-10 09:39:08 
UTC ---
Created attachment 28130
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28130
Test case for ValueReference returning null

I use SystemEventListener event javax.faces.event.PreRenderComponentEvent to
intercept component render process ant try to get component ValueExpression and
ValueReference from it (class TestSystemEventListener).

I use Facelets custom components with taglib file (not composite component).

Returned ValueReference is always null.

Null is returned from node AstIdentifier (super class SimpleNode)

I print returned ValueReference value to console.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

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



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

2012-01-10 Thread Rainer Jung

On 10.01.2012 05:27, Konstantin Kolinko wrote:

2012/1/10 Konstantin Kolinko:

2012/1/9 Konstantin Kolinko:

2012/1/7 Rainer Jung:


Maybe enable the accesslog during testing with test.accesslog=true, so one
can check after the next failure whether the contents agree with your
assumption. Not sure, whether Gump offers access to the access log for
checking.




I updated Gump configuration for tc7 and trunk enabling the access
log. We will see how it goes with next run.



So Gump runs with access logs. Look for "access_log.-mm-dd" in the
list of files.

(...)


Last run of tomcat-tc7.0.x-test failed with
org.apache.catalina.mbeans.TestRegistration.BIO.txt:
[[[
Testcase: testMBeanDeregistration took 1.756 sec
FAILED
Remaining: 
[Tomcat:type=RequestProcessor,worker="http-bio-127.0.0.1-auto-1",name=HttpRequest1]
expected:<0>  but was:<1>
junit.framework.AssertionFailedError: Remaining:
[Tomcat:type=RequestProcessor,worker="http-bio-127.0.0.1-auto-1",name=HttpRequest1]
expected:<0>  but was:<1>
at 
org.apache.catalina.mbeans.TestRegistration.testMBeanDeregistration(TestRegistration.java:209)
]]]


I let the TC 7 tests run in a loop now locally, with a subset of the 
tests (o.a.c.comet, ..., o.a.c.startup) and try to reproduce, no luck yet.


I added a local patch, which logs the MBean attributes, if any 
unexpected MBeans are found. That would only give some indication for 
the above case, if the request was still being processed. I took the 
code (about 150 lines) mostly unchanged from the JMXProxySerlvet. If you 
want I could apply to TestRegistration.java in trunk.


Regards,

Rainer


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



DO NOT REPLY [Bug 52328] Massive garbage production observed when using the response writer

2012-01-10 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=52328

--- Comment #3 from Mark Thomas  2012-01-10 10:38:46 UTC ---
Looking at this some more, I think we'll need to be careful around recycling,
resetting and flushing but the most efficient way to fix this is to remove the
calls to conv.flush() after every write. The C2BConvertor already has a buffer,
so lets use it.

I'll start looking at a patch along these lines and doing some testing.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

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



More Caching for WebappClassLoader?

2012-01-10 Thread Rainer Jung
I analyzed a fun problem a few weeks ago. Someone was using the shared 
loader extensively (TC 5.5). They observed performance problems and 
thread dumps showed, that often the class loader locking was the culprit.


Code was inside loadClass(). Now it turned out, it wasn't about really 
loading classes. Instead there was a lot of deserialization going on 
(data received from a backend app server). Deserialization uses 
reflection intensively and reflection leads to loadClass() calls to 
retrieve the classes. We observed e.g. several hundreds loadClass() 
calls per second.


Now loadClass() in the WebappClasLoader does:

- check own class cache
- check super class cache
- try loading from system loader
- call Class.forName with parent loader (which calls loadClass() there)
  [only if "delegated", which is *not* the default]
- try loading via findClass()
- call Class.forName with parent loader (which calls loadClass() there)
  [only if not "delegated", which *is* the default]

So if a class was previously loaded by the shared loader (or common or 
server), then we will not find in in our own or the super cache, will 
then *always* try to load it via system, will then (if default) always 
try to load it ourselves and only finally will try to load it via parent 
and find it there in the cache.


This turned out to become a bottleneck.

I implemented a quick hack which cached the classes loaded by system, 
parent and shared positively and negatively (not found) in the 
WebappLoader using the same method that was already used for its own 
cache. Thus the massive calls to those loaders could be avoided and the 
bottleneck went away.


I wonder whether we want to improve caching in the WebappLoader. Of 
course most deployments no longer use shared or common to share many 
application classes, but it is still a supported feature and for some 
classes like JDBC it is standard.


What we could do to keep the design simple is caching any positive 
result from loadClass() in the WebappLoader, even it it was found via 
super, system or parent. In addition we could also cache negative 
results for all those. The biggest downsides I can see would be


- less dynamics: if someone had a more dynamic loader unerneath ours, 
which would change the result of loadClass() during runtime, we would 
shield the app from it, because we now return classes from our cache.


- increased memory use for the cache, i.e. the list of class names and 
references to the classes.


To stay completely compatible I think the feature should not be default, 
at least until TC 7, maybe switch default for 8.


What do you think? Does it make sense? Should I prepare a patch for trunk?

Regards,

Rainer



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



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

2012-01-10 Thread Konstantin Kolinko
2012/1/10 Rainer Jung :
> On 10.01.2012 05:27, Konstantin Kolinko wrote:
>>
>> 2012/1/10 Konstantin Kolinko:
>>>
>>> 2012/1/9 Konstantin Kolinko:
>>
>> 2012/1/7 Rainer Jung:
>>>
>>>
>>> Maybe enable the accesslog during testing with test.accesslog=true,
>>> so one
>>> can check after the next failure whether the contents agree with your
>>> assumption. Not sure, whether Gump offers access to the access log
>>> for
>>> checking.
>>
>>

 I updated Gump configuration for tc7 and trunk enabling the access
 log. We will see how it goes with next run.

>>>
>>> So Gump runs with access logs. Look for "access_log.-mm-dd" in the
>>> list of files.
>>>
>>> (...)
>>
>>
>> Last run of tomcat-tc7.0.x-test failed with
>> org.apache.catalina.mbeans.TestRegistration.BIO.txt:
>> [[[
>> Testcase: testMBeanDeregistration took 1.756 sec
>>        FAILED
>> Remaining:
>> [Tomcat:type=RequestProcessor,worker="http-bio-127.0.0.1-auto-1",name=HttpRequest1]
>> expected:<0>  but was:<1>
>> junit.framework.AssertionFailedError: Remaining:
>>
>> [Tomcat:type=RequestProcessor,worker="http-bio-127.0.0.1-auto-1",name=HttpRequest1]
>> expected:<0>  but was:<1>
>>        at
>> org.apache.catalina.mbeans.TestRegistration.testMBeanDeregistration(TestRegistration.java:209)
>> ]]]
>
>
> I let the TC 7 tests run in a loop now locally, with a subset of the tests
> (o.a.c.comet, ..., o.a.c.startup) and try to reproduce, no luck yet.
>
> I added a local patch, which logs the MBean attributes, if any unexpected
> MBeans are found. That would only give some indication for the above case,
> if the request was still being processed. I took the code (about 150 lines)
> mostly unchanged from the JMXProxySerlvet. If you want I could apply to
> TestRegistration.java in trunk.

Yes, I think that is worth adding.


2. The testMBeanDeregistration() method starts with

Set onames = mbeanServer.queryNames(new
ObjectName("Catalina:*"), null);
assertEquals("Remaining: " + onames, 0, onames.size());

I think the same check could be done with "Tomcat:*" names.


The "TestRegistration.java:209" line where the assert was triggered is
near the end of testMBeanDeregistration() method, so all of the method
before that line did run fine.

(From reading the code I think that the checks in the middle of
testMBeanDeregistration() method would have detected unexpected beans
if those were present before the test and logged them, but adding
explicit check should not hurt.)

Best regards,
Konstantin Kolinko

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



svn commit: r1229504 - /tomcat/maven-plugin/trunk/src/site/apt/executable-war-jar.apt.vm

2012-01-10 Thread olamy
Author: olamy
Date: Tue Jan 10 11:09:19 2012
New Revision: 1229504

URL: http://svn.apache.org/viewvc?rev=1229504&view=rev
Log:
update documentation with new options available in jar exec cli

Modified:
tomcat/maven-plugin/trunk/src/site/apt/executable-war-jar.apt.vm

Modified: tomcat/maven-plugin/trunk/src/site/apt/executable-war-jar.apt.vm
URL: 
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/src/site/apt/executable-war-jar.apt.vm?rev=1229504&r1=1229503&r2=1229504&view=diff
==
--- tomcat/maven-plugin/trunk/src/site/apt/executable-war-jar.apt.vm (original)
+++ tomcat/maven-plugin/trunk/src/site/apt/executable-war-jar.apt.vm Tue Jan 10 
11:09:19 2012
@@ -150,13 +150,25 @@ Build a Executable War
 
 +--
 usage: java -jar [path to your exec war jar]
- -ajpPortajp port to use
- -D  key=value
- -h,--helphelp
- -httpPort  http port to use
- -httpsPorthttps port to use
- -resetExtractclean previous extract directory
- -serverXmlPathserver.xml to use, optional
- -X,--debug   debug
+ -ajpPort  ajp port to use
+ -clientAuthenable client authentication for
+https
+ -Dkey=value
+ -extractDirectorypath to extract war content,
+default value: .extract
+ -h,--help  help
+ -httpPorthttp port to use
+ -httpProtocolhttp protocol to use: HTTP/1.1 or
+org.apache.coyote.http11.Http11Nio
+Protocol
+ -httpsPort  https port to use
+ -keyAliasalias from keystore for ssl
+ -loggerNamelogger to use: slf4j to use slf4j
+bridge on top of jul
+ -obfuscate   obfuscate the password and exit
+ -resetExtract  clean previous extract directory
+ -serverXmlPath  server.xml to use, optional
+ -X,--debug debug
+
 +--
 



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



svn commit: r1229505 - in /tomcat/maven-plugin/trunk/src/site/apt: executable-war-jar.apt.vm index.apt.vm

2012-01-10 Thread olamy
Author: olamy
Date: Tue Jan 10 11:09:28 2012
New Revision: 1229505

URL: http://svn.apache.org/viewvc?rev=1229505&view=rev
Log:
add link to war/jar exec doc on the home page

Modified:
tomcat/maven-plugin/trunk/src/site/apt/executable-war-jar.apt.vm
tomcat/maven-plugin/trunk/src/site/apt/index.apt.vm

Modified: tomcat/maven-plugin/trunk/src/site/apt/executable-war-jar.apt.vm
URL: 
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/src/site/apt/executable-war-jar.apt.vm?rev=1229505&r1=1229504&r2=1229505&view=diff
==
--- tomcat/maven-plugin/trunk/src/site/apt/executable-war-jar.apt.vm (original)
+++ tomcat/maven-plugin/trunk/src/site/apt/executable-war-jar.apt.vm Tue Jan 10 
11:09:28 2012
@@ -3,7 +3,7 @@
  ---
  Olivier Lamy
  ---
- October 17, 2011
+ 2011-01-10
  ---
  
  ~~ Licensed to the Apache Software Foundation (ASF) under one
@@ -26,7 +26,7 @@
  ~~ NOTE: For help with the syntax of this file, see:
  ~~ http://maven.apache.org/doxia/references/apt-format.html 
 
-Build a Executable War
+Build an Executable War/Jar
 
  Since version 2.0 you can now build an executable war/jar with an embedded 
Apache Tomcat7.
 

Modified: tomcat/maven-plugin/trunk/src/site/apt/index.apt.vm
URL: 
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/src/site/apt/index.apt.vm?rev=1229505&r1=1229504&r2=1229505&view=diff
==
--- tomcat/maven-plugin/trunk/src/site/apt/index.apt.vm (original)
+++ tomcat/maven-plugin/trunk/src/site/apt/index.apt.vm Tue Jan 10 11:09:28 2012
@@ -3,7 +3,7 @@
  ---
  Oliver Lamy
  ---
- 2011-10-08
+ 2011-01-10
  ---
 
  ~~ Licensed to the Apache Software Foundation (ASF) under one
@@ -67,10 +67,13 @@ Apache Tomcat Maven Plugin
 
 * Goals Overview
 
-  The goals for this plugin come in two categories:
 
   * {{{./context-goals.html}Goals to manipulate deployed projects within 
Tomcat}}
 
   * {{{./container-goals.html}Goals to obtain information from Tomcat}}
 
+  * {{{./executable-war-jar.html}Build an Executable War/Jar}}
+
+  []
+
 



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



svn commit: r1229506 - /tomcat/maven-plugin/trunk/pom.xml

2012-01-10 Thread olamy
Author: olamy
Date: Tue Jan 10 11:09:37 2012
New Revision: 1229506

URL: http://svn.apache.org/viewvc?rev=1229506&view=rev
Log:
remove not needed repository

Modified:
tomcat/maven-plugin/trunk/pom.xml

Modified: tomcat/maven-plugin/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/pom.xml?rev=1229506&r1=1229505&r2=1229506&view=diff
==
--- tomcat/maven-plugin/trunk/pom.xml (original)
+++ tomcat/maven-plugin/trunk/pom.xml Tue Jan 10 11:09:37 2012
@@ -723,17 +723,4 @@
 
   
 
-  
-
-  people.apache.snapshots
-  http://people.apache.org/repo/m2-snapshot-repository
-  
-false
-  
-  
-true
-  
-
-  
-
 



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



svn commit: r1229507 - /tomcat/maven-plugin/trunk/src/site/apt/index.apt.vm

2012-01-10 Thread olamy
Author: olamy
Date: Tue Jan 10 11:09:48 2012
New Revision: 1229507

URL: http://svn.apache.org/viewvc?rev=1229507&view=rev
Log:
add link to generated jira changelog from home page

Modified:
tomcat/maven-plugin/trunk/src/site/apt/index.apt.vm

Modified: tomcat/maven-plugin/trunk/src/site/apt/index.apt.vm
URL: 
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/src/site/apt/index.apt.vm?rev=1229507&r1=1229506&r2=1229507&view=diff
==
--- tomcat/maven-plugin/trunk/src/site/apt/index.apt.vm (original)
+++ tomcat/maven-plugin/trunk/src/site/apt/index.apt.vm Tue Jan 10 11:09:48 2012
@@ -29,13 +29,24 @@
 Apache Tomcat Maven Plugin
 
   This is the new home for the Tomcat Maven Plugin (previously hosted at 
Codehaus).
-  The version 2.0 which will support Tomcat 7 is under development.
+
+  The version ${project.version} have the following new features:
+
+  * Apache Tomcat7 support
+
+  * {{{./executable-war-jar.html}Build an Executable War/Jar}}
+
+  []
+
+  More details in {{{./jira-report.html}Generated changelog from issue 
tracker}}.
 
   The Tomcat Maven Plugin provides goals to manipulate WAR projects within the 
{{{http://tomcat.apache.org/}Apache Tomcat}} servlet container.
 
-  Since version 2.0 tomcat mojos has been renamed to tomcat6 and tomcat7 with 
the same goals.
+* groupId and Mojo name change
+
+  Since version 2.0-beta-1 tomcat mojos has been renamed to tomcat6 and 
tomcat7 with the same goals.
 
-  You must configure your pom to use this new groupId
+  You must configure your pom to use this new groupId:
 
 +--
 



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



svn commit: r1229508 - /tomcat/maven-plugin/trunk/src/site/apt/index.apt.vm

2012-01-10 Thread olamy
Author: olamy
Date: Tue Jan 10 11:10:01 2012
New Revision: 1229508

URL: http://svn.apache.org/viewvc?rev=1229508&view=rev
Log:
add note on limitations for mojo not available with tomcat7 plugin

Modified:
tomcat/maven-plugin/trunk/src/site/apt/index.apt.vm

Modified: tomcat/maven-plugin/trunk/src/site/apt/index.apt.vm
URL: 
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/src/site/apt/index.apt.vm?rev=1229508&r1=1229507&r2=1229508&view=diff
==
--- tomcat/maven-plugin/trunk/src/site/apt/index.apt.vm (original)
+++ tomcat/maven-plugin/trunk/src/site/apt/index.apt.vm Tue Jan 10 11:10:01 2012
@@ -87,4 +87,11 @@ Apache Tomcat Maven Plugin
 
   []
 
+* Know limitations
+
+  Some goals are not yet available in tomcat7 mojo. Those 
{{{./container-goals.html}contains goals}} are available with
+  the tomcat6 mojo, you only need to update the manager url in your pom.
+
+   Use <<>> rather than the default 
tomcat6 url.
+
 



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



svn commit: r1229509 - in /tomcat/maven-plugin/trunk/src/site/apt: container-goals.apt context-goals.apt

2012-01-10 Thread olamy
Author: olamy
Date: Tue Jan 10 11:10:10 2012
New Revision: 1229509

URL: http://svn.apache.org/viewvc?rev=1229509&view=rev
Log:
update doc with mojo available in 6 or/and 7

Modified:
tomcat/maven-plugin/trunk/src/site/apt/container-goals.apt
tomcat/maven-plugin/trunk/src/site/apt/context-goals.apt

Modified: tomcat/maven-plugin/trunk/src/site/apt/container-goals.apt
URL: 
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/src/site/apt/container-goals.apt?rev=1229509&r1=1229508&r2=1229509&view=diff
==
--- tomcat/maven-plugin/trunk/src/site/apt/container-goals.apt (original)
+++ tomcat/maven-plugin/trunk/src/site/apt/container-goals.apt Tue Jan 10 
11:10:10 2012
@@ -4,7 +4,7 @@
  Mark Hobson
  
  ---
- November 21, 2005
+ 2011-01-10
  ---
 
  ~~ Licensed to the Apache Software Foundation (ASF) under one
@@ -49,7 +49,7 @@ Container Goals
  To list all the currently deployed applications in Tomcat you can type:
 
 +--
-mvn tomcat:list
+mvn tomcat6:list
 +--
 
 * {Listing server information}
@@ -58,7 +58,7 @@ mvn tomcat:list
  type:
 
 +--
-mvn tomcat:info
+mvn tomcat6:info
 +--
 
 * {Listing JNDI resources}
@@ -66,13 +66,13 @@ mvn tomcat:info
  To list all the JNDI resources available within Tomcat you can type:
 
 +--
-mvn tomcat:resources
+mvn tomcat6:resources
 +--
 
  Alternatively, to only list JNDI resources of a specific type you can type:
 
 +--
-mvn -Dmaven.tomcat.type=my.class.name tomcat:resources
+mvn -Dmaven.tomcat.type=my.class.name tomcat6:resources
 +--
 
 * {Listing security roles}
@@ -80,5 +80,5 @@ mvn -Dmaven.tomcat.type=my.class.name to
  To list the available security roles available within Tomcat you can type:
 
 +--
-mvn tomcat:roles
+mvn tomcat6:roles
 +--

Modified: tomcat/maven-plugin/trunk/src/site/apt/context-goals.apt
URL: 
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/src/site/apt/context-goals.apt?rev=1229509&r1=1229508&r2=1229509&view=diff
==
--- tomcat/maven-plugin/trunk/src/site/apt/context-goals.apt (original)
+++ tomcat/maven-plugin/trunk/src/site/apt/context-goals.apt Tue Jan 10 
11:10:10 2012
@@ -4,7 +4,7 @@
  Mark Hobson
  
  ---
- November 21, 2005
+ 2011-01-10
  ---
 
  ~~ Licensed to the Apache Software Foundation (ASF) under one
@@ -53,25 +53,25 @@ Context Goals
  * To redeploy a WAR project deployed by <<>> you can type:
 
 +--
-mvn package tomcat:redeploy
+mvn package tomcat6/7:redeploy
 +--
 
  * To redeploy a WAR project deployed by <<>> you can type:
 
 +--
-mvn war:exploded tomcat:redeploy
+mvn war:exploded tomcat6/7:redeploy
 +--
 
  * To redeploy a WAR project deployed by <<>> you can type:
 
 +--
-mvn war:inplace tomcat:redeploy
+mvn war:inplace tomcat6/7:redeploy
 +--
 
  * To redeploy a context.xml file deployed by <<>> you can type:
 
 +--
-mvn tomcat:redeploy
+mvn tomcat6/7:redeploy
 +--
 
  <> Depending on the <<>> specified in the <<>> 
you
@@ -82,7 +82,7 @@ mvn tomcat:redeploy
  To undeploy a WAR from Tomcat you can type:
 
 +--
-mvn tomcat:undeploy
+mvn tomcat6/7:undeploy
 +--
 
 * {Starting a WAR project}
@@ -90,7 +90,7 @@ mvn tomcat:undeploy
  To start a WAR in Tomcat you can type:
 
 +--
-mvn tomcat:start
+mvn tomcat6:start
 +--
 
 * {Stopping a WAR project}
@@ -98,7 +98,7 @@ mvn tomcat:start
  To stop a WAR in Tomcat you can type:
 
 +--
-mvn tomcat:stop
+mvn tomcat6:stop
 +--
 
 * {Listing session statistics}
@@ -106,5 +106,5 @@ mvn tomcat:stop
  To list the session statistics for a deployed WAR project you can type:
 
 +--
-mvn tomcat:sessions
+mvn tomcat6:sessions
 +--



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



Re: More Caching for WebappClassLoader?

2012-01-10 Thread Mark Thomas
On 10/01/2012 10:43, Rainer Jung wrote:
> I wonder whether we want to improve caching in the WebappLoader. Of
> course most deployments no longer use shared or common to share many
> application classes, but it is still a supported feature and for some
> classes like JDBC it is standard.

I think at least providing the option to do so would be a good idea.

> What we could do to keep the design simple is caching any positive
> result from loadClass() in the WebappLoader, even it it was found via
> super, system or parent. In addition we could also cache negative
> results for all those. The biggest downsides I can see would be
> 
> - less dynamics: if someone had a more dynamic loader unerneath ours,
> which would change the result of loadClass() during runtime, we would
> shield the app from it, because we now return classes from our cache.
> 
> - increased memory use for the cache, i.e. the list of class names and
> references to the classes.
> 
> To stay completely compatible I think the feature should not be default,
> at least until TC 7, maybe switch default for 8.
> 
> What do you think? Does it make sense? Should I prepare a patch for trunk?

This makes sense for this specific use case. I'd lean towards making
this disabled by default since the benefits only kick in for a less used
use case but the disadvantages apply in all cases.

Mark

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



DO NOT REPLY [Bug 52328] Massive garbage production observed when using the response writer

2012-01-10 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=52328

--- Comment #4 from Konstantin Kolinko  2012-01-10 
11:21:03 UTC ---
(In reply to comment #3)
> the most efficient way to fix this is to remove the
> calls to conv.flush() after every write. The C2BConvertor already has a 
> buffer,
> so lets use it.

Interesting, but maybe cut 7.0.24 first? The change sounds risky so it will
need some time to review.

I do not see what flush() calls you are talking about. Maybe that will be more
clear from the patch.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

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



Re: Release 2.0-beta-1 of Tomcat Maven Plugin

2012-01-10 Thread Konstantin Kolinko
2012/1/5 Olivier Lamy :
> Hello,
> I'd like to release a first version of Tomcat Maven Plugin.
> As it's the first version here and some features have been added, this
> version will be called 2.0-beta-1.
>
> I will do that early next week.
>
> Let me know if you have any comments.
>

1. IIRC you had plans to reintroduce common "tomcat" plugin.

Are you going to go with separate "tomcat6" and "tomcat7" for now?


2. Reviewing some of your commits I noted that one of classes there uses
System.exit() calls. [1]

Is that OK? IMHO throwing some exception or an Error is a lot better
that using that call.

Some time ago Tomcat was also using System.exit() during shutdown, but
when it was noted that it caused problems with Commons Daemon and it
was changed to never call that method.

For a joke, someone mentioned [2] recently.

[1] 
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7Runner.java?view=markup

[2] http://thedailywtf.com/Articles/Serious-Failure.aspx

Best regards,
Konstantin Kolinko

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



Re: Release 2.0-beta-1 of Tomcat Maven Plugin

2012-01-10 Thread Olivier Lamy
Hello,

2012/1/10 Konstantin Kolinko :
> 2012/1/5 Olivier Lamy :
>> Hello,
>> I'd like to release a first version of Tomcat Maven Plugin.
>> As it's the first version here and some features have been added, this
>> version will be called 2.0-beta-1.
>>
>> I will do that early next week.
>>
>> Let me know if you have any comments.
>>
>
> 1. IIRC you had plans to reintroduce common "tomcat" plugin.
>
> Are you going to go with separate "tomcat6" and "tomcat7" for now?
For goals which run embeded tomcat, I don't really have choice as api
has changed between 6 and 7.
Maybe for "common" goals (deploy war, list applications etc..) has the
only change is the manager url.
Can be done in next release IMHO, I have documented the fact that some
goals exists only in tomcat6 plugin and users need only to change
manager url in their configuration.
>
>
> 2. Reviewing some of your commits I noted that one of classes there uses
> System.exit() calls. [1]
> Is that OK? IMHO throwing some exception or an Error is a lot better
> that using that call.
Agree I will change that.
>
> Some time ago Tomcat was also using System.exit() during shutdown, but
> when it was noted that it caused problems with Commons Daemon and it
> was changed to never call that method.
>
> For a joke, someone mentioned [2] recently.
>
> [1] 
> http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7Runner.java?view=markup
>
> [2] http://thedailywtf.com/Articles/Serious-Failure.aspx
>
> Best regards,
> Konstantin Kolinko
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>

Last thing I want to do: add an archetype to have a sample project
generated on how to use/configure the plugin to use it with a very
simple webapp.
And finish to cleanup documentation. (do not hesitate to fix
"frenglish" typo if you see some :-) ).


Thanks!
-- 
Olivier Lamy
Talend: http://coders.talend.com
http://twitter.com/olamy | http://linkedin.com/in/olamy

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



svn commit: r1229529 - /tomcat/maven-plugin/trunk/src/site/site.xml

2012-01-10 Thread olamy
Author: olamy
Date: Tue Jan 10 13:26:41 2012
New Revision: 1229529

URL: http://svn.apache.org/viewvc?rev=1229529&view=rev
Log:
fix trademark footer

Modified:
tomcat/maven-plugin/trunk/src/site/site.xml

Modified: tomcat/maven-plugin/trunk/src/site/site.xml
URL: 
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/src/site/site.xml?rev=1229529&r1=1229528&r2=1229529&view=diff
==
--- tomcat/maven-plugin/trunk/src/site/site.xml (original)
+++ tomcat/maven-plugin/trunk/src/site/site.xml Tue Jan 10 13:26:41 2012
@@ -49,6 +49,7 @@
   
   
   
+  
   
   
 
@@ -63,14 +64,12 @@
   http://www.apache.org/foundation/sponsorship.html"/>
   http://www.apache.org/foundation/thanks.html"/>
 
-  
 
-  
 
-  
-  Apache Tomcat, Tomcat, Apache, the Apache feather logo, and the Apache 
Tomcat project logo are trademarks of The Apache Software Foundation.
-  All other marks mentioned may be trademarks or registered trademarks of 
their respective owners.
+  
+Apache Tomcat, Tomcat, Apache, the Apache feather, and the Apache 
Tomcat project logo are trademarks of the Apache Software Foundation.
 
-  
+
+  
 
 



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



svn commit: r1229530 - /tomcat/maven-plugin/trunk/README.txt

2012-01-10 Thread olamy
Author: olamy
Date: Tue Jan 10 13:26:49 2012
New Revision: 1229530

URL: http://svn.apache.org/viewvc?rev=1229530&view=rev
Log:
fix README regarding SNAPSHOT deployment and section on site deploy

Modified:
tomcat/maven-plugin/trunk/README.txt

Modified: tomcat/maven-plugin/trunk/README.txt
URL: 
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/README.txt?rev=1229530&r1=1229529&r2=1229530&view=diff
==
--- tomcat/maven-plugin/trunk/README.txt (original)
+++ tomcat/maven-plugin/trunk/README.txt Tue Jan 10 13:26:49 2012
@@ -2,7 +2,7 @@ to build this project you must Apache Ma
 mvn clean install will install the mojos without running integration tests.
 As there are some hardcoded integration tests with http port 1973, ajp 2001 
and 2008, you could have some port allocation issues (if you don't know why 
those values ask olamy :-) )
 mvn clean install -Prun-its will run integration tests too: to override the 
default used htpp port you can use -Dits.http.port= -Dits.ajp.port=
-To deploy a snaphot version to 
http://people.apache.org/repo/m2-snapshot-repository/ (which is proxying by 
https://repository.apache.org/content/groups/snapshots-group/) you must run : 
mvn clean deploy .
+To deploy a snaphot version to 
https://repository.apache.org/content/repositories/snapshots/, you must run : 
mvn clean deploy .
 Note you need some configuration in ~/.m2/settings.xml:
 
   apache.snapshots
@@ -14,6 +14,13 @@ Note you need some configuration in ~/.m
   775
 https://builds.apache.org/job/TomcatMavenPlugin-mvn3.x/.
+So no real to deploy manually, just commit and Jenkins will do the job for you.
+
 If you have a nice ssh key in ~/.ssh/ no need of configuring password, 
privateKey, passphrase.
 
 Checkstyle: this project use the Apache Maven checkstyle configuration for ide 
codestyle files see 
http://maven.apache.org/developers/committer-environment.html .
+
+Site: to test site generation, just run: mvn site. If you want more reporting 
(javadoc, pmd, checkstyle, jxr, changelog from jira entries), use: mvn site 
-Preporting.
+
+To deploy site, use: mvn clean site-deploy -Preporting. The site will be 
deploy to http://tomcat.apache.org/maven-plugin-${project.version}



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



svn commit: r1229531 - /tomcat/maven-plugin/trunk/tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7Runner.java

2012-01-10 Thread olamy
Author: olamy
Date: Tue Jan 10 13:27:01 2012
New Revision: 1229531

URL: http://svn.apache.org/viewvc?rev=1229531&view=rev
Log:
remove System.exit

Modified:

tomcat/maven-plugin/trunk/tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7Runner.java

Modified: 
tomcat/maven-plugin/trunk/tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7Runner.java
URL: 
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7Runner.java?rev=1229531&r1=1229530&r2=1229531&view=diff
==
--- 
tomcat/maven-plugin/trunk/tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7Runner.java
 (original)
+++ 
tomcat/maven-plugin/trunk/tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7Runner.java
 Tue Jan 10 13:27:01 2012
@@ -313,8 +313,6 @@ public class Tomcat7Runner
 return null;
 }
 
-//protected WebappLoader createWebappLoader()
-
 private void waitIndefinitely()
 {
 Object lock = new Object();
@@ -327,7 +325,8 @@ public class Tomcat7Runner
 }
 catch ( InterruptedException exception )
 {
-System.exit( 1 );
+throw new Error( "InterruptedException on wait Indefinitely 
lock:" + exception.getMessage(),
+ exception );
 }
 }
 }
@@ -359,8 +358,7 @@ public class Tomcat7Runner
 boolean created = this.extractDirectoryFile.mkdirs();
 if ( !created )
 {
-System.out.println( "FATAL: impossible to create directory:" + 
this.extractDirectoryFile.getPath() );
-System.exit( 1 );
+throw new Exception( "FATAL: impossible to create directory:" 
+ this.extractDirectoryFile.getPath() );
 }
 }
 
@@ -368,9 +366,9 @@ public class Tomcat7Runner
 boolean created = new File( extractDirectory, "webapps" ).mkdirs();
 if ( !created )
 {
-System.out.println(
+throw new Exception(
 "FATAL: impossible to create directory:" + 
this.extractDirectoryFile.getPath() + "/webapps" );
-System.exit( 1 );
+
 }
 
 String wars = runtimeProperties.getProperty( WARS_KEY );



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



svn commit: r1229532 - in /tomcat/maven-plugin/trunk/src/site/apt: index.apt.vm run-mojo-features.apt.vm

2012-01-10 Thread olamy
Author: olamy
Date: Tue Jan 10 13:27:11 2012
New Revision: 1229532

URL: http://svn.apache.org/viewvc?rev=1229532&view=rev
Log:
documentation on run mojo

Added:
tomcat/maven-plugin/trunk/src/site/apt/run-mojo-features.apt.vm   (with 
props)
Modified:
tomcat/maven-plugin/trunk/src/site/apt/index.apt.vm

Modified: tomcat/maven-plugin/trunk/src/site/apt/index.apt.vm
URL: 
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/src/site/apt/index.apt.vm?rev=1229532&r1=1229531&r2=1229532&view=diff
==
--- tomcat/maven-plugin/trunk/src/site/apt/index.apt.vm (original)
+++ tomcat/maven-plugin/trunk/src/site/apt/index.apt.vm Tue Jan 10 13:27:11 2012
@@ -42,6 +42,9 @@ Apache Tomcat Maven Plugin
 
   The Tomcat Maven Plugin provides goals to manipulate WAR projects within the 
{{{http://tomcat.apache.org/}Apache Tomcat}} servlet container.
 
+  Or to run your war project in an embeded Apache Tomcat. The run goal give 
you the opportunity to develop quickly your application without any
+  huge install to do manually. More details and features: 
{{{./run-mojo-features.html}see documentation}}.
+
 * groupId and Mojo name change
 
   Since version 2.0-beta-1 tomcat mojos has been renamed to tomcat6 and 
tomcat7 with the same goals.
@@ -89,9 +92,9 @@ Apache Tomcat Maven Plugin
 
 * Know limitations
 
-  Some goals are not yet available in tomcat7 mojo. Those 
{{{./container-goals.html}contains goals}} are available with
+  Some goals are not yet available in tomcat7 mojo. Those 
{{{./container-goals.html}container goals}} are available with
   the tomcat6 mojo, you only need to update the manager url in your pom.
 
-   Use <<>> rather than the default 
tomcat6 url.
+  Use <<>> rather than the default tomcat6 
url.
 
 

Added: tomcat/maven-plugin/trunk/src/site/apt/run-mojo-features.apt.vm
URL: 
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/src/site/apt/run-mojo-features.apt.vm?rev=1229532&view=auto
==
--- tomcat/maven-plugin/trunk/src/site/apt/run-mojo-features.apt.vm (added)
+++ tomcat/maven-plugin/trunk/src/site/apt/run-mojo-features.apt.vm Tue Jan 10 
13:27:11 2012
@@ -0,0 +1,142 @@
+ ---
+ Run Mojo
+ ---
+ Oliver Lamy
+ ---
+ 2011-01-10
+ ---
+
+ ~~ 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.
+
+ ~~ NOTE: For help with the syntax of this file, see:
+ ~~ http://maven.apache.org/doxia/references/apt-format.html
+
+Run Mojo: run your Maven war project quickly !
+
+  When developping a war project, you usually build your war and deploy it to 
an installed Tomcat instance.
+  This is time and resources consuming and take time to install locally the 
instance.
+
+  The run mojo give you the opportunity to save that by simply running your 
war inside an embeded Tomcat instance in your Maven build.
+
+  <<>> If you have a multi module Maven projects and use Maven3, you 
don't need to install all modules before use the run goal,
+  just use tomcat6/7:run from the root module and the plugin will auto detect 
build output directory from various modules and replace
+  dependencies with those directories in the webapp classloader.
+
+* Run an embeded Tomcat
+
+  Configure your pom with the plugin version (for other mojo parameters see 
each mojo documentation details).
+
+  And use: mvn tomcat6/7:run
+
++-
+  
+org.apache.tomcat.maven
+tomcat7-maven-plugin
+
+${project.version}
+
+  
+  9090
+  
+  /
+  
+  ${tomcatContextXml}
+  
+  
+
${project.build.directory}/appserver-base
+
${project.build.directory}/appserver-home
+
${project.build.directory}/appserver-base/logs
+${project.build.directory}
+  
+  
+  false
+  
+  
+
+  
+
+
+
+  
+org.apache.derby
+derby
+${derbyVersion}
+  
+  
+javax.mail
+mail
+1.4
+  
+
+  
+
++-
+
+* Maven project structure
+
++-
+  pom.xml  

svn commit: r1229533 - in /tomcat/trunk/java/org/apache/catalina: connector/Connector.java core/mbeans-descriptors.xml ha/session/mbeans-descriptors.xml realm/mbeans-descriptors.xml session/mbeans-des

2012-01-10 Thread rjung
Author: rjung
Date: Tue Jan 10 13:32:38 2012
New Revision: 1229533

URL: http://svn.apache.org/viewvc?rev=1229533&view=rev
Log:
Remove some stale MBean attribute descriptions:
- compilerClasspath
- eventProvider
- mappingObject
- randomFile
- randomFileCurrent
- saveConfig
- staticResources
- statisticsProvider

Add is="true" to useContextClassLoader.

Remove attribute mapping from "randomFile" to "randomfile"
in Connector.

Modified:
tomcat/trunk/java/org/apache/catalina/connector/Connector.java
tomcat/trunk/java/org/apache/catalina/core/mbeans-descriptors.xml
tomcat/trunk/java/org/apache/catalina/ha/session/mbeans-descriptors.xml
tomcat/trunk/java/org/apache/catalina/realm/mbeans-descriptors.xml
tomcat/trunk/java/org/apache/catalina/session/mbeans-descriptors.xml

Modified: tomcat/trunk/java/org/apache/catalina/connector/Connector.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Connector.java?rev=1229533&r1=1229532&r2=1229533&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/connector/Connector.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Connector.java Tue Jan 10 
13:32:38 2012
@@ -250,7 +250,6 @@ public class Connector extends Lifecycle
  replacements.put("acceptCount", "backlog");
  replacements.put("connectionLinger", "soLinger");
  replacements.put("connectionTimeout", "soTimeout");
- replacements.put("randomFile", "randomfile");
  replacements.put("rootFile", "rootfile");
  }
 

Modified: tomcat/trunk/java/org/apache/catalina/core/mbeans-descriptors.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/mbeans-descriptors.xml?rev=1229533&r1=1229532&r2=1229533&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/core/mbeans-descriptors.xml (original)
+++ tomcat/trunk/java/org/apache/catalina/core/mbeans-descriptors.xml Tue Jan 
10 13:32:38 2012
@@ -137,10 +137,6 @@
description="Should we attempt to use cookies for session id 
communication?"
type="boolean"/>
 
-
-
 
@@ -179,12 +175,6 @@
type="java.lang.String"
writeable="false" />
 
-
-
 
@@ -217,10 +207,6 @@
description="Associated manager."
type="org.apache.catalina.Manager" />
 
-
-
 
@@ -281,11 +267,6 @@
description="Should Tomcat renew the threads of the thread pool 
when the application is stopped to avoid memory leaks because of uncleaned 
ThreadLocal variables."
type="boolean"/>
 
-
-
 
@@ -331,17 +312,6 @@
type="java.lang.String"
writeable="false"/>
 
-
-
-
-
 
@@ -1612,12 +1582,6 @@
type="int"
writeable="false" />
 
-
-
 
@@ -1681,12 +1645,6 @@
type="java.lang.String"
writeable="false"/>
 
-
-
 http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/session/mbeans-descriptors.xml?rev=1229533&r1=1229532&r2=1229533&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/ha/session/mbeans-descriptors.xml 
(original)
+++ tomcat/trunk/java/org/apache/catalina/ha/session/mbeans-descriptors.xml Tue 
Jan 10 13:32:38 2012
@@ -252,10 +252,6 @@
   description="Time spent doing housekeeping and expiration"
   type="long"/>
 
-
 
-

Modified: tomcat/trunk/java/org/apache/catalina/realm/mbeans-descriptors.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/realm/mbeans-descriptors.xml?rev=1229533&r1=1229532&r2=1229533&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/realm/mbeans-descriptors.xml 
(original)
+++ tomcat/trunk/java/org/apache/catalina/realm/mbeans-descriptors.xml Tue Jan 
10 13:32:38 2012
@@ -136,6 +136,7 @@
 
 
 
 http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/mbeans-descriptors.xml?rev=1229533&r1=1229532&r2=1229533&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/session/mbeans-descriptors.xml 
(original)
+++ tomcat/trunk/java/org/apache/catalina/session/mbeans-descriptors.xml Tue 
Jan 10 13:32:38 2012
@@ -128,15 +128,6 @@
  type="java.lang.String"
 writeable="false"/>
 
-
-
-
-
 
 
-
-
 

svn commit: r1229536 - in /tomcat/trunk/test/org/apache/catalina/mbeans: MBeanDumper.java TestRegistration.java

2012-01-10 Thread rjung
Author: rjung
Date: Tue Jan 10 13:37:25 2012
New Revision: 1229536

URL: http://svn.apache.org/viewvc?rev=1229536&view=rev
Log:
Add output of MBean details to TestRegistration
in case unexpected MBeans were found.

Added:
tomcat/trunk/test/org/apache/catalina/mbeans/MBeanDumper.java   (with props)
Modified:
tomcat/trunk/test/org/apache/catalina/mbeans/TestRegistration.java

Added: tomcat/trunk/test/org/apache/catalina/mbeans/MBeanDumper.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/mbeans/MBeanDumper.java?rev=1229536&view=auto
==
--- tomcat/trunk/test/org/apache/catalina/mbeans/MBeanDumper.java (added)
+++ tomcat/trunk/test/org/apache/catalina/mbeans/MBeanDumper.java Tue Jan 10 
13:37:25 2012
@@ -0,0 +1,163 @@
+/*
+ * 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.mbeans;
+
+import java.lang.reflect.Array;
+import java.util.Iterator;
+import java.util.Set;
+
+import javax.management.MBeanAttributeInfo;
+import javax.management.MBeanInfo;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.apache.juli.logging.Log;
+import org.apache.juli.logging.LogFactory;
+import org.apache.tomcat.util.ExceptionUtils;
+
+/**
+ * General helper to dump MBean contents to the log.
+ *
+ */
+public class MBeanDumper {
+
+private static Log log = LogFactory.getLog(MBeanDumper.class);
+
+/**
+ * The following code to dump MBeans has been copied from JMXProxyServlet.
+ *
+ */
+public static void listBeans(MBeanServer mbeanServer, Set 
names)
+{
+
+Iterator it=names.iterator();
+while( it.hasNext()) {
+ObjectName oname=it.next();
+log.info( "Name: " + oname.toString());
+
+try {
+MBeanInfo minfo=mbeanServer.getMBeanInfo(oname);
+// can't be null - I think
+String code=minfo.getClassName();
+if ("org.apache.commons.modeler.BaseModelMBean".equals(code)) {
+code=(String)mbeanServer.getAttribute(oname, 
"modelerType");
+}
+log.info("modelerType: " + code);
+
+MBeanAttributeInfo attrs[]=minfo.getAttributes();
+Object value=null;
+
+for( int i=0; i< attrs.length; i++ ) {
+if( ! attrs[i].isReadable() ) continue;
+String attName=attrs[i].getName();
+if( "modelerType".equals( attName)) continue;
+if( attName.indexOf( "=") >=0 ||
+attName.indexOf( ":") >=0 ||
+attName.indexOf( " ") >=0 ) {
+continue;
+}
+
+try {
+value=mbeanServer.getAttribute(oname, attName);
+} catch( Throwable t) {
+log.error("Error getting attribute " + oname +
+" " + attName + " " + t.toString(), t);
+continue;
+}
+if( value==null ) continue;
+String valueString;
+try {
+Class c = value.getClass();
+if (c.isArray()) {
+int len = Array.getLength(value);
+StringBuilder sb = new StringBuilder("Array[" +
+c.getComponentType().getName() + "] of 
length " + len);
+if (len > 0) {
+sb.append("\r\n");
+}
+for (int j = 0; j < len; j++) {
+sb.append("\t");
+Object item = Array.get(value, j);
+if (item == null) {
+sb.append("NULL VALUE");
+} else {
+try {
+sb.append(escape(item.toString()));
+}
+   

svn commit: r1229549 - in /tomcat/trunk: java/org/apache/catalina/manager/JMXProxyServlet.java java/org/apache/catalina/mbeans/MBeanDumper.java test/org/apache/catalina/mbeans/MBeanDumper.java test/or

2012-01-10 Thread rjung
Author: rjung
Date: Tue Jan 10 14:14:34 2012
New Revision: 1229549

URL: http://svn.apache.org/viewvc?rev=1229549&view=rev
Log:
Reduce code duplication introduced in r1229536:
Use common MBeanDumper class for JMXProxyServlet
and Mean unit tests.

Added:
tomcat/trunk/java/org/apache/catalina/mbeans/MBeanDumper.java
  - copied, changed from r1229536, 
tomcat/trunk/test/org/apache/catalina/mbeans/MBeanDumper.java
Removed:
tomcat/trunk/test/org/apache/catalina/mbeans/MBeanDumper.java
Modified:
tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java
tomcat/trunk/test/org/apache/catalina/mbeans/TestRegistration.java

Modified: tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java?rev=1229549&r1=1229548&r2=1229549&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java Tue Jan 
10 14:14:34 2012
@@ -21,13 +21,9 @@ package org.apache.catalina.manager;
 
 import java.io.IOException;
 import java.io.PrintWriter;
-import java.lang.reflect.Array;
-import java.util.Iterator;
 import java.util.Set;
 
 import javax.management.Attribute;
-import javax.management.MBeanAttributeInfo;
-import javax.management.MBeanInfo;
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
 import javax.servlet.ServletException;
@@ -35,7 +31,7 @@ import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.tomcat.util.ExceptionUtils;
+import org.apache.catalina.mbeans.MBeanDumper;
 import org.apache.tomcat.util.modeler.Registry;
 
 /**
@@ -119,7 +115,7 @@ public class JMXProxyServlet extends Htt
 ObjectName oname = new ObjectName(onameStr);
 Object value = mBeanServer.getAttribute(oname, att);
 writer.println("OK - Attribute get '" + onameStr + "' - " + att
-+ "= " + escape(value.toString()));
++ "= " + MBeanDumper.escape(value.toString()));
 } catch (Exception ex) {
 writer.println("Error - " + ex.toString());
 }
@@ -152,121 +148,8 @@ public class JMXProxyServlet extends Htt
 return;
 }
 
-Iterator it=names.iterator();
-while( it.hasNext()) {
-ObjectName oname=it.next();
-writer.println( "Name: " + oname.toString());
-
-try {
-MBeanInfo minfo=mBeanServer.getMBeanInfo(oname);
-// can't be null - I think
-String code=minfo.getClassName();
-if ("org.apache.commons.modeler.BaseModelMBean".equals(code)) {
-code=(String)mBeanServer.getAttribute(oname, 
"modelerType");
-}
-writer.println("modelerType: " + code);
-
-MBeanAttributeInfo attrs[]=minfo.getAttributes();
-Object value=null;
-
-for( int i=0; i< attrs.length; i++ ) {
-if( ! attrs[i].isReadable() ) continue;
-if( ! isSupported( attrs[i].getType() )) continue;
-String attName=attrs[i].getName();
-if( "modelerType".equals( attName)) continue;
-if( attName.indexOf( "=") >=0 ||
-attName.indexOf( ":") >=0 ||
-attName.indexOf( " ") >=0 ) {
-continue;
-}
-
-try {
-value=mBeanServer.getAttribute(oname, attName);
-} catch( Throwable t) {
-log("Error getting attribute " + oname +
-" " + attName + " " + t.toString());
-continue;
-}
-if( value==null ) continue;
-String valueString;
-try {
-Class c = value.getClass();
-if (c.isArray()) {
-int len = Array.getLength(value);
-StringBuilder sb = new StringBuilder("Array[" +
-c.getComponentType().getName() + "] of 
length " + len);
-if (len > 0) {
-sb.append("\r\n");
-}
-for (int j = 0; j < len; j++) {
-sb.append("\t");
-Object item = Array.get(value, j);
-if (item == null) {
-sb.append("NULL VALUE");
-} else {
-try {
-

svn commit: r1229558 - in /tomcat/tc7.0.x/trunk: java/org/apache/catalina/connector/ java/org/apache/catalina/ha/session/ java/org/apache/catalina/realm/ java/org/apache/catalina/session/ webapps/docs

2012-01-10 Thread rjung
Author: rjung
Date: Tue Jan 10 14:36:06 2012
New Revision: 1229558

URL: http://svn.apache.org/viewvc?rev=1229558&view=rev
Log:
Remove some stale attributes from MBeans
and set one attribute to is="true".

Backport of r1229533 from trunk as far as it applies.

Modified:
tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Connector.java

tomcat/tc7.0.x/trunk/java/org/apache/catalina/ha/session/mbeans-descriptors.xml
tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/mbeans-descriptors.xml
tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/mbeans-descriptors.xml
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Connector.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Connector.java?rev=1229558&r1=1229557&r2=1229558&view=diff
==
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Connector.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Connector.java Tue 
Jan 10 14:36:06 2012
@@ -257,7 +257,6 @@ public class Connector extends Lifecycle
  replacements.put("acceptCount", "backlog");
  replacements.put("connectionLinger", "soLinger");
  replacements.put("connectionTimeout", "soTimeout");
- replacements.put("randomFile", "randomfile");
  replacements.put("rootFile", "rootfile");
  }
 

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/ha/session/mbeans-descriptors.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/ha/session/mbeans-descriptors.xml?rev=1229558&r1=1229557&r2=1229558&view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/ha/session/mbeans-descriptors.xml 
(original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/ha/session/mbeans-descriptors.xml 
Tue Jan 10 14:36:06 2012
@@ -267,10 +267,6 @@
   description="Time spent doing housekeeping and expiration"
   type="long"/>
 
-
 
-

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/mbeans-descriptors.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/mbeans-descriptors.xml?rev=1229558&r1=1229557&r2=1229558&view=diff
==
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/mbeans-descriptors.xml 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/mbeans-descriptors.xml 
Tue Jan 10 14:36:06 2012
@@ -136,6 +136,7 @@
  
 
  type="boolean"/>
 
 http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/mbeans-descriptors.xml?rev=1229558&r1=1229557&r2=1229558&view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/mbeans-descriptors.xml 
(original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/mbeans-descriptors.xml 
Tue Jan 10 14:36:06 2012
@@ -128,15 +128,6 @@
  type="java.lang.String"
 writeable="false"/>
 
-
- 
-
- 
 
 
-
- 
 http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1229558&r1=1229557&r2=1229558&view=diff
==
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Tue Jan 10 14:36:06 2012
@@ -128,6 +128,9 @@
 Improve JMX names for objects related to Connectors that have the
 address attribute set. (markt)
   
+  
+Remove some stale attributes from MBeans. (rjung)
+  
 
   
   



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



svn commit: r1229561 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/manager/JMXProxyServlet.java java/org/apache/catalina/mbeans/MBeanDumper.java test/org/apache/catalina/mbeans/TestRegistrat

2012-01-10 Thread rjung
Author: rjung
Date: Tue Jan 10 14:42:38 2012
New Revision: 1229561

URL: http://svn.apache.org/viewvc?rev=1229561&view=rev
Log:
Move MBean dump code from JMXProxyServlet into
a utility class.

Use the new class to also dumps MBean info when
the TestRegistration unit test fails.

Backport of r1229536 and 1229549 from trunk.

Added:
tomcat/tc7.0.x/trunk/java/org/apache/catalina/mbeans/MBeanDumper.java
  - copied unchanged from r1229549, 
tomcat/trunk/java/org/apache/catalina/mbeans/MBeanDumper.java
Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/mbeans/TestRegistration.java
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc7.0.x/trunk/
--
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 10 14:42:38 2012
@@ -1 +1 @@
-/tomcat/trunk:1156115,1156171,1156276,1156304,1156519,1156530,1156602,1157015,1157018,1157151,1157198,1157204,1157810,1157832,1157834,1157847,1157908,1157939,1158155,1158160,1158176,1158195,1158198-1158199,1158227,1158331,1158334-1158335,1158426,1160347,1160592,1160611,1160619,1160626,1160639,1160652,1160720-1160721,1160772,1160774,1160776,1161303,1161310,1161322,1161339,1161486,1161540,1161549,1161584,1162082,1162149,1162169,1162721,1162769,1162836,1162932,1163630,1164419,1164438,1164469,1164480,1164567,1165234,1165247-1165248,1165253,1165273,1165282,1165309,1165331,1165338,1165347,1165360-1165361,1165367-1165368,1165602,1165608,1165677,1165693,1165721,1165723,1165728,1165730,1165738,1165746,1165765,1165777,1165918,1165921,1166077,1166150-1166151,1166290,1166366,1166620,1166686,1166693,1166752,1166757,1167368,1167394,1169447,1170647,1171692,1172233-1172234,1172236,1172269,1172278,1172282,1172556,1172610,1172664,1172689,1172711,1173020-1173021,1173082,1173088,1173090,1173096
 
,1173241,1173256,1173288,117,1173342,1173461,1173614,1173630,1173659,1173722,1174061,1174239,1174322,1174325,1174329-1174330,1174337-1174339,1174343,1174353,1174799,1174882,1174884,1174975,1174983,1175155,1175158,1175167,1175182,1175190,1175201,1175272,1175275,1175283,1175582,1175589-1175590,1175594,1175602,1175613,1175633,1175690,1175713,1175798,1175889,1175896,1175907,1176584,1176590,1176799,1177050,1177060,1177125,1177152,1177160,1177245,1177850,1177862,1177978,1178209,1178228,1178233,1178449,1178542,1178681,1178684,1178721,1179268,1179274,1180261,1180865,1180891,1180894,1180907,1181028,1181123,1181125,1181136,1181291,1181743,1182796,1183078,1183105,1183142,1183328,1183339-1183340,1183492-1183494,1183605,1184917,1184919,1185018,1185020,1185200,1185588,1185626,1185756,1185758,1186011,1186042-1186045,1186104,1186123,1186137,1186153,1186254,1186257,1186377-1186379,1186479-1186480,1186712,1186743,1186750,1186763,1186890-1186892,1186894,1186949,1187018,1187027-1187028,1187
 
381,1187753,1187755,1187775,1187801,1187806,1187809,1187827,1188301,1188303-1188305,1188399,1188822,1188930-1188931,1189116,1189129,1189183,1189240,1189256,1189386,1189413-1189414,1189477,1189685,1189805,1189857,1189864,1189882,1190034,1190185,1190279,1190339,1190371,1190388-1190389,1190474,1190481,1194915,1195222-1195223,1195531,1195899,1195905,1195943,1195949,1195953,1195955,1195965,1195968,1196175,1196212,1196223,1196304-1196305,1196735,1196825,1196827,1197158,1197261,1197263,1197299-1197300,1197305,1197339-1197340,1197343,1197382,1197386-1197387,1197480,1197578,1198497,1198528,1198552,1198602,1198604,1198607,1198622,1198640,1198696,1198707,1199418,1199432,1199436,1199513,1199529,1199980,116,1200056,1200089,1200106-1200107,1200263,1200316,1200320,1200398-1200399,1200445-1200446,1200555,1200627,1200696,1200725,1200937,1200941,1201069,1201087,1201180,1201235-1201237,1201508,1201521,1201542,1201545-1201546,1201548,1201555-1201556,1201568,1201576,1201608,1201921-1201922,1
 
201931,1202035,1202039,1202271,1202565,1202578,1202705,1202828,1202860,1203047-1203052,1203078,1203091,1203253,1203278,1204182,1204856,1204867,1204936,1204938,1204982,1205033,1205065,1205082,1205097,1205112,1206200,1207692,1208046,1208073,1208096,1208114,1208145,1208772,1209194,1209277-1209278,1209686-1209731,1210894,1212091,1212095,1212099,1212118,1213469,1213906,1214853,1214855,1214864,1215115,1215118-1215119,1215121,1220293,1220295,1221038,1221842,1222189,101,176,1222300,1222690,1222850,1222852,1222855,1224607,1224617,1224648-1224652,1224657,1224662-1224663,1224682,1224801,1224910,1225000,1225219,1225343,1225465,1225627,1225629,1225634,1226069,1226158-1226159,1226177,1226196,1226214-1226215,1226385,1226394,1226500,1226537-1226538,1226546,1226551,1226975,1228196,1228360,1228376,1228724,1228908,1228918,1228920,1228922,1228929,1228969,1229307
+/tomcat/trunk:1156115,1156171,1156276,1156304,1156519,1156530,1156602,1157015,1157018,1157151,1157198,1157204,1157810,1157832,1157834,1157847,1157908,1157939,1158155,1158160,1158176,1158

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

2012-01-10 Thread Rainer Jung

On 10.01.2012 11:57, Konstantin Kolinko wrote:

2012/1/10 Rainer Jung:

On 10.01.2012 05:27, Konstantin Kolinko wrote:


2012/1/10 Konstantin Kolinko:


2012/1/9 Konstantin Kolinko:


2012/1/7 Rainer Jung:



Maybe enable the accesslog during testing with test.accesslog=true,
so one
can check after the next failure whether the contents agree with your
assumption. Not sure, whether Gump offers access to the access log
for
checking.





I updated Gump configuration for tc7 and trunk enabling the access
log. We will see how it goes with next run.



So Gump runs with access logs. Look for "access_log.-mm-dd" in the
list of files.

(...)



Last run of tomcat-tc7.0.x-test failed with
org.apache.catalina.mbeans.TestRegistration.BIO.txt:
[[[
Testcase: testMBeanDeregistration took 1.756 sec
FAILED
Remaining:
[Tomcat:type=RequestProcessor,worker="http-bio-127.0.0.1-auto-1",name=HttpRequest1]
expected:<0>but was:<1>
junit.framework.AssertionFailedError: Remaining:

[Tomcat:type=RequestProcessor,worker="http-bio-127.0.0.1-auto-1",name=HttpRequest1]
expected:<0>but was:<1>
at
org.apache.catalina.mbeans.TestRegistration.testMBeanDeregistration(TestRegistration.java:209)
]]]



I let the TC 7 tests run in a loop now locally, with a subset of the tests
(o.a.c.comet, ..., o.a.c.startup) and try to reproduce, no luck yet.

I added a local patch, which logs the MBean attributes, if any unexpected
MBeans are found. That would only give some indication for the above case,
if the request was still being processed. I took the code (about 150 lines)
mostly unchanged from the JMXProxySerlvet. If you want I could apply to
TestRegistration.java in trunk.


Yes, I think that is worth adding.


Done, I factored out a common dump class for MBeans, that's now used by 
JMXProxyServlet and TestRegistration. Format is the same, that 
JMXProxyServlet produced (code mostly unchanged).



2. The testMBeanDeregistration() method starts with

 Set  onames = mbeanServer.queryNames(new
ObjectName("Catalina:*"), null);
 assertEquals("Remaining: " + onames, 0, onames.size());

I think the same check could be done with "Tomcat:*" names.


Added.


The "TestRegistration.java:209" line where the assert was triggered is
near the end of testMBeanDeregistration() method, so all of the method
before that line did run fine.

(From reading the code I think that the checks in the middle of
testMBeanDeregistration() method would have detected unexpected beans
if those were present before the test and logged them, but adding
explicit check should not hurt.)


Agreed.

One observation, unrelated to the failure we were discussion above: if I 
dump all MBeans out of curiousity in the middle of TestRegistration, 
then I get a reproducible failure at the end:


[junit] 10-Jan-2012 15:44:24.286 INFO [main] 
org.apache.catalina.mbeans.TestRegistration.testMBeanDeregistration
[junit] 10-Jan-2012 15:44:24.290 INFO [main] 
org.apache.catalina.mbeans.TestRegistration.testMBeanDeregistration 
Name: Tomcat:type=Realm,realmPath=/realm0

[junit] modelerType: org.apache.tomcat.util.modeler.BaseModelMBean
[junit] appName: Tomcat
[junit] realmPath: /realm0
[junit] stateName: STOPPED
[junit] allRolesMode: strict
[junit] className: org.apache.catalina.realm.JAASRealm
[junit] useContextClassLoader: true
[junit] validate: true

It seems the MBean for that Realm is created somehow when I query the 
other MBeans and retrieve their arguments, although the JAASRealm itself 
logs


  JAASRealm.setContainer Set JAAS app name Tomcat

much earlier.

If I dump all MBeans twice, then in the second dump the Realm MBean is 
contained (not in the first dump):


Name: Tomcat:type=Realm,realmPath=/realm0
modelerType: org.apache.tomcat.util.modeler.BaseModelMBean
appName: Tomcat
realmPath: /realm0
stateName: STARTED
allRolesMode: strict
className: org.apache.catalina.realm.JAASRealm
useContextClassLoader: true
validate: true

But it seems it is never deresitered/destroyed during the test.

Thought you might be interested because of the "Re: problem using 
default Realm in new unit tests" discussion going on in parallel.


Regards,

Rainer

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



DO NOT REPLY [Bug 52328] Massive garbage production observed when using the response writer

2012-01-10 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=52328

--- Comment #5 from Mark Thomas  2012-01-10 16:16:22 UTC ---
Created attachment 28132
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28132
Initial ideas

My initial idea (attached) was quite simple. There isn't the buffering I
thought there was in the Converter so there is scope to add some buffering and
further improve performance.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

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



DO NOT REPLY [Bug 52328] Massive garbage production observed when using the response writer

2012-01-10 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=52328

--- Comment #6 from Mark Thomas  2012-01-10 16:19:31 UTC ---
Forgot to add the performance numbers for adding 100,000 single characters
through a Writer.
Before
129ms without wrapping the Writer in a BufferedWriter
 37ms with wrapping the Writer in a BufferedWriter

After
77ms without wrapping
28ms with wrapping

I'm still looking at the best place to insert a Buffer before the conversion.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

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



DO NOT REPLY [Bug 52328] Massive garbage production observed when using the response writer

2012-01-10 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=52328

--- Comment #7 from Mark Thomas  2012-01-10 18:00:37 UTC ---
If I insert a Buffer before the converter then the figures drop to:
20ms without wrapping
7ms with wrapping

Clearly the CoyoteWriter has some in-built overhead that adding a Buffer helps
with. I don't want to provide a Buffer inside CoyoteWriter as that adds more
complexity that I want to deal with right now.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

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



DO NOT REPLY [Bug 52328] Massive garbage production observed when using the response writer

2012-01-10 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=52328

--- Comment #8 from Mark Thomas  2012-01-10 19:30:56 UTC ---
That initial patch is no good. It triggers a bunch of unit test failures. I am
working on an improved patch now.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

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



svn commit: r1229724 - /tomcat/trunk/java/org/apache/tomcat/util/buf/C2BConverter.java

2012-01-10 Thread markt
Author: markt
Date: Tue Jan 10 20:54:50 2012
New Revision: 1229724

URL: http://svn.apache.org/viewvc?rev=1229724&view=rev
Log:
Whitespace and Javadoc fixes. No functional change.

Modified:
tomcat/trunk/java/org/apache/tomcat/util/buf/C2BConverter.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/buf/C2BConverter.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/buf/C2BConverter.java?rev=1229724&r1=1229723&r2=1229724&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/buf/C2BConverter.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/buf/C2BConverter.java Tue Jan 10 
20:54:50 2012
@@ -21,12 +21,12 @@ import java.io.OutputStream;
 import java.io.OutputStreamWriter;
 import java.nio.charset.Charset;
 
-/** Efficient conversion of character to bytes.
- *
- *  This uses the standard JDK mechanism - a writer - but provides mechanisms
- *  to recycle all the objects that are used. It is compatible with JDK1.1 and 
up,
- *  ( nio is better, but it's not available even in 1.2 or 1.3 )
+/**
+ * Efficient conversion of character to bytes.
  *
+ * This uses the standard JDK mechanism - a writer - but provides mechanisms to
+ * recycle all the objects that are used. It is compatible with JDK1.1 and up.
+ * (nio is better, but it's not available even in 1.2 or 1.3).
  */
 public final class C2BConverter {
 
@@ -37,74 +37,75 @@ public final class C2BConverter {
 /** Create a converter, with bytes going to a byte buffer
  */
 public C2BConverter(ByteChunk output, String encoding) throws IOException {
-this.bb=output;
-ios=new IntermediateOutputStream( output );
-conv=new WriteConvertor( ios, B2CConverter.getCharset(encoding));
+this.bb = output;
+ios = new IntermediateOutputStream(output);
+conv = new WriteConvertor(ios, B2CConverter.getCharset(encoding));
 }
 
-/** Reset the internal state, empty the buffers.
- *  The encoding remain in effect, the internal buffers remain allocated.
+/**
+ * Reset the internal state, empty the buffers.
+ * The encoding remain in effect, the internal buffers remain allocated.
  */
-public  final void recycle() {
+public final void recycle() {
 conv.recycle();
 bb.recycle();
 }
 
-/** Generate the bytes using the specified encoding
+/**
+ * Generate the bytes using the specified encoding.
  */
-public  final void convert(char c[], int off, int len ) throws IOException 
{
-conv.write( c, off, len );
+public final void convert(char c[], int off, int len) throws IOException {
+conv.write(c, off, len);
 }
 
-/** Generate the bytes using the specified encoding
+/**
+ * Generate the bytes using the specified encoding.
  */
-public  final void convert(String s, int off, int len ) throws IOException 
{
-conv.write( s, off, len );
+public final void convert(String s, int off, int len) throws IOException {
+conv.write(s, off, len);
 }
 
-/** Generate the bytes using the specified encoding
+/**
+ * Generate the bytes using the specified encoding.
  */
-public  final void convert(String s ) throws IOException {
-conv.write( s );
+public final void convert(String s) throws IOException {
+conv.write(s);
 }
 
-/** Generate the bytes using the specified encoding
+/**
+ * Generate the bytes using the specified encoding.
  */
-public  final void convert(char c ) throws IOException {
-conv.write( c );
+public final void convert(char c) throws IOException {
+conv.write(c);
 }
 
-/** Flush any internal buffers into the ByteOutput or the internal
- *  byte[]
+/**
+ * Flush any internal buffers into the ByteOutput or the internal byte[].
  */
-public  final void flushBuffer() throws IOException {
+public final void flushBuffer() throws IOException {
 conv.flush();
 }
 }
 
 //  Private implementation 
-
-
-
 /**
- *  Special writer class, where close() is overridden. The default 
implementation
- *  would set byteOutputter to null, and the writer can't be recycled.
- *
- *  Note that the flush method will empty the internal buffers _and_ call
- *  flush on the output stream - that's why we use an intermediary output 
stream
- *  that overrides flush(). The idea is to  have full control: flushing the
- *  char->byte converter should be independent of flushing the OutputStream.
- *
- *  When a WriteConverter is created, it'll allocate one or 2 byte buffers,
- *  with a 8k size that can't be changed ( at least in JDK1.1 -> 1.4 ). It 
would
- *  also allocate a ByteOutputter or equivalent - again some internal buffers.
- *
- *  It is essential to keep  this object around and reuse it. You can use 
either
- *  pools or

svn commit: r1229726 - /tomcat/trunk/java/org/apache/catalina/connector/OutputBuffer.java

2012-01-10 Thread markt
Author: markt
Date: Tue Jan 10 20:59:27 2012
New Revision: 1229726

URL: http://svn.apache.org/viewvc?rev=1229726&view=rev
Log:
First pass at a fix for BZ 52328

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

Modified: tomcat/trunk/java/org/apache/catalina/connector/OutputBuffer.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/OutputBuffer.java?rev=1229726&r1=1229725&r2=1229726&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/connector/OutputBuffer.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/OutputBuffer.java Tue Jan 
10 20:59:27 2012
@@ -303,6 +303,11 @@ public class OutputBuffer extends Writer
 return;
 }
 
+// Flush the convertor if one is in use
+if (gotEnc && conv != null) {
+conv.flushBuffer();
+}
+
 try {
 doFlush = true;
 if (initial) {
@@ -426,7 +431,6 @@ public class OutputBuffer extends Writer
 }
 
 conv.convert((char) c);
-conv.flushBuffer();
 charsWritten++;
 
 }
@@ -454,7 +458,6 @@ public class OutputBuffer extends Writer
 }
 
 conv.convert(c, off, len);
-conv.flushBuffer();
 charsWritten += len;
 
 }
@@ -476,8 +479,6 @@ public class OutputBuffer extends Writer
 s = "null";
 }
 conv.convert(s, off, len);
-conv.flushBuffer();
-
 }
 
 
@@ -493,8 +494,6 @@ public class OutputBuffer extends Writer
 s = "null";
 }
 conv.convert(s);
-conv.flushBuffer();
-
 }
 
 
@@ -579,14 +578,17 @@ public class OutputBuffer extends Writer
 
 
 public void reset() {
-
+// If a Writer wasbeing used, there may be unflushed bytes in the
+// convertor
+if (gotEnc && conv != null) {
+conv.recycle();
+}
 bb.recycle();
 bytesWritten = 0;
 charsWritten = 0;
 gotEnc = false;
 enc = null;
 initial = true;
-
 }
 
 



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



svn commit: r1229727 - /tomcat/trunk/java/org/apache/catalina/connector/OutputBuffer.java

2012-01-10 Thread markt
Author: markt
Date: Tue Jan 10 21:00:10 2012
New Revision: 1229727

URL: http://svn.apache.org/viewvc?rev=1229727&view=rev
Log:
Additional flush required.

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

Modified: tomcat/trunk/java/org/apache/catalina/connector/OutputBuffer.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/OutputBuffer.java?rev=1229727&r1=1229726&r2=1229727&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/connector/OutputBuffer.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/OutputBuffer.java Tue Jan 
10 21:00:10 2012
@@ -255,6 +255,11 @@ public class OutputBuffer extends Writer
 return;
 }
 
+// Flush the convertor if one is in use
+if (gotEnc && conv != null) {
+conv.flushBuffer();
+}
+
 if ((!coyoteResponse.isCommitted())
 && (coyoteResponse.getContentLengthLong() == -1)) {
 // If this didn't cause a commit of the response, the final content



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



svn commit: r1229728 - /tomcat/trunk/java/org/apache/tomcat/util/buf/C2BConverter.java

2012-01-10 Thread markt
Author: markt
Date: Tue Jan 10 21:00:50 2012
New Revision: 1229728

URL: http://svn.apache.org/viewvc?rev=1229728&view=rev
Log:
Add a BufferedWriter to the Converter

Modified:
tomcat/trunk/java/org/apache/tomcat/util/buf/C2BConverter.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/buf/C2BConverter.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/buf/C2BConverter.java?rev=1229728&r1=1229727&r2=1229728&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/buf/C2BConverter.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/buf/C2BConverter.java Tue Jan 10 
21:00:50 2012
@@ -16,6 +16,7 @@
  */
 package org.apache.tomcat.util.buf;
 
+import java.io.BufferedWriter;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.OutputStreamWriter;
@@ -25,21 +26,24 @@ import java.nio.charset.Charset;
  * Efficient conversion of character to bytes.
  *
  * This uses the standard JDK mechanism - a writer - but provides mechanisms to
- * recycle all the objects that are used. It is compatible with JDK1.1 and up.
- * (nio is better, but it's not available even in 1.2 or 1.3).
+ * recycle all the objects that are used. Input is buffered to improve
+ * performance.
  */
 public final class C2BConverter {
 
-private final IntermediateOutputStream ios;
+private final BufferedWriter writer;
 private final WriteConvertor conv;
+private final IntermediateOutputStream ios;
 private final ByteChunk bb;
 
-/** Create a converter, with bytes going to a byte buffer
+/**
+ * Create a converter, with bytes going to a byte buffer.
  */
 public C2BConverter(ByteChunk output, String encoding) throws IOException {
 this.bb = output;
 ios = new IntermediateOutputStream(output);
 conv = new WriteConvertor(ios, B2CConverter.getCharset(encoding));
+writer = new BufferedWriter(conv);
 }
 
 /**
@@ -47,7 +51,17 @@ public final class C2BConverter {
  * The encoding remain in effect, the internal buffers remain allocated.
  */
 public final void recycle() {
-conv.recycle();
+// Disable any output
+ios.disable();
+// Flush out the BufferedWriter and WriteConvertor
+try {
+writer.flush();
+} catch (IOException e) {
+// TODO Better logging
+e.printStackTrace();
+}
+// Re-enable ready for re-use
+ios.enable();
 bb.recycle();
 }
 
@@ -55,35 +69,35 @@ public final class C2BConverter {
  * Generate the bytes using the specified encoding.
  */
 public final void convert(char c[], int off, int len) throws IOException {
-conv.write(c, off, len);
+writer.write(c, off, len);
 }
 
 /**
  * Generate the bytes using the specified encoding.
  */
 public final void convert(String s, int off, int len) throws IOException {
-conv.write(s, off, len);
+writer.write(s, off, len);
 }
 
 /**
  * Generate the bytes using the specified encoding.
  */
 public final void convert(String s) throws IOException {
-conv.write(s);
+writer.write(s);
 }
 
 /**
  * Generate the bytes using the specified encoding.
  */
 public final void convert(char c) throws IOException {
-conv.write(c);
+writer.write(c);
 }
 
 /**
  * Flush any internal buffers into the ByteOutput or the internal byte[].
  */
 public final void flushBuffer() throws IOException {
-conv.flush();
+writer.flush();
 }
 }
 
@@ -108,17 +122,12 @@ public final class C2BConverter {
  * overhead too.
  */
  final class WriteConvertor extends OutputStreamWriter {
-// stream with flush() and close(). overridden.
-private final IntermediateOutputStream ios;
-
-// Has a private, internal byte[8192]
 
 /**
  * Create a converter.
  */
 public WriteConvertor(IntermediateOutputStream out, Charset charset) {
 super(out, charset);
-ios = out;
 }
 
 /**
@@ -145,19 +154,6 @@ public final class C2BConverter {
 // Will do the conversion and call write on the output stream
 super.write( cbuf, off, len );
 }
-
-/**
- * Reset the buffer.
- */
-public  final void recycle() {
-ios.disable();
-try {
-flush();
-} catch( Exception ex ) {
-ex.printStackTrace();
-}
-ios.enable();
-}
 }
 
 



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



svn commit: r1229729 - in /tomcat/trunk/java/org/apache/tomcat/util/buf: C2BConverter.java LocalStrings.properties

2012-01-10 Thread markt
Author: markt
Date: Tue Jan 10 21:01:32 2012
New Revision: 1229729

URL: http://svn.apache.org/viewvc?rev=1229729&view=rev
Log:
Improve logging

Modified:
tomcat/trunk/java/org/apache/tomcat/util/buf/C2BConverter.java
tomcat/trunk/java/org/apache/tomcat/util/buf/LocalStrings.properties

Modified: tomcat/trunk/java/org/apache/tomcat/util/buf/C2BConverter.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/buf/C2BConverter.java?rev=1229729&r1=1229728&r2=1229729&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/buf/C2BConverter.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/buf/C2BConverter.java Tue Jan 10 
21:01:32 2012
@@ -22,6 +22,10 @@ import java.io.OutputStream;
 import java.io.OutputStreamWriter;
 import java.nio.charset.Charset;
 
+import org.apache.juli.logging.Log;
+import org.apache.juli.logging.LogFactory;
+import org.apache.tomcat.util.res.StringManager;
+
 /**
  * Efficient conversion of character to bytes.
  *
@@ -31,9 +35,14 @@ import java.nio.charset.Charset;
  */
 public final class C2BConverter {
 
-private final BufferedWriter writer;
-private final WriteConvertor conv;
-private final IntermediateOutputStream ios;
+private static final Log log = LogFactory.getLog(C2BConverter.class);
+private static final StringManager sm =
+StringManager.getManager(Constants.Package);
+
+private final String encoding;
+private BufferedWriter writer;
+private WriteConvertor conv;
+private IntermediateOutputStream ios;
 private final ByteChunk bb;
 
 /**
@@ -41,9 +50,8 @@ public final class C2BConverter {
  */
 public C2BConverter(ByteChunk output, String encoding) throws IOException {
 this.bb = output;
-ios = new IntermediateOutputStream(output);
-conv = new WriteConvertor(ios, B2CConverter.getCharset(encoding));
-writer = new BufferedWriter(conv);
+this.encoding = encoding;
+init();
 }
 
 /**
@@ -57,14 +65,25 @@ public final class C2BConverter {
 try {
 writer.flush();
 } catch (IOException e) {
-// TODO Better logging
-e.printStackTrace();
+log.warn(sm.getString("c2bConverter.recycleFailed"), e);
+try {
+init();
+} catch (IOException ignore) {
+// Should never happen since this means encoding is invalid and
+// in that case, the constructor will have failed.
+}
 }
 // Re-enable ready for re-use
 ios.enable();
 bb.recycle();
 }
 
+private void init() throws IOException {
+ios = new IntermediateOutputStream(bb);
+conv = new WriteConvertor(ios, B2CConverter.getCharset(encoding));
+writer = new BufferedWriter(conv);
+}
+
 /**
  * Generate the bytes using the specified encoding.
  */

Modified: tomcat/trunk/java/org/apache/tomcat/util/buf/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/buf/LocalStrings.properties?rev=1229729&r1=1229728&r2=1229729&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/buf/LocalStrings.properties 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/buf/LocalStrings.properties Tue 
Jan 10 21:01:32 2012
@@ -14,3 +14,4 @@
 # limitations under the License.
 
 b2cConvertor.unknownEncoding=The character encoding [{0}] is not supported
+c2bConverter.recycleFailed=Failed to recycle the C2B Converter. Creating new 
BufferedWriter, WriteConvertor and IntermediateOutputStream.



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



svn commit: r1229730 - in /tomcat/trunk/java/org/apache/tomcat/util/buf: B2CConverter.java LocalStrings.properties LocalStrings_es.properties

2012-01-10 Thread markt
Author: markt
Date: Tue Jan 10 21:02:17 2012
New Revision: 1229730

URL: http://svn.apache.org/viewvc?rev=1229730&view=rev
Log:
Align spelling of message key

Modified:
tomcat/trunk/java/org/apache/tomcat/util/buf/B2CConverter.java
tomcat/trunk/java/org/apache/tomcat/util/buf/LocalStrings.properties
tomcat/trunk/java/org/apache/tomcat/util/buf/LocalStrings_es.properties

Modified: tomcat/trunk/java/org/apache/tomcat/util/buf/B2CConverter.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/buf/B2CConverter.java?rev=1229730&r1=1229729&r2=1229730&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/buf/B2CConverter.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/buf/B2CConverter.java Tue Jan 10 
21:02:17 2012
@@ -72,7 +72,7 @@ public class B2CConverter {
 if (charset == null) {
 // Pre-population of the cache means this must be invalid
 throw new UnsupportedEncodingException(
-sm.getString("b2cConvertor.unknownEncoding", enc));
+sm.getString("b2cConverter.unknownEncoding", enc));
 }
 return charset;
 }

Modified: tomcat/trunk/java/org/apache/tomcat/util/buf/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/buf/LocalStrings.properties?rev=1229730&r1=1229729&r2=1229730&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/buf/LocalStrings.properties 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/buf/LocalStrings.properties Tue 
Jan 10 21:02:17 2012
@@ -13,5 +13,5 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-b2cConvertor.unknownEncoding=The character encoding [{0}] is not supported
+b2cConverter.unknownEncoding=The character encoding [{0}] is not supported
 c2bConverter.recycleFailed=Failed to recycle the C2B Converter. Creating new 
BufferedWriter, WriteConvertor and IntermediateOutputStream.

Modified: 
tomcat/trunk/java/org/apache/tomcat/util/buf/LocalStrings_es.properties
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/buf/LocalStrings_es.properties?rev=1229730&r1=1229729&r2=1229730&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/buf/LocalStrings_es.properties 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/buf/LocalStrings_es.properties Tue 
Jan 10 21:02:17 2012
@@ -13,4 +13,4 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-b2cConvertor.unknownEncoding = La codificaci\u00F3n de car\u00E1cter [{0}] no 
est\u00E1 soportada
+b2cConverter.unknownEncoding = La codificaci\u00F3n de car\u00E1cter [{0}] no 
est\u00E1 soportada



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



svn commit: r1229731 - /tomcat/trunk/test/org/apache/catalina/connector/TestOutputBuffer.java

2012-01-10 Thread markt
Author: markt
Date: Tue Jan 10 21:02:53 2012
New Revision: 1229731

URL: http://svn.apache.org/viewvc?rev=1229731&view=rev
Log:
Add test case

Added:
tomcat/trunk/test/org/apache/catalina/connector/TestOutputBuffer.java

Added: tomcat/trunk/test/org/apache/catalina/connector/TestOutputBuffer.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/connector/TestOutputBuffer.java?rev=1229731&view=auto
==
--- tomcat/trunk/test/org/apache/catalina/connector/TestOutputBuffer.java 
(added)
+++ tomcat/trunk/test/org/apache/catalina/connector/TestOutputBuffer.java Tue 
Jan 10 21:02:53 2012
@@ -0,0 +1,116 @@
+/*
+ * 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.connector;
+
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.io.Writer;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import static org.junit.Assert.assertEquals;
+import org.junit.Test;
+
+import org.apache.catalina.Context;
+import org.apache.catalina.Wrapper;
+import org.apache.catalina.startup.Tomcat;
+import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.tomcat.util.buf.ByteChunk;
+
+public class TestOutputBuffer extends TomcatBaseTest{
+
+@Test
+public void testWriteSpeed() throws Exception {
+Tomcat tomcat = getTomcatInstance();
+
+Context root = tomcat.addContext("", TEMP_DIR);
+SingleCharWritingServlet servlet = new SingleCharWritingServlet();
+Wrapper w =
+Tomcat.addServlet(root, "singleCharWritingServlet", servlet);
+w.setAsyncSupported(true);
+root.addServletMapping("/", "singleCharWritingServlet");
+
+tomcat.start();
+
+ByteChunk bc = new ByteChunk();
+int rc = getUrl("http://localhost:"; + getPort() + "/", bc, null, null);
+
+assertEquals(200, rc);
+assertEquals(SingleCharWritingServlet.ITERATIONS, bc.getLength());
+
+long noBuffering = servlet.getLastRunNano();
+
+System.out.println(noBuffering);
+
+bc.recycle();
+
+rc = getUrl("http://localhost:"; + getPort() + "/?useBuffering=y", bc,
+null, null);
+
+assertEquals(200, rc);
+assertEquals(SingleCharWritingServlet.ITERATIONS, bc.getLength());
+
+long buffering = servlet.getLastRunNano();
+
+System.out.println(buffering);
+}
+
+private static final class SingleCharWritingServlet extends HttpServlet {
+
+private static final long serialVersionUID = 1L;
+
+protected static final int ITERATIONS = 10;
+
+// Not thread safe but will only be used with single calls.
+private volatile long lastRunNano = 0;
+
+@Override
+protected void doGet(HttpServletRequest req, HttpServletResponse resp)
+throws ServletException, IOException {
+
+resp.setContentType("text/plain");
+resp.setCharacterEncoding("ISO-8859-1");
+
+Writer w = resp.getWriter();
+
+// Wrap with a buffer if necessary
+String useBufferStr = req.getParameter("useBuffer");
+if (useBufferStr != null) {
+w = new BufferedWriter(w);
+}
+
+long start = System.nanoTime();
+
+for (int i = 0; i < ITERATIONS; i++) {
+w.write('x');
+}
+
+lastRunNano = System.nanoTime() - start;
+
+if (useBufferStr != null) {
+w.flush();
+}
+}
+
+public long getLastRunNano() {
+return lastRunNano;
+}
+}
+}



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



svn commit: r1229733 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/util/buf/C2BConverter.java

2012-01-10 Thread markt
Author: markt
Date: Tue Jan 10 21:03:15 2012
New Revision: 1229733

URL: http://svn.apache.org/viewvc?rev=1229733&view=rev
Log:
Whitespace and Javadoc fixes. No functional change.

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/buf/C2BConverter.java

Propchange: tomcat/tc7.0.x/trunk/
--
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 10 21:03:15 2012
@@ -1 +1 @@
-/tomcat/trunk:1156115,1156171,1156276,1156304,1156519,1156530,1156602,1157015,1157018,1157151,1157198,1157204,1157810,1157832,1157834,1157847,1157908,1157939,1158155,1158160,1158176,1158195,1158198-1158199,1158227,1158331,1158334-1158335,1158426,1160347,1160592,1160611,1160619,1160626,1160639,1160652,1160720-1160721,1160772,1160774,1160776,1161303,1161310,1161322,1161339,1161486,1161540,1161549,1161584,1162082,1162149,1162169,1162721,1162769,1162836,1162932,1163630,1164419,1164438,1164469,1164480,1164567,1165234,1165247-1165248,1165253,1165273,1165282,1165309,1165331,1165338,1165347,1165360-1165361,1165367-1165368,1165602,1165608,1165677,1165693,1165721,1165723,1165728,1165730,1165738,1165746,1165765,1165777,1165918,1165921,1166077,1166150-1166151,1166290,1166366,1166620,1166686,1166693,1166752,1166757,1167368,1167394,1169447,1170647,1171692,1172233-1172234,1172236,1172269,1172278,1172282,1172556,1172610,1172664,1172689,1172711,1173020-1173021,1173082,1173088,1173090,1173096
 
,1173241,1173256,1173288,117,1173342,1173461,1173614,1173630,1173659,1173722,1174061,1174239,1174322,1174325,1174329-1174330,1174337-1174339,1174343,1174353,1174799,1174882,1174884,1174975,1174983,1175155,1175158,1175167,1175182,1175190,1175201,1175272,1175275,1175283,1175582,1175589-1175590,1175594,1175602,1175613,1175633,1175690,1175713,1175798,1175889,1175896,1175907,1176584,1176590,1176799,1177050,1177060,1177125,1177152,1177160,1177245,1177850,1177862,1177978,1178209,1178228,1178233,1178449,1178542,1178681,1178684,1178721,1179268,1179274,1180261,1180865,1180891,1180894,1180907,1181028,1181123,1181125,1181136,1181291,1181743,1182796,1183078,1183105,1183142,1183328,1183339-1183340,1183492-1183494,1183605,1184917,1184919,1185018,1185020,1185200,1185588,1185626,1185756,1185758,1186011,1186042-1186045,1186104,1186123,1186137,1186153,1186254,1186257,1186377-1186379,1186479-1186480,1186712,1186743,1186750,1186763,1186890-1186892,1186894,1186949,1187018,1187027-1187028,1187
 
381,1187753,1187755,1187775,1187801,1187806,1187809,1187827,1188301,1188303-1188305,1188399,1188822,1188930-1188931,1189116,1189129,1189183,1189240,1189256,1189386,1189413-1189414,1189477,1189685,1189805,1189857,1189864,1189882,1190034,1190185,1190279,1190339,1190371,1190388-1190389,1190474,1190481,1194915,1195222-1195223,1195531,1195899,1195905,1195943,1195949,1195953,1195955,1195965,1195968,1196175,1196212,1196223,1196304-1196305,1196735,1196825,1196827,1197158,1197261,1197263,1197299-1197300,1197305,1197339-1197340,1197343,1197382,1197386-1197387,1197480,1197578,1198497,1198528,1198552,1198602,1198604,1198607,1198622,1198640,1198696,1198707,1199418,1199432,1199436,1199513,1199529,1199980,116,1200056,1200089,1200106-1200107,1200263,1200316,1200320,1200398-1200399,1200445-1200446,1200555,1200627,1200696,1200725,1200937,1200941,1201069,1201087,1201180,1201235-1201237,1201508,1201521,1201542,1201545-1201546,1201548,1201555-1201556,1201568,1201576,1201608,1201921-1201922,1
 
201931,1202035,1202039,1202271,1202565,1202578,1202705,1202828,1202860,1203047-1203052,1203078,1203091,1203253,1203278,1204182,1204856,1204867,1204936,1204938,1204982,1205033,1205065,1205082,1205097,1205112,1206200,1207692,1208046,1208073,1208096,1208114,1208145,1208772,1209194,1209277-1209278,1209686-1209731,1210894,1212091,1212095,1212099,1212118,1213469,1213906,1214853,1214855,1214864,1215115,1215118-1215119,1215121,1220293,1220295,1221038,1221842,1222189,101,176,1222300,1222690,1222850,1222852,1222855,1224607,1224617,1224648-1224652,1224657,1224662-1224663,1224682,1224801,1224910,1225000,1225219,1225343,1225465,1225627,1225629,1225634,1226069,1226158-1226159,1226177,1226196,1226214-1226215,1226385,1226394,1226500,1226537-1226538,1226546,1226551,1226975,1228196,1228360,1228376,1228724,1228908,1228918,1228920,1228922,1228929,1228969,1229307,1229536,1229549
+/tomcat/trunk:1156115,1156171,1156276,1156304,1156519,1156530,1156602,1157015,1157018,1157151,1157198,1157204,1157810,1157832,1157834,1157847,1157908,1157939,1158155,1158160,1158176,1158195,1158198-1158199,1158227,1158331,1158334-1158335,1158426,1160347,1160592,1160611,1160619,1160626,1160639,1160652,1160720-1160721,1160772,1160774,1160776,1161303,1161310,1161322,1161339,1161486,1161540,1161549,1161584,1162082,1162149,1162169,1162721,1162769,1162836,1162932,1163630,1164419,1164438,1164469,1164480,1164567,1165234,1165247-1165248,1165253,1165273,1165282,1165309,1165331,1165338,1165347,1165360-1165361,1165367-1165368,1165602,1165

Re: More Caching for WebappClassLoader?

2012-01-10 Thread Christopher Schultz
Rainer,

On 1/10/12 5:43 AM, Rainer Jung wrote:
> Now loadClass() in the WebappClasLoader does:
> 
> - check own class cache
> - check super class cache
> - try loading from system loader
> - call Class.forName with parent loader (which calls loadClass() there)
>   [only if "delegated", which is *not* the default]
> - try loading via findClass()
> - call Class.forName with parent loader (which calls loadClass() there)
>   [only if not "delegated", which *is* the default]

Hmm.

> What we could do to keep the design simple is caching any positive
> result from loadClass() in the WebappLoader, even it it was found via
> super, system or parent. In addition we could also cache negative
> results for all those. The biggest downsides I can see would be
> 
> - less dynamics: if someone had a more dynamic loader unerneath ours,
> which would change the result of loadClass() during runtime, we would
> shield the app from it, because we now return classes from our cache.

-0?

Their CL should have the opportunity to load the class first, so it
doesn't matter whether or not we cache the result, right?

> - increased memory use for the cache, i.e. the list of class names and
> references to the classes.

-1

The class names (String) and Class objects will already be in memory
because they will be stored by the "real" ClassLoader that loaded them.
The only thing we will have to do is pay for the additional storage of
those references in our own cache -- so, it's just the cost of the
additional space from our own class mapping table.

> To stay completely compatible I think the feature should not be default,
> at least until TC 7, maybe switch default for 8.

This could be implemented as a separate WebappClassLoader, and
configured in the . That way users can choose, and the default
is the old behavior.

> What do you think? Does it make sense? Should I prepare a patch for trunk?

+1

-chris



signature.asc
Description: OpenPGP digital signature


DO NOT REPLY [Bug 52328] Massive garbage production observed when using the response writer

2012-01-10 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=52328

--- Comment #9 from Mark Thomas  2012-01-10 21:05:26 UTC ---
Unit tests now work on trunk. I'm just running the TCK before I look at
back-porting it.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

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



DO NOT REPLY [Bug 52328] Massive garbage production observed when using the response writer

2012-01-10 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=52328

--- Comment #10 from Mark Thomas  2012-01-10 22:11:09 UTC ---
JSP and Servlet TCK pass for trunk (apart from the Servlet signature tests that
are expected to fail since some changes have already been made for Servlet
3.1).

I'll look at back-porting these tomorrow.

Nikolay,
What are the chances of you being able to test your app with these changes? I
can provide a snapshot release build if necessary.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

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



[jira] [Created] (MTOMCAT-114) Add an archetype project sample

2012-01-10 Thread Olivier Lamy (Created) (JIRA)
Add an archetype project sample
---

 Key: MTOMCAT-114
 URL: https://issues.apache.org/jira/browse/MTOMCAT-114
 Project: Apache Tomcat Maven Plugin
  Issue Type: Improvement
Reporter: Olivier Lamy
Assignee: Olivier Lamy
 Fix For: 2.0


the archetype will be a multi module maven project with jar and war module.
The webapp will have a selenium test to show how to start tomcat with the 
plugin to run selenium tests.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



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



Re: More Caching for WebappClassLoader?

2012-01-10 Thread Rainer Jung

Hi Chris,

On 10.01.2012 22:03, Christopher Schultz wrote:

Rainer,

On 1/10/12 5:43 AM, Rainer Jung wrote:

Now loadClass() in the WebappClasLoader does:

- check own class cache
- check super class cache
- try loading from system loader
- call Class.forName with parent loader (which calls loadClass() there)
   [only if "delegated", which is *not* the default]
- try loading via findClass()
- call Class.forName with parent loader (which calls loadClass() there)
   [only if not "delegated", which *is* the default]


Hmm.


What we could do to keep the design simple is caching any positive
result from loadClass() in the WebappLoader, even it it was found via
super, system or parent. In addition we could also cache negative
results for all those. The biggest downsides I can see would be

- less dynamics: if someone had a more dynamic loader unerneath ours,
which would change the result of loadClass() during runtime, we would
shield the app from it, because we now return classes from our cache.


-0?

Their CL should have the opportunity to load the class first, so it
doesn't matter whether or not we cache the result, right?


It would matter if they take the reedom to return something new if 
loadClass() is called for a class that was already loaded - and 
something changed for the CL. For example a custom CL could check every 
now and then whether the classes have dynamically changed and then 
return the new ones. If we cache the first result of loadClass() in our 
loader higher up the hierarchy, the custom CL lower down will never be 
called again for the class and wouldn't be able to update it. Sure 
that's not a common feature of class loading, but it would be good to 
keep the caching optional in order to to make such a dynamics feature 
possible.



- increased memory use for the cache, i.e. the list of class names and
references to the classes.


-1

The class names (String) and Class objects will already be in memory
because they will be stored by the "real" ClassLoader that loaded them.
The only thing we will have to do is pay for the additional storage of
those references in our own cache -- so, it's just the cost of the
additional space from our own class mapping table.


Right, tahT#s what I wanted to say. So at the end it might be a few 
thousands of pointers.



To stay completely compatible I think the feature should not be default,
at least until TC 7, maybe switch default for 8.


This could be implemented as a separate WebappClassLoader, and
configured in the. That way users can choose, and the default
is the old behavior.


What do you think? Does it make sense? Should I prepare a patch for trunk?


+1


Thanks, to Mark as well for his comments :)

Regards,

Rainer


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



Re: More Caching for WebappClassLoader?

2012-01-10 Thread Christopher Schultz
Rainer,

On 1/10/12 5:37 PM, Rainer Jung wrote:
> It would matter if they take the reedom to return something new if
> loadClass() is called for a class that was already loaded - and
> something changed for the CL. For example a custom CL could check every
> now and then whether the classes have dynamically changed and then
> return the new ones. If we cache the first result of loadClass() in our
> loader higher up the hierarchy, the custom CL lower down will never be
> called again for the class and wouldn't be able to update it.

I'm not sure why a custom CL would be "lower" in the hierarchy than the
WebappClassLoader but then also not have first-crack at loading the
classes it had originally loaded. If the CL follows parent-first
semantics then this might be a problem, but if the CL follows me-first
semantics, then this will not be a problem.

> Right, that's what I wanted to say. So at the end it might be a few
> thousands of pointers.

Yeah, that's not that big of a deal when the alternative is what amounts
to CL thrashing :)

-chris



signature.asc
Description: OpenPGP digital signature


DO NOT REPLY [Bug 52448] New: Cache jar indexes in WebappClassLoader to speed up resources lookup

2012-01-10 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=52448

 Bug #: 52448
   Summary: Cache jar indexes in WebappClassLoader to speed up
resources lookup
   Product: Tomcat 7
   Version: unspecified
  Platform: PC
OS/Version: Windows XP
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: Catalina
AssignedTo: dev@tomcat.apache.org
ReportedBy: knst.koli...@gmail.com
Classification: Unclassified


Created attachment 28135
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28135
2010-03-22_tc6_CachingJarEntries_draft.patch

Here is an old draft patch for WebappClassLoader that may worth looking at
considering recent class loader discussion.

It addresses the problem with WebappClassLoader#findResourceInternal() that is
caused by these two factors:

1. The findResourceInternal method has a loop over JAR files of the web
application. To find a resource it asks each JAR file whether the resource is
present in it.

The lookup in each of JAR files should be fast, because a zip file has an index
(at the end of the file). The problem is that loading and parsing the index
into a hash table needs some time.

2. There is method WebappClassLoader#closeJARs() that closes the JARs and thus
unloads those indexes. The method is called:
- once webapp starts, in StandardContext#startInternal()
[[[
((WebappLoader) getLoader()).closeJARs(true);
]]]
- once in a while in background thread, WebappLoader#backgroundProcess()
[[[
closeJARs(false);
]]]

The second call (force:=false) does JARs unloading once there was no activity
for 9 msecs = 1,5 minutes (hardcoded value).


The problem is that when a web application has a lot of JARs in WEB-INF/lib,
and you have just started it. When you access its first JSP page the
WebappClassLoader has find some class or resource.

To do that it has to open all JARs and scan them for a resource (a class), even
if the resources is in only one JAR file, or not in them at all - if it comes
from the parent classloader. This opening takes time and is noticeable.

The idea in the patch is to do JAR scanning while the application starts up and
all the JARs are open (before the closeJARs(true) call) and cache the names
found in the JAR files.

The #findResourceInternal() call uses the cache to open a single JAR that
actually contains the resource.


The patch is against r922264 of tc6.0.x. It contains some remnants of
LockAwareURLClassLoader - see
https://issues.apache.org/bugzilla/show_bug.cgi?id=48903#c6
Those have to be ignored. The essence is the jarEntryNames field and
openJAR(int index) method that populates it.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

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



Re: More Caching for WebappClassLoader?

2012-01-10 Thread Konstantin Kolinko
2012/1/10 Rainer Jung :
> I analyzed a fun problem a few weeks ago. Someone was using the shared
> loader extensively (TC 5.5). They observed performance problems and thread
> dumps showed, that often the class loader locking was the culprit.
>
> Code was inside loadClass(). Now it turned out, it wasn't about really
> loading classes. Instead there was a lot of deserialization going on (data
> received from a backend app server). Deserialization uses reflection
> intensively and reflection leads to loadClass() calls to retrieve the
> classes. We observed e.g. several hundreds loadClass() calls per second.
>
> Now loadClass() in the WebappClasLoader does:
>
> - check own class cache
> - check super class cache
> - try loading from system loader
> - call Class.forName with parent loader (which calls loadClass() there)
>  [only if "delegated", which is *not* the default]
> - try loading via findClass()
> - call Class.forName with parent loader (which calls loadClass() there)
>  [only if not "delegated", which *is* the default]
>
> So if a class was previously loaded by the shared loader (or common or
> server), then we will not find in in our own or the super cache, will then
> *always* try to load it via system, will then (if default) always try to
> load it ourselves and only finally will try to load it via parent and find
> it there in the cache.
>
> This turned out to become a bottleneck.
>
> I implemented a quick hack which cached the classes loaded by system, parent
> and shared positively and negatively (not found) in the WebappLoader using
> the same method that was already used for its own cache. Thus the massive
> calls to those loaders could be avoided and the bottleneck went away.
>
> I wonder whether we want to improve caching in the WebappLoader. Of course
> most deployments no longer use shared or common to share many application
> classes, but it is still a supported feature and for some classes like JDBC
> it is standard.
>
> What we could do to keep the design simple is caching any positive result
> from loadClass() in the WebappLoader, even it it was found via super, system
> or parent. In addition we could also cache negative results for all those.
> The biggest downsides I can see would be
>
> - less dynamics: if someone had a more dynamic loader unerneath ours, which
> would change the result of loadClass() during runtime, we would shield the
> app from it, because we now return classes from our cache.
>
> - increased memory use for the cache, i.e. the list of class names and
> references to the classes.
>
> To stay completely compatible I think the feature should not be default, at
> least until TC 7, maybe switch default for 8.
>
> What do you think? Does it make sense? Should I prepare a patch for trunk?
>

Note that when looking for a class most time is wasted when looking up
a "*.class" resource. That code is in findResourceInternal() and I
think that that method should be considered as well, to speed up
lookup of any resources, not only the classes.

I had some old patch draft lying around. I submitted it in
https://issues.apache.org/bugzilla/show_bug.cgi?id=52448

See that issue for details.


Concerning the cache of classes that you are proposing: consider the
following scenario:
(1) WebappClassLoader is asked to load a class. It does not find it
and then finds it in the parent classloader.
(2) It is asked for this class again.

During (2) should it look into its own resources first? If during the
time between (1) and (2) one puts a class file into WEB-INF/classes
should that class file be used?

I think that during (2) call it must ignore the class in
WEB-INF/classes and still use the class from parent classloader. That
is for consistency with previous result.

I think that instead of caching the class instance itself it would be
safe to cache the fact that the class was loaded from the parent
classloader. It separates responsibilities and solves the issue with
dynamic classloading. The difference is small though.
Actually WebappClassLoader#notFoundResources already serves similar purpose.


Regarding class instances caching I see two concerns:
a) Garbage-collecting unused classes.
b) Hot-swapping classes during debugging.

Regarding a) that is not a concern if parent classloader already has
cache of those classes. Caching just names is safer, does not prevent
gc of the classes and the names take less memory (and no PermGen
memory).

Regarding b) I suspect that hot-swapping changes bytecode but does not
change the Class instance. Documentation is at [1], but I do not have
much experience with this feature.

[1] 
http://docs.oracle.com/javase/1.4.2/docs/guide/jpda/enhancements.html#hotswap


Regarding "try loading from system loader" call:
Isn't that call fast? In JRE 6 there are some indexes (lib/classlist,
lib/meta-index) that should help system classloader to reject requests
for classes that it cannot load.


While we are talking about classloaders - there is one more patch in

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

2012-01-10 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 7 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 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 tomcat-trunk-dbcp exists, no need to add for property 
tomcat-dbcp-src.jar.
 -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-dbcp 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: 19 mins 3 secs
Command Line: /usr/lib/jvm/java-6-openjdk/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/dist/junit-11012012.jar 
-Dcommons-daemon.native.src.tgz=/srv/gump/public/workspace/apache-commons/daemon/dist/bin/commons-daemon-11012012-native-src.tar.gz
 
-Dtomcat-native.tar.gz=/srv/gump/public/workspace/apache-commons/daemon/dist/bin/commons-daemon-11012012-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-11012012.jar
 
-Dtomcat-dbcp-src.jar=/srv/gump/public/workspace/tomcat-trunk/tomcat-deps/tomcat-dbcp-src.jar
 -Dtest.accesslog=true 
-Dcommons-pool.home=/srv/gump/public/workspace/commons-pool-1.x 
-Dcommons-dbcp.home=/
 srv/gump/public/workspace/commons-dbcp-1.x 
-Dtomcat-dbcp.jar=/srv/gump/public/workspace/tomcat-trunk/tomcat-deps/tomcat-dbcp-11012012.jar
 test 
[Working Directory: /srv/gump/public/workspace/tomcat-trunk]
CLASSPATH: 
/usr/lib/jvm/java-6-openjdk/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-swing.jar:/srv/gump/public/workspace/ant/dist/lib/ant-apache-resolver.jar:/srv/gump/public/workspace/ant/dist/lib/ant-apache-xalan2.jar:/srv/gump/public/workspace/xml-commons/java/build/resolver.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/bin/bootstrap.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/bin/tomcat-juli.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/annotations-api.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/servlet-api.jar:/srv/gump/public/workspace/tomcat-trunk/outp
 
ut/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/catalina.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/catalina-ant.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-util.jar:/srv/gump/packages/javamail-1.4/mail.jar:/srv/gump/packages/javamail-1.4/lib/mailapi.jar:/srv/gump/packages/jaf-1.1ea/activation.jar:/srv/gump/packages/eclipse/plugins/org.eclipse.jdt.core_3.4.2/jdtcore.jar:/srv/gump/public/workspace/tomcat-tr
 
unk/tomcat-deps/tomcat-dbcp-11012012.jar:/srv/gump/public/workspace/apache-commons/daemon/dist/commons-daemon-11012012.jar:/srv/gump/public/