Bug report for Tomcat 6 [2012/09/09]

2012-09-09 Thread bugzilla
+---+
| Bugzilla Bug ID   |
| +-+
| | Status: UNC=Unconfirmed NEW=New ASS=Assigned|
| | OPN=ReopenedVER=Verified(Skipped Closed/Resolved)   |
| |   +-+
| |   | Severity: BLK=Blocker CRI=Critical  REG=Regression  MAJ=Major   |
| |   |   MIN=Minor   NOR=NormalENH=Enhancement TRV=Trivial |
| |   |   +-+
| |   |   | Date Posted |
| |   |   |  +--+
| |   |   |  | Description  |
| |   |   |  |  |
|41679|New|Enh|2007-02-22|SemaphoreValve should be able to filter on url pat|
|41883|Ass|Enh|2007-03-18|use abstract wrapper instead of plain X509Certific|
|43001|New|Enh|2007-07-30|JspC lacks setMappedFile and setDie for use in Ant|
|43400|New|Enh|2007-09-14|enum support for tag libs |
|43548|Opn|Enh|2007-10-04|xml schema for tomcat-users.xml   |
|43682|New|Enh|2007-10-23|JULI: web-inf/classes/logging.properties to suppor|
|43742|New|Enh|2007-10-30|.tag compiles  performed one at a time -- extremel|
|43979|New|Enh|2007-11-27|Add abstraction for Java and Classfile output |
|44199|New|Enh|2008-01-10|expose current backlog queue size |
|44225|New|Enh|2008-01-14|SSL connector tries to load the private keystore f|
|44284|New|Enh|2008-01-23|Support java.lang.Iterable in c:forEach tag   |
|44294|New|Enh|2008-01-25|Support for EL functions with varargs |
|44645|New|Enh|2008-03-20|[Patch] JNDIRealm - Doesn't support JNDI "java.nam|
|44787|New|Enh|2008-04-09|provide more error context on "java.lang.IllegalSt|
|44818|New|Enh|2008-04-13|tomcat hangs with GET when content-length is defin|
|45014|New|Enh|2008-05-15|Request and Response classes should have wrappers |
|45282|New|Enh|2008-06-25|NioReceiver doesn't close cleanly, leaving sockets|
|45428|New|Enh|2008-07-18|warn if the tomcat stop doesn't complete  |
|45832|New|Enh|2008-09-18|add DIGEST authentication support to Ant tasks|
|45878|New|Enh|2008-09-24|Generated jars do not contain proper manifests or |
|45879|Opn|Enh|2008-09-24|Windows installer fails to install NOTICE and RELE|
|45931|Opn|Enh|2008-10-01|trimSpaces incorrectly modifies output|
|46173|New|Enh|2008-11-09|Small patch for manager app: Setting an optional c|
|46263|New|Enh|2008-11-21|Tomcat reloading of context.xml does not update do|
|46284|New|Enh|2008-11-24|Add flag to DeltaManager that blocks processing cl|
|46350|New|Enh|2008-12-05|Maven repository should contain source bundles|
|46727|New|Enh|2009-02-17|DefaultServlet - serving multiple encodings   |
|46902|New|Enh|2009-03-24|LoginValve to bypass restrictions of j_security_ch|
|47214|New|Enh|2009-05-17|Inner classes that are explicitly referenced - sho|
|47242|New|Enh|2009-05-22|request for AJP command line client   |
|47281|New|Enh|2009-05-28|Efficiency of the JDBCStore   |
|47407|New|Enh|2009-06-23|HttpSessionListener doesn't operate in the session|
|47467|New|Enh|2009-07-02|Deployment of the war file by URL when contextpath|
|47834|New|Enh|2009-09-14|TldConfig throws Exception when exploring unpacked|
|47919|New|Enh|2009-09-30|Log Tomcat & Java environment variables in additio|
|48358|Opn|Enh|2009-12-09|JSP-unloading reloaded|
|48543|New|Enh|2010-01-14|[Patch] More flexibility in specifying -Dcatalina.|
|48672|New|Enh|2010-02-03|Tomcat Virtual Host Manager (/host-manager) have b|
|48674|New|Enh|2010-02-03|Tomcat Virtual Host Manager application doesn't pe|
|48743|New|Enh|2010-02-15|Make the SLEEP variable in catalina.sh settable fr|
|48899|New|Enh|2010-03-12|Guess URI charset should solve lot of problems|
|48922|New|Enh|2010-03-16|org.apache.catalina.connector.Request clone static|
|48928|New|Enh|2010-03-17|An alternative solution to preloading classes when|
|49161|New|Enh|2010-04-21|Unknown Publisher when installing tomcat 6.0.26   |
|49176|Opn|Enh|2010-04-23|Jasper in Dev Mode Is Memory Inefficient  |
|49464|New|Enh|2010-06-18|DefaultServlet and CharacterEncoding  |
|49531|New|Enh|2010-06-30|singlesignon failover not working on DeltaManager/|
|49804|New|Enh|2010-08-23|Allow Embedded.redirectStreams value to be configu|
|49939|New|Enh|2010-09-16|Expose a method via JMX which empties the webapp f|
|49943|New|Enh|2010-09-16|Logging (via juli) does not reread configuration c|
|50285|New|Enh|2010-11-17|Standard HTTP and AJP connectors silently ignore a|
|50288|

Bug report for Tomcat Connectors [2012/09/09]

2012-09-09 Thread bugzilla
+---+
| Bugzilla Bug ID   |
| +-+
| | Status: UNC=Unconfirmed NEW=New ASS=Assigned|
| | OPN=ReopenedVER=Verified(Skipped Closed/Resolved)   |
| |   +-+
| |   | Severity: BLK=Blocker CRI=Critical  REG=Regression  MAJ=Major   |
| |   |   MIN=Minor   NOR=NormalENH=Enhancement TRV=Trivial |
| |   |   +-+
| |   |   | Date Posted |
| |   |   |  +--+
| |   |   |  | Description  |
| |   |   |  |  |
|34526|Opn|Nor|2005-04-19|Truncated content in decompressed requests from mo|
|35959|Opn|Enh|2005-08-01|mod_jk not independant of UseCanonicalName|
|43303|New|Enh|2007-09-04|Versioning under Windows not reported by many conn|
|43968|Inf|Enh|2007-11-26|[patch] support ipv6 with mod_jk  |
|44290|Inf|Nor|2008-01-24|mod_jk/1.2.26: retry is not useful for an importan|
|44349|Inf|Maj|2008-02-04|mod_jk/1.2.26 module does not read worker.status.s|
|44379|New|Enh|2008-02-07|convert the output of strftime into UTF-8 |
|44454|New|Nor|2008-02-19|busy count reported in mod_jk inflated, causes inc|
|44571|New|Enh|2008-03-10|Limits busy per worker to a threshold |
|45063|New|Nor|2008-05-22|JK-1.2.26 IIS ISAPI filter issue when running diff|
|45313|New|Nor|2008-06-30|mod_jk 1.2.26 & apache 2.2.9 static compiled on so|
|46337|New|Nor|2008-12-04|real worker name is wrong |
|46676|New|Enh|2009-02-09|Configurable test request for Watchdog thread |
|46767|New|Enh|2009-02-25|mod_jk to send DECLINED in case no fail-over tomca|
|47327|New|Enh|2009-06-07|remote_user not logged in apache logfile  |
|47617|Inf|Enh|2009-07-31|include time spent doing ajp_get_endpoint() in err|
|47678|New|Cri|2009-08-11|Unable to allocate shared memory when using isapi_|
|47714|New|Cri|2009-08-20|Reponse mixed between users   |
|47750|New|Maj|2009-08-27|Loss of worker settings when changing via jkstatus|
|47795|New|Maj|2009-09-07|service sticky_session not being set correctly wit|
|47840|Inf|Min|2009-09-14|A broken worker name is written in the log file.  |
|48191|New|Maj|2009-11-13|Problem with mod_jk 1.2.28 - Can not render up the|
|48460|New|Nor|2009-12-30|mod_proxy_ajp document has three misleading portio|
|48490|New|Nor|2010-01-05|Changing a node to stopped in uriworkermap.propert|
|48513|New|Enh|2010-01-09|IIS Quick setup instructions  |
|48564|New|Nor|2010-01-18|Unable to turn off retries for LB worker  |
|48830|New|Nor|2010-03-01|IIS shutdown blocked in endpoint service when serv|
|48891|Opn|Enh|2010-03-11|Missing EOL-style settings in tomcat/jk/trunk |
|49035|New|Maj|2010-04-01|data lost when post a multipart/form-data form|
|49063|New|Enh|2010-04-07|Please add JkStripSession status in jk-status work|
|49135|New|Enh|2010-04-16|SPDY Connector for The Tomcat |
|49469|New|Enh|2010-06-19|Workers status page has negative number of connect|
|49732|Opn|Nor|2010-08-10|reply_timeout can't wait forever. |
|49822|New|Enh|2010-08-25|Add hash lb worker method |
|49903|New|Enh|2010-09-09|Make workers file reloadable  |
|50186|New|Nor|2010-10-31|Wrong documentation of connection_pool_timeout / c|
|52334|New|Maj|2011-12-14|recover_time is not properly used |
|52483|New|Enh|2012-01-18|Print JkOptions's options in log file and jkstatus|
|52651|New|Nor|2012-02-13|JKSHMFile size limitation |
|53324|Opn|Nor|2012-05-30|Starting with mod_jk 1.2.35 I cannot modify worker|
|53542|New|Min|2012-07-13|Spelling mistake on 503 service unavailable page  |
|53762|New|Nor|2012-08-22|JK status manager: mass nodes handling doesn't wor|
+-+---+---+--+--+
| Total   42 bugs   |
+---+

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



Bug report for Taglibs [2012/09/09]

2012-09-09 Thread bugzilla
+---+
| Bugzilla Bug ID   |
| +-+
| | Status: UNC=Unconfirmed NEW=New ASS=Assigned|
| | OPN=ReopenedVER=Verified(Skipped Closed/Resolved)   |
| |   +-+
| |   | Severity: BLK=Blocker CRI=Critical  REG=Regression  MAJ=Major   |
| |   |   MIN=Minor   NOR=NormalENH=Enhancement TRV=Trivial |
| |   |   +-+
| |   |   | Date Posted |
| |   |   |  +--+
| |   |   |  | Description  |
| |   |   |  |  |
|38193|Ass|Enh|2006-01-09|[RDC] BuiltIn Grammar support for Field   |
|38600|Ass|Enh|2006-02-10|[RDC] Enable RDCs to be used in X+V markup (X+RDC)|
|42413|New|Enh|2007-05-14|[PATCH] Log Taglib enhancements   |
|46052|New|Nor|2008-10-21|SetLocaleSupport is slow to initialize when many l|
|48333|New|Enh|2009-12-02|TLD generator |
+-+---+---+--+--+
| Total5 bugs   |
+---+

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



Bug report for Tomcat 5 [2012/09/09]

2012-09-09 Thread bugzilla
+---+
| Bugzilla Bug ID   |
| +-+
| | Status: UNC=Unconfirmed NEW=New ASS=Assigned|
| | OPN=ReopenedVER=Verified(Skipped Closed/Resolved)   |
| |   +-+
| |   | Severity: BLK=Blocker CRI=Critical  REG=Regression  MAJ=Major   |
| |   |   MIN=Minor   NOR=NormalENH=Enhancement TRV=Trivial |
| |   |   +-+
| |   |   | Date Posted |
| |   |   |  +--+
| |   |   |  | Description  |
| |   |   |  |  |
|42181|Opn|Nor|2007-04-21|ArrayIndexOutOfBoundsException in parseChunkHeader|
|52579|New|Reg|2012-02-02|Tomcat5.5.35?Java1.5 cannot return proper value of|
|53050|New|Nor|2012-04-09|org.apache.catalina.session.ManagerBase has issues|
|53531|New|Trv|2012-07-11|ExpandWar.expand does not check the return value o|
+-+---+---+--+--+
| Total4 bugs   |
+---+

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



Bug report for Tomcat 7 [2012/09/09]

2012-09-09 Thread bugzilla
+---+
| Bugzilla Bug ID   |
| +-+
| | Status: UNC=Unconfirmed NEW=New ASS=Assigned|
| | OPN=ReopenedVER=Verified(Skipped Closed/Resolved)   |
| |   +-+
| |   | Severity: BLK=Blocker CRI=Critical  REG=Regression  MAJ=Major   |
| |   |   MIN=Minor   NOR=NormalENH=Enhancement TRV=Trivial |
| |   |   +-+
| |   |   | Date Posted |
| |   |   |  +--+
| |   |   |  | Description  |
| |   |   |  |  |
|16579|New|Enh|2003-01-30|documentation page layout/style breaks wrapping to|
|18500|New|Enh|2003-03-30|Host aliases to match by regular expression   |
|28039|Opn|Enh|2004-03-30|Cluster Support for SingleSignOn  |
|40728|Inf|Enh|2006-10-11|Catalina MBeans use non-serializable classes  |
|40881|Opn|Enh|2006-11-02|Unable to receive message through  TCP channel -> |
|41007|Opn|Enh|2006-11-20|Can't define customized 503 error page|
|43866|New|Enh|2007-11-14|add support for session attribute propagation with|
|43925|Opn|Enh|2007-11-21|org.apache.jasper.runtime.BodyContentImpl causing |
|44216|New|Enh|2008-01-11|Don't reuse session ID even if emptySessionPath=tr|
|48550|Inf|Enh|2010-01-14|Update examples and default server.xml to use UTF-|
|49395|New|Enh|2010-06-06|manager.findLeaks : display the date when the leak|
|49589|New|Enh|2010-07-12|Tag handlers with constant attribute values are al|
|49785|New|Enh|2010-08-19|Enabling TLS for JNDIRealm|
|49821|New|Enh|2010-08-25|Tomcat CLI|
|50019|New|Enh|2010-09-28|Adding JNDI "lookup-name" support In XML and Resou|
|50175|New|Enh|2010-10-28|Enhance memory leak detection by selectively apply|
|50234|New|Enh|2010-11-08|JspC use servlet 3.0 features |
|50504|New|Enh|2010-12-21|Allow setting query string character set trough re|
|50670|New|Enh|2011-01-27|Tribes | RpcChannel | Add option to specify extern|
|51195|New|Enh|2011-05-13|"Find leaks" reports a false positive memory/class|
|51294|Opn|Enh|2011-05-30|Since 7.0.12 do not work option unpackWARs=true fo|
|51423|Inf|Enh|2011-06-23|[Patch] to add a path and a version parameters to |
|51463|New|Enh|2011-07-01|Tomcat.setBaseDir  (package org.apache.catalina.st|
|51496|New|Enh|2011-07-11|NSIS - Warn that duplicate service name will resul|
|51497|New|Enh|2011-07-11|Use canonical IPv6 text representation in logs|
|51526|New|Enh|2011-07-18|Process web application context config with embedd|
|51587|New|Enh|2011-07-29|Implement status and uptime commands  |
|51953|New|Enh|2011-10-04|Proposal: netmask filtering valve and filter  |
|52092|New|Enh|2011-10-26|Please make AsyncFileHandler and OneLineFormatter |
|52235|New|Enh|2011-11-23|Please do a bit of SEO tuning for the web site|
|52236|New|Enh|2011-11-23|Idea: support 'overlays' shaped like Maven overlay|
|52323|New|Enh|2011-12-13|Cobertura test code coverage support for build.xml|
|52381|New|Enh|2011-12-22|Please add OSGi metadata  |
|52448|New|Enh|2012-01-11|Cache jar indexes in WebappClassLoader to speed up|
|52489|New|Enh|2012-01-19|Enhancement request for code signing of war files |
|52558|New|Enh|2012-01-30|CometConnectionManagerValve is adding non-serializ|
|52688|New|Enh|2012-02-16|Add ability to remove old access log files|
|52751|Opn|Enh|2012-02-23|Optimized configuration of the system info display|
|52952|New|Enh|2012-03-20|Improve ExtensionValidator handling for embedded s|
|53085|New|Enh|2012-04-16|[perf] [concurrency] DefaultInstanceManager.annota|
|53387|New|Enh|2012-06-08|SSI: Allow to use $1 to get result of regular expr|
|53411|Opn|Enh|2012-06-13|NullPointerException in org.apache.tomcat.util.buf|
|53469|Opn|Nor|2012-06-26|possible bug in Response.normalize(CharChunk cc)  |
|53492|New|Enh|2012-07-01|Make JspC shell multithreaded |
|53553|New|Enh|2012-07-16|[PATCH] Deploy uploaded WAR with context.xml from |
|53602|New|Enh|2012-07-25|Support for HTTP status code 451  |
|53620|New|Enh|2012-07-30|[juli] delay opening a file until something gets l|
|53665|New|Enh|2012-08-06|Minor JNDI Howto document enhancement concerning m|
|53776|New|Enh|2012-08-24|Multitenancy support for JDBCRealm|
|53777|New|Enh|2012-08-24|Ability to bundle JAAS Configuration in Webappp   |
+-+---+---+--+--+
| Total

Bug report for Tomcat Native [2012/09/09]

2012-09-09 Thread bugzilla
+---+
| Bugzilla Bug ID   |
| +-+
| | Status: UNC=Unconfirmed NEW=New ASS=Assigned|
| | OPN=ReopenedVER=Verified(Skipped Closed/Resolved)   |
| |   +-+
| |   | Severity: BLK=Blocker CRI=Critical  REG=Regression  MAJ=Major   |
| |   |   MIN=Minor   NOR=NormalENH=Enhancement TRV=Trivial |
| |   |   +-+
| |   |   | Date Posted |
| |   |   |  +--+
| |   |   |  | Description  |
| |   |   |  |  |
|45392|New|Nor|2008-07-14|No OCSP support for client SSL verification   |
|46179|Opn|Maj|2008-11-10|apr ssl client authentication |
|48655|Inf|Nor|2010-02-02|Active multipart downloads prevent tomcat shutdown|
|49038|Inf|Nor|2010-04-02|Crash in tcnative |
|51655|New|Nor|2011-08-12|Index page does not say what native does  |
|51813|New|Cri|2011-09-14|Tomcat randomly crashes with [libtcnative-1.so.1+0|
|52153|New|Maj|2011-11-08|periodic JVM crash (access violation) on buffer fl|
|52231|New|Nor|2011-11-23|Ant Tasks need to reflect changes in manager comma|
|52319|New|Maj|2011-12-12|Tomcat 6 crashes with [libapr-1.so.0+0x196da]  sig|
|52627|New|Min|2012-02-08|Segmentation fault in org.apache.tomcat.jni.File.i|
|52856|New|Maj|2012-03-08|High CPU load when the underlying socket error in |
|53110|New|Cri|2012-04-20|Access Violation Error while creating SHM |
|53605|New|Nor|2012-07-26|use tcnative-1.1.24 Tomcat shutdown still crash   |
+-+---+---+--+--+
| Total   13 bugs   |
+---+

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



Bug report for Tomcat Modules [2012/09/09]

2012-09-09 Thread bugzilla
+---+
| Bugzilla Bug ID   |
| +-+
| | Status: UNC=Unconfirmed NEW=New ASS=Assigned|
| | OPN=ReopenedVER=Verified(Skipped Closed/Resolved)   |
| |   +-+
| |   | Severity: BLK=Blocker CRI=Critical  REG=Regression  MAJ=Major   |
| |   |   MIN=Minor   NOR=NormalENH=Enhancement TRV=Trivial |
| |   |   +-+
| |   |   | Date Posted |
| |   |   |  +--+
| |   |   |  | Description  |
| |   |   |  |  |
|48240|New|Nor|2009-11-19|Tomcat-Lite missing @Override markers |
|48268|New|Nor|2009-11-23|Patch to fix generics in tomcat-lite  |
|48861|New|Nor|2010-03-04|Files without AL headers  |
|49685|New|Nor|2010-08-02|Unsafe synchronization in class ManagedBean   |
|49686|New|Nor|2010-08-02|Using an instance lock to protect static shared da|
|50571|Inf|Nor|2011-01-11|Tomcat 7 JDBC connection pool exception enhancemen|
|51595|Inf|Nor|2011-08-01|org.apache.tomcat.jdbc.pool.jmx.ConnectionPool sho|
|51879|Inf|Enh|2011-09-22|Improve access to Native Connection Methods   |
|52024|Inf|Enh|2011-10-13|Custom interceptor to support automatic failover o|
|53088|Opn|Min|2012-04-17|Give PoolCleaner TimerTask a better name  |
|53198|New|Cri|2012-05-07|'driverClassName' Data Source Property Being Manda|
|53199|Inf|Enh|2012-05-07|Refactor ConnectionPool to use ScheduledExecutorSe|
|53200|New|Enh|2012-05-07|Be able to use SlowQueryReport without reporting f|
|53565|New|Min|2012-07-18|deprecated|
|53770|New|Enh|2012-08-23|tomcat-pool: always log validation query syntax er|
+-+---+---+--+--+
| Total   15 bugs   |
+---+

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



Re: svn commit: r1382367 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/ java/org/apache/catalina/core/ java/org/apache/catalina/startup/ webapps/docs/ webapps/docs/config/

2012-09-09 Thread Konstantin Kolinko
2012/9/9  :
> Author: markt
> Date: Sat Sep  8 21:11:46 2012
> New Revision: 1382367
>
> URL: http://svn.apache.org/viewvc?rev=1382367&view=rev
> Log:
> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=52777
> Implement optional automatic removal of old applications where parallel 
> deployment has been used.

Regarding checkUndeploy():
1. I think it should check whether the current app version is up and running.

Consider the following:  you deploy a new version of webapp, but it
fails to start

If nobody uses the old version, it will be immediately undeployed, and
you end up with no running version of the app.

A similar problem is when the new version needs some time to start
(more than delay between autodeploy runs). You should not undeploy the
old one until the new is up and running.

2. I suspect that if the old version is stopped, it should not be
auto-undeployed as well.

I do not have a good explanation for this though.

Something like 'if it was stopped manually, auto-undeploy should not
bother with it'.

Maybe I am wrong. There are situations where auto-undeploying such
stale versions might be good.

3. There should be a check for isServiced().

4. Some synchronization is needed.
E.g. checkResources() is a synchronized method. I think chekUndeploy
should be synchronized as well.

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: r1382515 - /tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java

2012-09-09 Thread markt
Author: markt
Date: Sun Sep  9 15:23:09 2012
New Revision: 1382515

URL: http://svn.apache.org/viewvc?rev=1382515&view=rev
Log:
Review comments from kkolinko

Modified:
tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java

Modified: tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java?rev=1382515&r1=1382514&r2=1382515&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java Sun Sep  9 
15:23:09 2012
@@ -1404,7 +1404,7 @@ public class HostConfig
  * Check for old versions of applications using parallel deployment that 
are
  * now unused (have no active sessions) and undeploy any that are found.
  */
-public void checkUndeploy() {
+public synchronized void checkUndeploy() {
 // Need ordered set of names
 SortedSet sortedAppNames = new TreeSet<>();
 sortedAppNames.addAll(deployed.keySet());
@@ -1419,11 +1419,16 @@ public class HostConfig
 ContextName current = new ContextName(iter.next());
 
 if (current.getPath().equals(previous.getPath())) {
-// Current and previous are same version - current will always
+// Current and previous are same path - current will always
 // be a later version
-Context context = (Context) host.findChild(previous.getName());
-if (context != null) {
-Manager manager = context.getManager();
+Context previousContext =
+(Context) host.findChild(previous.getName());
+Context currentContext =
+(Context) host.findChild(previous.getName());
+if (previousContext != null && currentContext != null &&
+currentContext.getState().isAvailable() &&
+!isServiced(previous.getName())) {
+Manager manager = previousContext.getManager();
 if (manager != null && manager.getActiveSessions() == 0) {
 if (log.isInfoEnabled()) {
 log.info(sm.getString("hostConfig.undeployVersion",



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



Re: svn commit: r1382367 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/ java/org/apache/catalina/core/ java/org/apache/catalina/startup/ webapps/docs/ webapps/docs/config/

2012-09-09 Thread Mark Thomas
On 09/09/2012 15:24, Konstantin Kolinko wrote:
> 2012/9/9  :
>> Author: markt
>> Date: Sat Sep  8 21:11:46 2012
>> New Revision: 1382367
>>
>> URL: http://svn.apache.org/viewvc?rev=1382367&view=rev
>> Log:
>> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=52777
>> Implement optional automatic removal of old applications where parallel 
>> deployment has been used.
> 
> Regarding checkUndeploy():
> 1. I think it should check whether the current app version is up and running.

Fair point. Done.

> 2. I suspect that if the old version is stopped, it should not be
> auto-undeployed as well.
> 
> I do not have a good explanation for this though.

In this case I suspect that users wouldn't enable the auto-undeploy.

> 3. There should be a check for isServiced().

Also done.

> 4. Some synchronization is needed.
> E.g. checkResources() is a synchronized method. I think chekUndeploy
> should be synchronized as well.

Agreed.

Thanks for the review.

Mark


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



svn commit: r1382516 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/startup/HostConfig.java

2012-09-09 Thread markt
Author: markt
Date: Sun Sep  9 15:25:05 2012
New Revision: 1382516

URL: http://svn.apache.org/viewvc?rev=1382516&view=rev
Log:
Review comments from kkolinko

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/HostConfig.java

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

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/HostConfig.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/HostConfig.java?rev=1382516&r1=1382515&r2=1382516&view=diff
==
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/HostConfig.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/HostConfig.java Sun 
Sep  9 15:25:05 2012
@@ -1457,7 +1457,7 @@ public class HostConfig
  * Check for old versions of applications using parallel deployment that 
are
  * now unused (have no active sessions) and undeploy any that are found.
  */
-public void checkUndeploy() {
+public synchronized void checkUndeploy() {
 // Need ordered set of names
 SortedSet sortedAppNames = new TreeSet();
 sortedAppNames.addAll(deployed.keySet());
@@ -1472,11 +1472,16 @@ public class HostConfig
 ContextName current = new ContextName(iter.next());
 
 if (current.getPath().equals(previous.getPath())) {
-// Current and previous are same version - current will always
+// Current and previous are same path - current will always
 // be a later version
-Context context = (Context) host.findChild(previous.getName());
-if (context != null) {
-Manager manager = context.getManager();
+Context previousContext =
+(Context) host.findChild(previous.getName());
+Context currentContext =
+(Context) host.findChild(previous.getName());
+if (previousContext != null && currentContext != null &&
+currentContext.getState().isAvailable() &&
+!isServiced(previous.getName())) {
+Manager manager = previousContext.getManager();
 if (manager != null && manager.getActiveSessions() == 0) {
 if (log.isInfoEnabled()) {
 log.info(sm.getString("hostConfig.undeployVersion",



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



svn commit: r1382521 - /tomcat/trunk/java/org/apache/juli/logging/LogConfigurationException.java

2012-09-09 Thread markt
Author: markt
Date: Sun Sep  9 15:58:04 2012
New Revision: 1382521

URL: http://svn.apache.org/viewvc?rev=1382521&view=rev
Log:
Simplify

Modified:
tomcat/trunk/java/org/apache/juli/logging/LogConfigurationException.java

Modified: 
tomcat/trunk/java/org/apache/juli/logging/LogConfigurationException.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/juli/logging/LogConfigurationException.java?rev=1382521&r1=1382520&r2=1382521&view=diff
==
--- tomcat/trunk/java/org/apache/juli/logging/LogConfigurationException.java 
(original)
+++ tomcat/trunk/java/org/apache/juli/logging/LogConfigurationException.java 
Sun Sep  9 15:58:04 2012
@@ -58,7 +58,7 @@ public class LogConfigurationException e
  * @param cause The underlying cause
  */
 public LogConfigurationException(Throwable cause) {
-this( ((cause == null) ? null : cause.toString()), cause);
+super(cause);
 }
 
 



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



svn commit: r1382526 - /tomcat/trunk/java/org/apache/naming/NamingContext.java

2012-09-09 Thread markt
Author: markt
Date: Sun Sep  9 16:07:16 2012
New Revision: 1382526

URL: http://svn.apache.org/viewvc?rev=1382526&view=rev
Log:
Clean-up
 - final markers from UCDetector
 - refactor constructors to permit use of final

Modified:
tomcat/trunk/java/org/apache/naming/NamingContext.java

Modified: tomcat/trunk/java/org/apache/naming/NamingContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/NamingContext.java?rev=1382526&r1=1382525&r2=1382526&view=diff
==
--- tomcat/trunk/java/org/apache/naming/NamingContext.java (original)
+++ tomcat/trunk/java/org/apache/naming/NamingContext.java Sun Sep  9 16:07:16 
2012
@@ -70,7 +70,16 @@ public class NamingContext implements Co
  */
 public NamingContext(Hashtable env, String name)
 throws NamingException {
-this.bindings = new HashMap<>();
+this(env, name, new HashMap());
+}
+
+
+/**
+ * Builds a naming context using the given environment.
+ */
+public NamingContext(Hashtable env, String name,
+HashMap bindings) throws NamingException {
+
 this.env = new Hashtable<>();
 // FIXME ? Could be put in the environment ?
 this.name = name;
@@ -82,16 +91,6 @@ public class NamingContext implements Co
 addToEnvironment(entryName, env.get(entryName));
 }
 }
-}
-
-
-/**
- * Builds a naming context using the given environment.
- */
-public NamingContext(Hashtable env, String name,
-HashMap bindings)
-throws NamingException {
-this(env, name);
 this.bindings = bindings;
 }
 
@@ -114,7 +113,7 @@ public class NamingContext implements Co
 /**
  * Bindings in this Context.
  */
-protected HashMap bindings;
+protected final HashMap bindings;
 
 
 /**



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



Resources - overview

2012-09-09 Thread Mark Thomas
I now have my proposed alternative resources implementation complete to
the point where it is worth comitting somewhere for others to comment
on. I therefore, propose the following way forward:

1. Create a trunk-resources branch under the sandbox (copied from trunk)
and commit the new implementation in its current form.

2. Work through the various TODOs that still exist in the code. The unit
tests do not provide 100% code coverage so there are still some code
paths to complete.

3. Run the TC7 TCKs against the new and old versions and a) make sure
they pass and b) there are no obvious performance differences. (The unit
tests do all pass and the performance is - as far as I can tell -
identical for the unit tests.)

4. Start a series of threads on the dev list to discuss the various
issues that Konstantin has identified with resource handling. The
intention is to keep each thread focussed on a single issue. I'll start
threads for each issue once I have made the commit. Feel free to start a
new thread if I miss something or you see a new issue.

5. Resolve / come to an agreement regarding a way forward all of the issues.

6. Merge the new implementation back into trunk.


Mark

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



svn commit: r1382548 - in /tomcat/sandbox/trunk-resources: ./ java/org/apache/juli/logging/LogConfigurationException.java java/org/apache/naming/NamingContext.java

2012-09-09 Thread markt
Author: markt
Date: Sun Sep  9 18:07:05 2012
New Revision: 1382548

URL: http://svn.apache.org/viewvc?rev=1382548&view=rev
Log:
Create sandbox for new resources implementation

Added:
tomcat/sandbox/trunk-resources/
  - copied from r1382516, tomcat/trunk/

tomcat/sandbox/trunk-resources/java/org/apache/juli/logging/LogConfigurationException.java
  - copied unchanged from r1382521, 
tomcat/trunk/java/org/apache/juli/logging/LogConfigurationException.java
tomcat/sandbox/trunk-resources/java/org/apache/naming/NamingContext.java
  - copied unchanged from r1382526, 
tomcat/trunk/java/org/apache/naming/NamingContext.java


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



svn commit: r1382551 - in /tomcat/sandbox/trunk-resources/java/org/apache/catalina: WebResource.java WebResourceRoot.java WebResourceSet.java

2012-09-09 Thread markt
Author: markt
Date: Sun Sep  9 18:14:22 2012
New Revision: 1382551

URL: http://svn.apache.org/viewvc?rev=1382551&view=rev
Log:
Initial definition of new resources API

Added:
tomcat/sandbox/trunk-resources/java/org/apache/catalina/WebResource.java   
(with props)

tomcat/sandbox/trunk-resources/java/org/apache/catalina/WebResourceRoot.java   
(with props)
tomcat/sandbox/trunk-resources/java/org/apache/catalina/WebResourceSet.java 
  (with props)

Added: tomcat/sandbox/trunk-resources/java/org/apache/catalina/WebResource.java
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/catalina/WebResource.java?rev=1382551&view=auto
==
--- tomcat/sandbox/trunk-resources/java/org/apache/catalina/WebResource.java 
(added)
+++ tomcat/sandbox/trunk-resources/java/org/apache/catalina/WebResource.java 
Sun Sep  9 18:14:22 2012
@@ -0,0 +1,134 @@
+/*
+ * 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;
+
+import java.io.InputStream;
+import java.net.URL;
+
+/**
+ * Represents a file or directory within a web application. It borrows heavily
+ * from {@link java.io.File}.
+ */
+public interface WebResource {
+/**
+ * See {@link java.io.File#lastModified()}.
+ */
+long getLastModified();
+
+/**
+ * Return the last modified time of this resource in the correct format for
+ * the HTTP Last-Modified header as specified by RFC 2616.
+ */
+String getLastModifiedHttp();
+
+/**
+ * See {@link java.io.File#exists()}.
+ */
+boolean exists();
+
+/**
+ * See {@link java.io.File#isDirectory()}.
+ */
+boolean isDirectory();
+
+/**
+ * See {@link java.io.File#isFile()}.
+ */
+boolean isFile();
+
+/**
+ * See {@link java.io.File#delete()}.
+ */
+boolean delete();
+
+/**
+ * See {@link java.io.File#getName()}.
+ */
+String getName();
+
+/**
+ * See {@link java.io.File#length()}.
+ */
+long getContentLength();
+
+/**
+ * See {@link java.io.File#getCanonicalPath()}.
+ */
+String getCanonicalPath();
+
+/**
+ * See {@link java.io.File#canRead()}.
+ */
+boolean canRead();
+
+/**
+ * The path of this resource relative to the web application root.
+ */
+String getWebappPath();
+
+/**
+ * Return the strong ETag if available (currently not supported) else 
return
+ * the weak ETag calculated from the content length and last modified.
+ *
+ * @return  The ETag for this resource
+ */
+String getETag();
+
+/**
+ * Set the MIME type for this Resource.
+ * TODO: Previous implementation cached this
+ */
+void setMimeType(String mimeType);
+
+/**
+ * Get the MIME type for this Resource.
+ * TODO: Previous implementation cached this
+ */
+String getMimeType();
+
+/**
+ * Obtain an InputStream based on the contents of this resource.
+ *
+ * @return  An InputStream based on the contents of this resource or
+ *  null if the resource does not exist or does not
+ *  represent a file
+ */
+InputStream getInputStream();
+
+/**
+ * Obtain the cached binary content of this resource.
+ */
+byte[] getContent();
+
+/**
+ * The time the file was created. If not available, the result of
+ * {@link #getLastModified()} will be returned.
+ */
+long getCreation();
+
+/**
+ * Obtain a URL to access the resource or null if no such URL
+ * is available.
+ */
+URL getURL();
+
+/**
+ * Obtain a reference to the WebResourceRoot of which this WebResource is a
+ * part.
+ */
+WebResourceRoot getWebResourceRoot();
+}

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

Added: 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/WebResourceRoot.java
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/catalina/WebResourceRoot.java?rev=1382551&view=auto
=

svn commit: r1382552 - in /tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources: ./ DirResourceSet.java EmptyResource.java FileResource.java JarResource.java JarResourceSet.java Standa

2012-09-09 Thread markt
Author: markt
Date: Sun Sep  9 18:15:01 2012
New Revision: 1382552

URL: http://svn.apache.org/viewvc?rev=1382552&view=rev
Log:
Initial implementation of new resources API

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

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

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

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

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

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

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

Propchange: 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/
--
bugtraq:append = false

Propchange: 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/
--
bugtraq:label = Bugzilla ID (optional)

Propchange: 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/
--
--- bugtraq:message (added)
+++ bugtraq:message Sun Sep  9 18:15:01 2012
@@ -0,0 +1 @@
+Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=%BUGID%

Propchange: 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/
--
bugtraq:url = https://issues.apache.org/bugzilla/show_bug.cgi?id=%BUGID%

Added: 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/DirResourceSet.java
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/DirResourceSet.java?rev=1382552&view=auto
==
--- 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/DirResourceSet.java
 (added)
+++ 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/DirResourceSet.java
 Sun Sep  9 18:15:01 2012
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.catalina.webresources;
+
+import java.io.File;
+import java.io.InputStream;
+import java.util.Set;
+
+import org.apache.catalina.WebResource;
+import org.apache.catalina.WebResourceRoot;
+import org.apache.catalina.WebResourceSet;
+import org.apache.catalina.util.ResourceSet;
+
+public class DirResourceSet implements WebResourceSet {
+
+private static final String[] EMPTY_STRING_ARRAY = new String[0];
+
+private final WebResourceRoot root;
+private final File base;
+private final String webAppMount;
+
+public DirResourceSet(WebResourceRoot root, File base, String webAppMount,
+String internalPath) {
+this.root = root;
+base = new File(base, internalPath);
+if (base.isDirectory() == false) {
+throw new IllegalArgumentException(
+"TODO-i18n: base/internalPath is not a directory");
+}
+this.base = base;
+this.webAppMount = webAppMount;
+}
+
+@Override
+public WebResource getResource(String path) {
+if (path.startsWith(webAppMount)) {
+File f = new File(base, path.substring(webAppMount.length()));
+return new FileResource(root, f, path);
+} else {
+return new EmptyResource(root, path);
+}
+}
+
+@Override
+public String[] list(String path) {
+if (path.startsWith(webAppMount)) {
+File f = new File(base, path.substring(webAppMount.length()));
+String[] result = f.list();
+if (result == null) {
+return EMPTY_STRING_ARRAY;
+} else {
+return result;
+}
+} else {
+return EMPTY_STRING_ARRAY;
+

Resources - Remaining TODOs

2012-09-09 Thread Mark Thomas
This thread is for tracking the remaining TODO items.

An initial brain dump of to do items:

1. Run Tomcat 7 TCKs
   a) To check they pass (minus the API tests which will fail)
   b) to compare the performance

2. Add the ability to configure the new resources via context.xml /
   server.xml and document them.

3. Complete all TODOs in the code.

4. Remove the old resources implementation and associated supporting
   infrastructure (including tests).

Mark

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



Resources - The need for refactoring

2012-09-09 Thread Mark Thomas
This is issue a) in Konstantin's comments in TOMCAT-NEXT.txt

My expectation is that the need for refactoring in some form or another
is clear. Currently Tomcat has the following features:
- aliases
- resource JARs
- VirtualDirContext / VirtualLoader

and in Servlet 3.1 there will be overlays. [1]

Each of these features (except overlays which isn't implemented yet)
does almost the same thing each in slightly different ways. The code is
already quite messy and adding overlay support is going to be really
difficult without some refactoring. The various bugs we have seen in the
Virtual[Context|Loader] implementation hasn't been great and I am
concerned that an overlay implementation built on the existing code will
be fragile.

A refactored, coherent resources implementation will make implementing
overlays a lot simpler. The new resources implementation I just
committed already supports overlays - it just needs plumbing in to
whatever API the Servlet EG defines.

I view this issue not as what the refactoring should look like but that
there is a need for a refactoring of some form before any further
features are added for resource handling.

Mark




[1] Overlays are WARs that are used to complete / modify a base WAR and
are intended for multi-tenancy type applications. Think company hosting
accounting services with one big WAR to provide the accountancy
application and one small WAR per customer to customise the UI each
customer gets. Not necessarily a perfect example but you get the idea.
Personally, I'd solve the issue at build time with one WAR per customer
but I think that this idea isn;t going to go away.

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



Resources - Performance (caching)

2012-09-09 Thread Mark Thomas
This is part of issue b) in Konstantin's comments in TOMCAT-NEXT.txt

The current DirContext implementation supports caching in most but not
all circumstances. It would be possible to insert a cache into the
StandardRoot implementation but I am not convinced it is necessary. The
read-cache built into most HDDs may be sufficient. Before starting a
cache implementation, I would like to see some performance test cases
that demonstrate that the DirContext implementation with caching is
significantly faster than the new implementation without caching.

Mark

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



Resources - Is DirContext the right basis for the API?

2012-09-09 Thread Mark Thomas
This is part of issue b) in Konstantin's comments in TOMCAT-NEXT.txt

Konstantin has accurately summed up the issues with basing the API on
DirContext as:
 - Unnecessary objects, e.g. NamingException instead of null.

 - Too many methods. Name vs. String. list() vs. listBindings().

 - Limited API. As a workaround, there are non-standard methods that
   are implemented on BaseDirContext instead, e.g. getRealPath(),
   doListBindings(..).

I do not believe that the resources implementation should be based
around DirContext. It adds a lot of unnecessary clutter and complexity
to something that is already fairly complex. A comparison of the
DirContext based implementation objects with the new implementation
demonstrates - in my view - how much simpler this could be.

Mark

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



Re: Resources - Performance (caching)

2012-09-09 Thread Mark Thomas
On 09/09/2012 19:44, Mark Thomas wrote:
> This is part of issue b) in Konstantin's comments in TOMCAT-NEXT.txt
> 
> The current DirContext implementation supports caching in most but not
> all circumstances. It would be possible to insert a cache into the
> StandardRoot implementation but I am not convinced it is necessary. The
> read-cache built into most HDDs may be sufficient. Before starting a
> cache implementation, I would like to see some performance test cases
> that demonstrate that the DirContext implementation with caching is
> significantly faster than the new implementation without caching.

I would add that if even if the new implementation without caching
performs roughly the same as the old implementation with caching but
adding caching makes the new implementation even faster than that would
also convince me of the need to add caching although not with the same
priority.

Mark


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



Resources - WebappClassLoader and resource access

2012-09-09 Thread Mark Thomas
This is issue c) in Konstantin's comments in TOMCAT-NEXT.txt

The WebappClassLoader currently makes copies of various resources to
work-around various issues. Providing that these copies are internal to
the WebappClassLoader then I do not see this issue as directly affecting
the refactoring of the Resources implementation.

However, if there is scope with a new resources implementation to reduce
/ remove the need for these copies then we should consider it. I think
the approach should be:
- complete the new resources implementation, refactoring
  WebappClassLoader as little as possible
- review the resource copying in WebappClassLoader and see what can be
  removed in light of the new resources implementation
- review what further resources implementation changes could be
  implemented to further reduce / eliminate resource copying.

Mark

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



Resources - JarScanner / WebappClassLoader

2012-09-09 Thread Mark Thomas
This is issue d) in Konstantin's comments in TOMCAT-NEXT.txt

Konstantin is right to point out the inefficiencies in JarScanner. There
is no need to scan WEB-INF/lib and WEB-INF/classes as the class path
from the WebappClassLoader already includes them.

However, I think this can be considered separately from the Resources
implementation. My suggestion is to open a BZ enhancement request for this.

My one comment is that we'll need to be careful to retain the current
functionality of having the option to scan just WEB-INF or the entire
class path.

Mark

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



svn commit: r1382561 - /tomcat/sandbox/trunk-resources/java/org/apache/catalina/loader/VirtualWebappLoader.java

2012-09-09 Thread markt
Author: markt
Date: Sun Sep  9 19:04:52 2012
New Revision: 1382561

URL: http://svn.apache.org/viewvc?rev=1382561&view=rev
Log:
Remove file that no longer compiles

Removed:

tomcat/sandbox/trunk-resources/java/org/apache/catalina/loader/VirtualWebappLoader.java


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



Resources - Custom URL scheme for unified access

2012-09-09 Thread Mark Thomas
This is issue e) in Konstantin's comments in TOMCAT-NEXT.txt

Copying Konstantin's notes:

 Goodies:
 - Uniform URL space. Both files and directories can be represented,
 hiding details of aliases, resource jars, etc.

 - It hides implementation details.

 - Permissions can be expressed as JndiPermission. They do not
 depend on context version number.

 - Accessing a resource through such URL leverages the cache
 implemented in ProxyDirContext class. We do not access the file
 system directly, nor need to open a JAR file.

 - It can be created from a String if necessary.

 Such use relies on DirContextURLStreamHandler.bindThread(..) being
 called earlier in the same thread.

 Concerns:
 - Some components would like to get "real" resource URL from this
 one.

 Maybe it can be exposed through some special header name,
 DirContextURLConnection.getHeaderField(str)?

 How such real URL can be prepared?
 DirContext.getNameInNamespace()?
 BaseDirContext.getRealPath()?

((FileResourceAttributes)DirContext.getAttributes()).getCanonicalPath()?

 - A resource lookup is performed twice. The first time in
 ServletContext.getResource() (implemented in
 ApplicationContext.getResource()) to return null for non-existing
 paths.
 The second time in DirContextURLConnection.connect().

 It is good that there is a cache in ProxyDirContext that saves time
 for repeated lookups.

 - Using URLs involves encoding/decoding.

 If there were some other API to access resources in a web
 application,  I would prefer some opaque object that allows access
 to resource properties, but is converted to string/url form only
 on demand.


I think this boils down to "Is there a requirement for a scheme that
provides unified URLs?" While it does hide the details of where stuff is
from an application, if does so with a layer of indirection and that has
a performance cost. Note: Performance / caching is a separate issue and
I have already created a separate thread for that.

If this feature is required, it can be added by modifying / wrapping the
StandardRoot implementation. Currently, I think the only reason we might
need this is if we need caching for performance then we'll need a custom
URL scheme to ensure access via URLs goes through the cache. Therefore,
in my view, resolving this issue depends on determining if caching (in a
similar manner to the current implementation) is required.

Mark

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



Resources - Custom URL connections

2012-09-09 Thread Mark Thomas
This is issue f) in Konstantin's comments in TOMCAT-NEXT.txt

This issue only applies if a custom URL scheme is required. I think we
should park this issue until that question is answered.

Mark

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



svn commit: r1382563 - /tomcat/sandbox/trunk-resources/test/org/apache/catalina/core/TestStandardContextAliases.java

2012-09-09 Thread markt
Author: markt
Date: Sun Sep  9 19:35:15 2012
New Revision: 1382563

URL: http://svn.apache.org/viewvc?rev=1382563&view=rev
Log:
Get test working with new Resources implementation

Modified:

tomcat/sandbox/trunk-resources/test/org/apache/catalina/core/TestStandardContextAliases.java

Modified: 
tomcat/sandbox/trunk-resources/test/org/apache/catalina/core/TestStandardContextAliases.java
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/test/org/apache/catalina/core/TestStandardContextAliases.java?rev=1382563&r1=1382562&r2=1382563&view=diff
==
--- 
tomcat/sandbox/trunk-resources/test/org/apache/catalina/core/TestStandardContextAliases.java
 (original)
+++ 
tomcat/sandbox/trunk-resources/test/org/apache/catalina/core/TestStandardContextAliases.java
 Sun Sep  9 19:35:15 2012
@@ -32,8 +32,10 @@ import static org.junit.Assert.assertTru
 
 import org.junit.Test;
 
+import org.apache.catalina.WebResourceRoot;
 import org.apache.catalina.startup.Tomcat;
 import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.catalina.webresources.StandardRoot;
 import org.apache.tomcat.util.buf.ByteChunk;
 
 public class TestStandardContextAliases extends TomcatBaseTest {
@@ -47,7 +49,10 @@ public class TestStandardContextAliases 
 tomcat.addContext("", System.getProperty("java.io.tmpdir"));
 
 File lib = new File("webapps/examples/WEB-INF/lib");
-ctx.setAliases("/WEB-INF/lib=" + lib.getCanonicalPath());
+ctx.setResources(new StandardRoot(ctx));
+ctx.getResources().createWebResourceSet(
+WebResourceRoot.ResourceSetType.POST, lib, "/WEB-INF/lib", "");
+
 
 Tomcat.addServlet(ctx, "test", new TestServlet());
 ctx.addServletMapping("/", "test");



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



svn commit: r1382579 - in /tomcat/sandbox/trunk-resources/java/org/apache/catalina: WebResourceRoot.java loader/WebappClassLoader.java webresources/StandardRoot.java

2012-09-09 Thread markt
Author: markt
Date: Sun Sep  9 21:00:38 2012
New Revision: 1382579

URL: http://svn.apache.org/viewvc?rev=1382579&view=rev
Log:
I'm not convinced this is desirable or even necessary but the current unit 
tests expect to be able to list all matching resources even though only one of 
them will ever be used. I would prefer to never expose the others.

Modified:
tomcat/sandbox/trunk-resources/java/org/apache/catalina/WebResourceRoot.java

tomcat/sandbox/trunk-resources/java/org/apache/catalina/loader/WebappClassLoader.java

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

Modified: 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/WebResourceRoot.java
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/catalina/WebResourceRoot.java?rev=1382579&r1=1382578&r2=1382579&view=diff
==
--- 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/WebResourceRoot.java 
(original)
+++ 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/WebResourceRoot.java 
Sun Sep  9 21:00:38 2012
@@ -98,6 +98,21 @@ public interface WebResourceRoot extends
 WebResource getResource(String path);
 
 /**
+ * Obtain the object(s) that represent the resource at the given path. Note
+ * that the resource at that path may not exist. If the path does not
+ * exist, the WebResource returned will be associated with the main
+ * WebResourceSet. This will include all matches even if the resource would
+ * not normally be accessible (e.g. because it was overridden by another
+ * resource)
+ *
+ * @param path  The path for the resource of interest relative to the root
+ *  of the web application. It must start with '/'.
+ *
+ * @return  The object that represents the resource at the given path
+ */
+WebResource[] getResources(String path);
+
+/**
  * Obtain the list of the names of all of the files and directories located
  * in the specified directory.
  *

Modified: 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/loader/WebappClassLoader.java
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/catalina/loader/WebappClassLoader.java?rev=1382579&r1=1382578&r2=1382579&view=diff
==
--- 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/loader/WebappClassLoader.java
 (original)
+++ 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/loader/WebappClassLoader.java
 Sun Sep  9 21:00:38 2012
@@ -1086,12 +1086,11 @@ public class WebappClassLoader
 int jarFilesLength = jarFiles.length;
 
 // Looking at the repository
-try {
-if (resources.getResource(repository + name).exists()) {
-result.add(getURI(new File(file, name)));
+WebResource[] webResources = resources.getResources(repository + name);
+for (WebResource webResource : webResources) {
+if (webResource.exists()) {
+result.add(webResource.getURL());
 }
-} catch (MalformedURLException e) {
-// Ignore
 }
 
 // Looking at the JAR files

Modified: 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/StandardRoot.java
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/StandardRoot.java?rev=1382579&r1=1382578&r2=1382579&view=diff
==
--- 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/StandardRoot.java
 (original)
+++ 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/StandardRoot.java
 Sun Sep  9 21:00:38 2012
@@ -125,6 +125,27 @@ public class StandardRoot extends Lifecy
 }
 
 @Override
+public WebResource[] getResources(String path) {
+checkState();
+
+ArrayList result = new ArrayList<>();
+for (ArrayList list : allResources) {
+for (WebResourceSet webResourceSet : list) {
+WebResource webResource = webResourceSet.getResource(path);
+if (webResource.exists()) {
+result.add(webResource);
+}
+}
+}
+
+if (result.size() == 0) {
+result.add(main.getResource(path));
+}
+
+return result.toArray(new WebResource[result.size()]);
+}
+
+@Override
 public WebResource[] listResources(String path) {
 checkState();
 



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



svn commit: r1382580 - /tomcat/sandbox/trunk-resources/test/org/apache/naming/resources/TestProxyDirContext.java

2012-09-09 Thread markt
Author: markt
Date: Sun Sep  9 21:12:27 2012
New Revision: 1382580

URL: http://svn.apache.org/viewvc?rev=1382580&view=rev
Log:
Remove test that is no longer required

Removed:

tomcat/sandbox/trunk-resources/test/org/apache/naming/resources/TestProxyDirContext.java


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



svn commit: r1382582 - in /tomcat/sandbox/trunk-resources/java/org/apache/catalina: WebResource.java webresources/FileResource.java webresources/StandardRoot.java

2012-09-09 Thread markt
Author: markt
Date: Sun Sep  9 21:25:05 2012
New Revision: 1382582

URL: http://svn.apache.org/viewvc?rev=1382582&view=rev
Log:
Clarify behaviour of WebResource#getURL() if the resource does not exist and 
implement the correct behaviour consistently.

Modified:
tomcat/sandbox/trunk-resources/java/org/apache/catalina/WebResource.java

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

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

Modified: 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/WebResource.java
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/catalina/WebResource.java?rev=1382582&r1=1382581&r2=1382582&view=diff
==
--- tomcat/sandbox/trunk-resources/java/org/apache/catalina/WebResource.java 
(original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/catalina/WebResource.java 
Sun Sep  9 21:25:05 2012
@@ -122,7 +122,7 @@ public interface WebResource {
 
 /**
  * Obtain a URL to access the resource or null if no such URL
- * is available.
+ * is available or if the resource does not exist.
  */
 URL getURL();
 

Modified: 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/FileResource.java
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/FileResource.java?rev=1382582&r1=1382581&r2=1382582&view=diff
==
--- 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/FileResource.java
 (original)
+++ 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/FileResource.java
 Sun Sep  9 21:25:05 2012
@@ -146,10 +146,14 @@ public class FileResource implements Web
 
 @Override
 public URL getURL() {
-try {
-return resource.toURI().toURL();
-} catch (MalformedURLException e) {
-// TODO Log this?
+if (resource.exists()) {
+try {
+return resource.toURI().toURL();
+} catch (MalformedURLException e) {
+// TODO Log this?
+return null;
+}
+} else {
 return null;
 }
 }

Modified: 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/StandardRoot.java
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/StandardRoot.java?rev=1382582&r1=1382581&r2=1382582&view=diff
==
--- 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/StandardRoot.java
 (original)
+++ 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/StandardRoot.java
 Sun Sep  9 21:25:05 2012
@@ -121,7 +121,7 @@ public class StandardRoot extends Lifecy
 }
 
 // Default is empty resource in main resources
-return main.getResource(path);
+return new EmptyResource(this, path);
 }
 
 @Override



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



svn commit: r1382587 - in /tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources: DirResourceSet.java FileResource.java

2012-09-09 Thread markt
Author: markt
Date: Sun Sep  9 21:54:15 2012
New Revision: 1382587

URL: http://svn.apache.org/viewvc?rev=1382587&view=rev
Log:
Special case to handle Resource JARs that have been unpacked under 
/WEB-INF/classes
Eclipse requires this

Modified:

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

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

Modified: 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/DirResourceSet.java
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/DirResourceSet.java?rev=1382587&r1=1382586&r2=1382587&view=diff
==
--- 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/DirResourceSet.java
 (original)
+++ 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/DirResourceSet.java
 Sun Sep  9 21:54:15 2012
@@ -22,6 +22,7 @@ import java.util.Set;
 
 import org.apache.catalina.WebResource;
 import org.apache.catalina.WebResourceRoot;
+import org.apache.catalina.WebResourceRoot.ResourceSetType;
 import org.apache.catalina.WebResourceSet;
 import org.apache.catalina.util.ResourceSet;
 
@@ -43,6 +44,16 @@ public class DirResourceSet implements W
 }
 this.base = base;
 this.webAppMount = webAppMount;
+
+// Special case to handle Resource JARs that have been unpacked under
+// /WEB-INF/classes
+WebResource unpackedResourceJar =
+getResource("/WEB-INF/classes/META-INF/resources");
+if (unpackedResourceJar.exists()) {
+root.createWebResourceSet(ResourceSetType.RESOURCE_JAR,
+((FileResource) unpackedResourceJar).getResourceInternal() 
,
+"", "");
+}
 }
 
 @Override

Modified: 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/FileResource.java
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/FileResource.java?rev=1382587&r1=1382586&r2=1382587&view=diff
==
--- 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/FileResource.java
 (original)
+++ 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/FileResource.java
 Sun Sep  9 21:54:15 2012
@@ -162,4 +162,8 @@ public class FileResource implements Web
 public WebResourceRoot getWebResourceRoot() {
 return root;
 }
+
+protected File getResourceInternal() {
+return resource;
+}
 }



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



svn commit: r1382591 - /tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/DirResourceSet.java

2012-09-09 Thread markt
Author: markt
Date: Sun Sep  9 22:03:04 2012
New Revision: 1382591

URL: http://svn.apache.org/viewvc?rev=1382591&view=rev
Log:
// -> /

Modified:

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

Modified: 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/DirResourceSet.java
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/DirResourceSet.java?rev=1382591&r1=1382590&r2=1382591&view=diff
==
--- 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/DirResourceSet.java
 (original)
+++ 
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/DirResourceSet.java
 Sun Sep  9 22:03:04 2012
@@ -89,7 +89,7 @@ public class DirResourceSet implements W
 String[] list = f.list();
 if (list != null) {
 for (String entry : list) {
-result.add(path + "/" + entry);
+result.add(path + entry);
 }
 }
 }



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



svn commit: r1382602 - /tomcat/sandbox/trunk-resources/test/org/apache/catalina/loader/TestVirtualContext.java

2012-09-09 Thread markt
Author: markt
Date: Sun Sep  9 22:36:52 2012
New Revision: 1382602

URL: http://svn.apache.org/viewvc?rev=1382602&view=rev
Log:
Tweak unit test to work with new resources - still fails. There is work to do 
in the JarScanner.

Modified:

tomcat/sandbox/trunk-resources/test/org/apache/catalina/loader/TestVirtualContext.java

Modified: 
tomcat/sandbox/trunk-resources/test/org/apache/catalina/loader/TestVirtualContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/test/org/apache/catalina/loader/TestVirtualContext.java?rev=1382602&r1=1382601&r2=1382602&view=diff
==
--- 
tomcat/sandbox/trunk-resources/test/org/apache/catalina/loader/TestVirtualContext.java
 (original)
+++ 
tomcat/sandbox/trunk-resources/test/org/apache/catalina/loader/TestVirtualContext.java
 Sun Sep  9 22:36:52 2012
@@ -31,11 +31,12 @@ import static org.junit.Assert.assertTru
 import org.junit.Assert;
 import org.junit.Test;
 
+import org.apache.catalina.WebResourceRoot;
 import org.apache.catalina.core.JreMemoryLeakPreventionListener;
 import org.apache.catalina.core.StandardContext;
 import org.apache.catalina.startup.Tomcat;
 import org.apache.catalina.startup.TomcatBaseTest;
-import org.apache.naming.resources.VirtualDirContext;
+import org.apache.catalina.webresources.StandardRoot;
 import org.apache.tomcat.util.buf.ByteChunk;
 import org.apache.tomcat.util.http.fileupload.FileUtils;
 import org.apache.tomcat.util.http.fileupload.IOUtils;
@@ -66,20 +67,27 @@ public class TestVirtualContext extends 
 StandardContext ctx = (StandardContext) tomcat.addWebapp(null, "/test",
 appDir.getAbsolutePath());
 
-VirtualWebappLoader loader = new 
VirtualWebappLoader(ctx.getParentClassLoader());
-loader.setVirtualClasspath(//
-"test/webapp-3.0-virtual-webapp/target/classes;" + //
-"test/webapp-3.0-virtual-library/target/classes;" + //
-
"test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/classes;" + //
+ctx.setResources(new StandardRoot(ctx));
+File f1 = new File("test/webapp-3.0-virtual-webapp/target/classes");
+File f2 = new File("test/webapp-3.0-virtual-library/target/classes");
+File f3 = new File(
+
"test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/classes");
+File f4 = new File(
 
"test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes");
-ctx.setLoader(loader);
-
-String extraMappings = 
"/=test/webapp-3.0-virtual-webapp/src/main/webapp2" + //
-",/other=test/webapp-3.0-virtual-webapp/src/main/misc" + //
-",/WEB-INF/classes=test/webapp-3.0-virtual-webapp/target/classes";
-VirtualDirContext resources = new VirtualDirContext();
-resources.setExtraResourcePaths(extraMappings);
-ctx.setResources(resources);
+File f5 = new File("test/webapp-3.0-virtual-webapp/src/main/misc");
+File f6 = new File("test/webapp-3.0-virtual-webapp/src/main/webapp2");
+ctx.getResources().createWebResourceSet(
+WebResourceRoot.ResourceSetType.POST, f1, "/WEB-INF/classes", 
"");
+ctx.getResources().createWebResourceSet(
+WebResourceRoot.ResourceSetType.POST, f2, "/WEB-INF/classes", 
"");
+ctx.getResources().createWebResourceSet(
+WebResourceRoot.ResourceSetType.POST, f3, "/WEB-INF/classes", 
"");
+ctx.getResources().createWebResourceSet(
+WebResourceRoot.ResourceSetType.POST, f4, "/WEB-INF/classes", 
"");
+ctx.getResources().createWebResourceSet(
+WebResourceRoot.ResourceSetType.POST, f5, "/other", "");
+ctx.getResources().createWebResourceSet(
+WebResourceRoot.ResourceSetType.POST, f6, "", "");
 
 StandardJarScanner jarScanner = new StandardJarScanner();
 jarScanner.setScanAllDirectories(true);
@@ -261,11 +269,13 @@ public class TestVirtualContext extends 
 annotatedServletClassInputStream.close();
 annotatedServletClassOutputStream.close();
 
-VirtualWebappLoader loader = new 
VirtualWebappLoader(ctx.getParentClassLoader());
-
loader.setVirtualClasspath("test/webapp-3.0-virtual-webapp/target/classes;" + //
-"test/webapp-3.0-virtual-library/target/classes;" + //
-additionWebInfClasses.getAbsolutePath());
-ctx.setLoader(loader);
+ctx.setResources(new StandardRoot(ctx));
+File f1 = new File("test/webapp-3.0-virtual-webapp/target/classes");
+File f2 = new File("test/webapp-3.0-virtual-library/target/classes");
+ctx.getResources().createWebResourceSet(
+WebResourceRoot.ResourceSetType.POST, f1, "/WEB-INF/classes", 
"");
+ctx.getResources().createWebResourceSet(
+WebResourceRoot.ResourceSetType.POST, f2, "/WEB-INF/classes", 
"");
 
   

Re: svn commit: r1382367 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/ java/org/apache/catalina/core/ java/org/apache/catalina/startup/ webapps/docs/ webapps/docs/config/

2012-09-09 Thread Keiichi Fujino
>
>  /**
> + * Check for old versions of applications using parallel deployment that 
> are
> + * now unused (have no active sessions) and undeploy any that are found.
> + */
> +public void checkUndeploy() {
> +// Need ordered set of names
> +SortedSet sortedAppNames = new TreeSet();
> +sortedAppNames.addAll(deployed.keySet());
> +
> +if (sortedAppNames.size() < 2) {
> +return;
> +}
> +Iterator iter = sortedAppNames.iterator();
> +
> +ContextName previous = new ContextName(iter.next());
> +do {
> +ContextName current = new ContextName(iter.next());
> +
> +if (current.getPath().equals(previous.getPath())) {
> +// Current and previous are same version - current will 
> always
> +// be a later version
> +Context context = (Context) 
> host.findChild(previous.getName());
> +if (context != null) {
> +Manager manager = context.getManager();
> +if (manager != null && manager.getActiveSessions() == 0) 
> {

manager.getActiveSessions() returns the various numbers of sessions
according to the kind of Manager.

1.
In BackupManager, manager.getActiveSessions() returns the number of a
primary and backup sessions.
A proxy session is not contained.
Thus manager only with a proxy session will be deleted.
(e.g. manager which newly joined in the cluster has only a proxy session.)
It is necessary to call DistributedManager#getActiveSessionsFull()
instead of manager.getActiveSessions().

2.
In PersistentManage, it may be necessary to take into consideration
also about the session saved in Store.
It should be deleted only when both manager.getActiveSessions() and
Store#getSize are 0.

Although it is possible to add these two cases,
It seems that it is better to define method which checks number of
sessions in a Manager/ManagerBase.


-- 
Keiichi.Fujino

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



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

2012-09-09 Thread Gump
To whom it may engage...

This is an automated request, but not an unsolicited one. For 
more information please visit http://gump.apache.org/nagged.html, 
and/or contact the folk at gene...@gump.apache.org.

Project tomcat-taglibs-standard has an issue affecting its community 
integration.
This issue affects 2 projects,
 and has been outstanding for 65 runs.
The current state of this project is 'Failed', with reason 'Build Failed'.
For reference only, the following projects are affected by this:
- tomcat-taglibs-standard :  Standard Taglib
- tomcat-taglibs-standard-install :  JSP Taglibs


Full details are available at:

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

That said, some information snippets are provided here.

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



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

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