Bug report for Tomcat 5 [2012/06/03]

2012-06-03 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  |
| |   |   |  |  |
|52579|New|Reg|2012-02-02|Tomcat5.5.35?Java1.5 cannot return proper value of|
+-+---+---+--+--+
| Total1 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/06/03]

2012-06-03 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 Connectors [2012/06/03]

2012-06-03 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 |
+-+---+---+--+--+
| Total   39 bugs   |
+---+

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



Bug report for Tomcat 6 [2012/06/03]

2012-06-03 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 |
|44312|New|Enh|2008-01-28|Warn when overwritting docBase of the default Host|
|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|
|45995|New|Enh|2008-10-13|RFE - MIME type extension not case sensitive  |
|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|
|47785|Opn|Enh|2009-09-04|Cluster MBean not registered  |
|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.|
|48600|Opn|Enh|2010-01-22|Performance issue with tags   |
|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|
|48956|Opn|Enh|2010-03-22|SSI regular expressions not working   |
|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  |

Bug report for Tomcat 7 [2012/06/03]

2012-06-03 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 |
|52135|Opn|Enh|2011-11-04|Global error page is not handled  |
|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|
|52777|New|Enh|2012-02-27|Automatically shut down old versions in parallel d|
|52952|New|Enh|2012-03-20|Improve ExtensionValidator handling for embedded s|
|52954|New|Enh|2012-03-21|Allowing for broken android HTTP DIGEST support   |
|52955|New|Enh|2012-03-21|Add a ThreadFactory implementation to the Executor|
|52999|New|Enh|2012-03-28|Performance issue with locking in ContainerBase.fi|
|53008|New|Enh|2012-03-30|New test case for Basic Authenticator |
|53074|New|Nor|2012-04-13|[websocket] java.net.SocketTimeoutException: Read |
|53085|New|Enh|2012-04-16|[perf] [concurrency] DefaultInstanceManager.annota|
|53096|New|Enh|2012-04-17|New test cases for TestDigestAuthenticator|
|53230|New|Enh|2012-05-14|Allow custom error mapping when Manager's maxActiv|
|53266|New|Enh|2012-05-20|ServletContainerInitializer will crash catalina if|
|53337|New|Nor|2012-05-31|IllegalStateException when trying to render a JSP |

Bug report for Tomcat Modules [2012/06/03]

2012-06-03 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|
|52318|Inf|Cri|2011-12-11|Version in tomcat-jdbc POM is conflicted with Vers|
|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|
|53346|New|Nor|2012-06-01|Support for changing MaxActive via JMX|
+-+---+---+--+--+
| Total   15 bugs   |
+---+

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



Bug report for Tomcat Native [2012/06/03]

2012-06-03 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 |
+-+---+---+--+--+
| Total   12 bugs   |
+---+

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



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

2012-06-03 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 12 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: 22 mins 28 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-03062012.jar 
-Dcommons-daemon.native.src.tgz=/srv/gump/public/workspace/apache-commons/daemon/dist/bin/commons-daemon-03062012-native-src.tar.gz
 
-Dtomcat-native.tar.gz=/srv/gump/public/workspace/apache-commons/daemon/dist/bin/commons-daemon-03062012-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-03062012.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-03062012.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-jni.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
 

[Bug 53333] NPE is thrown for env-entry without env-entry-type but with injection-target specified

2012-06-03 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=5

--- Comment #4 from Violeta Georgieva violet...@apache.org ---
Thanks

-- 
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: r1345688 - in /tomcat/trunk: java/org/apache/catalina/core/ApplicationDispatcher.java test/org/apache/catalina/core/TestAsyncContextImpl.java

2012-06-03 Thread markt
Author: markt
Date: Sun Jun  3 15:50:50 2012
New Revision: 1345688

URL: http://svn.apache.org/viewvc?rev=1345688view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53337
Fix RequestDispatcher.forward() to an async servlet

Modified:
tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java
tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java

Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java?rev=1345688r1=1345687r2=1345688view=diff
==
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java Sun 
Jun  3 15:50:50 2012
@@ -382,6 +382,12 @@ final class ApplicationDispatcher
 processRequest(request,response,state);
 }
 
+if (request.getAsyncContext() != null) {
+// An async request was started during the forward, don't close the
+// response as it may be written to during the async handling
+return;
+}
+
 // This is not a real close in order to support error processing
 if (wrapper.getLogger().isDebugEnabled() )
 wrapper.getLogger().debug( Disabling the response for futher 
output);

Modified: tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java?rev=1345688r1=1345687r2=1345688view=diff
==
--- tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java 
(original)
+++ tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java Sun 
Jun  3 15:50:50 2012
@@ -22,10 +22,13 @@ import java.io.IOException;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
 
 import javax.servlet.AsyncContext;
 import javax.servlet.AsyncEvent;
 import javax.servlet.AsyncListener;
+import javax.servlet.RequestDispatcher;
 import javax.servlet.ServletException;
 import javax.servlet.ServletRequestEvent;
 import javax.servlet.ServletRequestListener;
@@ -1275,4 +1278,86 @@ public class TestAsyncContextImpl extend
 }
 }
 }
+
+@Test
+public void testBug53337() throws Exception {
+// Setup Tomcat instance
+Tomcat tomcat = getTomcatInstance();
+
+// Must have a real docBase - just use temp
+File docBase = new File(System.getProperty(java.io.tmpdir));
+
+Context ctx = tomcat.addContext(, docBase.getAbsolutePath());
+Wrapper a = Tomcat.addServlet(ctx, ServletA, new Bug53337ServletA());
+a.setAsyncSupported(true);
+Wrapper b = Tomcat.addServlet(ctx, ServletB, new Bug53337ServletB());
+b.setAsyncSupported(true);
+Tomcat.addServlet(ctx, ServletC, new Bug53337ServletC());
+ctx.addServletMapping(/ServletA, ServletA);
+ctx.addServletMapping(/ServletB, ServletB);
+ctx.addServletMapping(/ServletC, ServletC);
+
+tomcat.start();
+
+StringBuilder url = new StringBuilder(48);
+url.append(http://localhost:;);
+url.append(getPort());
+url.append(/ServletA);
+
+ByteChunk body = new ByteChunk();
+int rc = getUrl(url.toString(), body, null);
+
+assertEquals(HttpServletResponse.SC_OK, rc);
+assertEquals(OK, body.toString());
+}
+
+private static class Bug53337ServletA extends HttpServlet {
+
+private static final long serialVersionUID = 1L;
+
+@Override
+protected void doGet(HttpServletRequest req, HttpServletResponse resp)
+throws ServletException, IOException {
+RequestDispatcher rd = req.getRequestDispatcher(/ServletB);
+rd.forward(req, resp);
+}
+}
+
+private static class Bug53337ServletB extends HttpServlet {
+
+private static final long serialVersionUID = 1L;
+
+@Override
+protected void doGet(final HttpServletRequest req,
+final HttpServletResponse resp)
+throws ServletException, IOException {
+
+final AsyncContext async = req.startAsync();
+// Just for debugging
+async.setTimeout(10);
+
+ExecutorService executor = Executors.newSingleThreadExecutor();
+executor.submit(new Runnable() {
+
+@Override
+public void run() {
+async.dispatch(/ServletC);
+}
+});
+executor.shutdown();
+}
+}
+
+private static class Bug53337ServletC extends HttpServlet {
+
+

svn commit: r1345689 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/core/ApplicationDispatcher.java test/org/apache/catalina/core/TestAsyncContextImpl.java webapps/docs/changelog.xml

2012-06-03 Thread markt
Author: markt
Date: Sun Jun  3 15:54:28 2012
New Revision: 1345689

URL: http://svn.apache.org/viewvc?rev=1345689view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53337
Fix RequestDispatcher.forward() to an async servlet. Includes a test case based 
on code by Rossen Stoyanchev.

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

tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

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

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java?rev=1345689r1=1345688r2=1345689view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java 
(original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java 
Sun Jun  3 15:54:28 2012
@@ -402,6 +402,12 @@ final class ApplicationDispatcher
 processRequest(request,response,state);
 }
 
+if (request.getAsyncContext() != null) {
+// An async request was started during the forward, don't close the
+// response as it may be written to during the async handling
+return;
+}
+
 // This is not a real close in order to support error processing
 if (wrapper.getLogger().isDebugEnabled() )
 wrapper.getLogger().debug( Disabling the response for futher 
output);

Modified: 
tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java?rev=1345689r1=1345688r2=1345689view=diff
==
--- 
tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java 
(original)
+++ 
tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java 
Sun Jun  3 15:54:28 2012
@@ -22,10 +22,13 @@ import java.io.IOException;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
 
 import javax.servlet.AsyncContext;
 import javax.servlet.AsyncEvent;
 import javax.servlet.AsyncListener;
+import javax.servlet.RequestDispatcher;
 import javax.servlet.ServletException;
 import javax.servlet.ServletRequestEvent;
 import javax.servlet.ServletRequestListener;
@@ -1275,4 +1278,86 @@ public class TestAsyncContextImpl extend
 }
 }
 }
+
+@Test
+public void testBug53337() throws Exception {
+// Setup Tomcat instance
+Tomcat tomcat = getTomcatInstance();
+
+// Must have a real docBase - just use temp
+File docBase = new File(System.getProperty(java.io.tmpdir));
+
+Context ctx = tomcat.addContext(, docBase.getAbsolutePath());
+Wrapper a = Tomcat.addServlet(ctx, ServletA, new Bug53337ServletA());
+a.setAsyncSupported(true);
+Wrapper b = Tomcat.addServlet(ctx, ServletB, new Bug53337ServletB());
+b.setAsyncSupported(true);
+Tomcat.addServlet(ctx, ServletC, new Bug53337ServletC());
+ctx.addServletMapping(/ServletA, ServletA);
+ctx.addServletMapping(/ServletB, ServletB);
+ctx.addServletMapping(/ServletC, ServletC);
+
+tomcat.start();
+
+StringBuilder url = new StringBuilder(48);
+url.append(http://localhost:;);
+url.append(getPort());
+url.append(/ServletA);
+
+ByteChunk body = new ByteChunk();
+int rc = getUrl(url.toString(), body, null);
+
+assertEquals(HttpServletResponse.SC_OK, rc);
+assertEquals(OK, body.toString());
+}
+
+private static class Bug53337ServletA extends HttpServlet {
+
+private static final long serialVersionUID = 1L;
+
+@Override
+protected void doGet(HttpServletRequest req, HttpServletResponse resp)
+throws ServletException, IOException {
+RequestDispatcher rd = req.getRequestDispatcher(/ServletB);
+rd.forward(req, resp);
+}
+}
+
+private static class Bug53337ServletB extends HttpServlet {
+
+private static final long serialVersionUID = 1L;
+
+@Override
+protected void doGet(final HttpServletRequest req,
+final HttpServletResponse resp)
+throws ServletException, IOException {
+
+final AsyncContext async = req.startAsync();
+// Just for debugging
+async.setTimeout(10);
+
+

[Bug 53337] IllegalStateException when trying to render a JSP after startAsync

2012-06-03 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=53337

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

   What|Removed |Added

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

--- Comment #6 from Mark Thomas ma...@apache.org ---
The bug (forwarding to an async servlet always failed) has been fixed in trunk
and 7.0.x and will be included in 7.0.28 onwards.

Re-reading the spec, it appears that the intention was that dispatches from an
async thread should always be via the AsyncContext. No mention is made of
dispatching via a RequestDispatcher. This is going to be one of those grey
areas that different containers do different ways. I believe - but haven't
tested to check all the edge cases - that in Tomcat the two would be equivalent
based on which objects Tomcat uses internally. Other containers may well be
different.

My personal recommendation would be to stick with dispatching via the
AsyncContext.

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

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



[Bug 53281] Tomcat returns garbage data with HTTP/0.9 200 OK header when SSL port is accessed using http

2012-06-03 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=53281

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

   What|Removed |Added

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

--- Comment #1 from Mark Thomas ma...@apache.org ---
This is simply not possible if the SSL connector is correctly configured.
Please use the users mailing list to identify your configuration error.

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

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



svn commit: r680 - /release/tomcat/tomcat-7/v7.0.26/

2012-06-03 Thread markt
Author: markt
Date: Sun Jun  3 16:22:35 2012
New Revision: 680

Log:
Remove old version from mirrors

Removed:
release/tomcat/tomcat-7/v7.0.26/


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



svn commit: r680 - /release/tomcat/tomcat-7/v7.0.26/

2012-06-03 Thread markt
Author: markt
Date: Sun Jun  3 16:22:35 2012
New Revision: 680

Log:
Remove old version from mirrors

Removed:
release/tomcat/tomcat-7/v7.0.26/


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



svn commit: r1345699 - /tomcat/trunk/java/org/apache/catalina/websocket/WsInputStream.java

2012-06-03 Thread markt
Author: markt
Date: Sun Jun  3 16:29:30 2012
New Revision: 1345699

URL: http://svn.apache.org/viewvc?rev=1345699view=rev
Log:
Fix typo

Modified:
tomcat/trunk/java/org/apache/catalina/websocket/WsInputStream.java

Modified: tomcat/trunk/java/org/apache/catalina/websocket/WsInputStream.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/websocket/WsInputStream.java?rev=1345699r1=1345698r2=1345699view=diff
==
--- tomcat/trunk/java/org/apache/catalina/websocket/WsInputStream.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/websocket/WsInputStream.java Sun Jun  
3 16:29:30 2012
@@ -54,7 +54,7 @@ public class WsInputStream extends Input
  * Process the next WebSocket frame.
  *
  * @param block Should this method block until a frame is presented if no
- *  data is currently available to process. Note that is a
+ *  data is currently available to process. Note that if a
  *  single byte is available, this method will block until the
  *  complete frame (excluding payload for non-control frames) 
is
  *  available.



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



[Bug 53096] New test cases for TestDigestAuthenticator

2012-06-03 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=53096

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

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |WONTFIX

--- Comment #1 from Mark Thomas ma...@apache.org ---
At least one of the additional test cases is invalid. It is testing a problem
that does not exist. See http://tomcat.markmail.org/thread/cp6t3uveslg6xecq

-- 
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: r1345704 - /tomcat/trunk/test/org/apache/catalina/authenticator/TestNonLoginAndBasicAuthenticator.java

2012-06-03 Thread markt
Author: markt
Date: Sun Jun  3 16:44:49 2012
New Revision: 1345704

URL: http://svn.apache.org/viewvc?rev=1345704view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53008
Extend test cases for BASIC auth and RFC2617 compliance

Modified:

tomcat/trunk/test/org/apache/catalina/authenticator/TestNonLoginAndBasicAuthenticator.java

Modified: 
tomcat/trunk/test/org/apache/catalina/authenticator/TestNonLoginAndBasicAuthenticator.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/authenticator/TestNonLoginAndBasicAuthenticator.java?rev=1345704r1=1345703r2=1345704view=diff
==
--- 
tomcat/trunk/test/org/apache/catalina/authenticator/TestNonLoginAndBasicAuthenticator.java
 (original)
+++ 
tomcat/trunk/test/org/apache/catalina/authenticator/TestNonLoginAndBasicAuthenticator.java
 Sun Jun  3 16:44:49 2012
@@ -93,7 +93,7 @@ public class TestNonLoginAndBasicAuthent
 @Test
 public void testAcceptPublicBasic() throws Exception {
 doTestBasic(USER, PWD, CONTEXT_PATH_LOGIN + URI_PUBLIC,
-false, 200, false, 200);
+false, false, 200, false, 200);
 }
 
 /*
@@ -104,7 +104,19 @@ public class TestNonLoginAndBasicAuthent
 @Test
 public void testAcceptProtectedBasic() throws Exception {
 doTestBasic(USER, PWD, CONTEXT_PATH_LOGIN + URI_PROTECTED,
-true, 401, false, 200);
+false, true, 401, false, 200);
+}
+
+/*
+ * Try to access a protected resource in a webapp that
+ * has a BASIC login method defined. Verify the server is
+ * prepared to accept non-standard case for the auth scheme.
+ * The access should be challenged, authenticated and then permitted.
+ */
+@Test
+public void testAuthMethodCaseBasic() throws Exception {
+doTestBasic(USER, PWD, CONTEXT_PATH_LOGIN + URI_PROTECTED,
+true, true, 401, false, 200);
 }
 
 /*
@@ -117,11 +129,11 @@ public class TestNonLoginAndBasicAuthent
 @Test
 public void testBasicLoginSessionTimeout() throws Exception {
 doTestBasic(USER, PWD, CONTEXT_PATH_LOGIN + URI_PROTECTED,
-true, 401, false, 200);
+false, true, 401, false, 200);
 // wait long enough for the session above to expire
 Thread.sleep(LONG_TIMEOUT_DELAY_MSECS);
 doTestBasic(USER, PWD, CONTEXT_PATH_LOGIN + URI_PROTECTED,
-true, 401, false, 200);
+false, true, 401, false, 200);
 }
 
 /*
@@ -134,7 +146,7 @@ public class TestNonLoginAndBasicAuthent
 @Test
 public void testBasicLoginRejectProtected() throws Exception {
 doTestBasic(USER, PWD, CONTEXT_PATH_LOGIN + URI_PROTECTED,
-true, 401, false, 200);
+false, true, 401, false, 200);
 doTestNonLogin(CONTEXT_PATH_NOLOGIN + URI_PROTECTED,
 true, 403);
 }
@@ -163,6 +175,7 @@ public class TestNonLoginAndBasicAuthent
 }
 
 private void doTestBasic(String user, String pwd, String uri,
+boolean verifyAuthSchemeCase,
 boolean expectedReject1, int expectedRC1,
 boolean expectedReject2, int expectedRC2) throws Exception {
 
@@ -190,7 +203,8 @@ public class TestNonLoginAndBasicAuthent
 String credentials = user + : + pwd;
 byte[] credentialsBytes = ByteChunk.convertToBytes(credentials);
 String base64auth = Base64.encode(credentialsBytes);
-String authLine = Basic  + base64auth;
+String authScheme = verifyAuthSchemeCase ? bAsIc  : Basic ;
+String authLine = authScheme + base64auth;
 
 ListString auth = new ArrayListString();
 auth.add(authLine);



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



svn commit: r1345705 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/websocket/WsInputStream.java

2012-06-03 Thread markt
Author: markt
Date: Sun Jun  3 16:45:26 2012
New Revision: 1345705

URL: http://svn.apache.org/viewvc?rev=1345705view=rev
Log:
Fix typo

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

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

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/websocket/WsInputStream.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/websocket/WsInputStream.java?rev=1345705r1=1345704r2=1345705view=diff
==
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/websocket/WsInputStream.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/websocket/WsInputStream.java 
Sun Jun  3 16:45:26 2012
@@ -54,7 +54,7 @@ public class WsInputStream extends Input
  * Process the next WebSocket frame.
  *
  * @param block Should this method block until a frame is presented if no
- *  data is currently available to process. Note that is a
+ *  data is currently available to process. Note that if a
  *  single byte is available, this method will block until the
  *  complete frame (excluding payload for non-control frames) 
is
  *  available.



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



svn commit: r1345708 - in /tomcat/tc7.0.x/trunk: ./ test/org/apache/catalina/authenticator/TestNonLoginAndBasicAuthenticator.java webapps/docs/changelog.xml

2012-06-03 Thread markt
Author: markt
Date: Sun Jun  3 16:47:16 2012
New Revision: 1345708

URL: http://svn.apache.org/viewvc?rev=1345708view=rev
Log:
Extend test cases for BASIC auth and RFC2617 compliance.
Patch provided by Brian Burch.

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

tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TestNonLoginAndBasicAuthenticator.java
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

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

Modified: 
tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TestNonLoginAndBasicAuthenticator.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TestNonLoginAndBasicAuthenticator.java?rev=1345708r1=1345707r2=1345708view=diff
==
--- 
tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TestNonLoginAndBasicAuthenticator.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TestNonLoginAndBasicAuthenticator.java
 Sun Jun  3 16:47:16 2012
@@ -93,7 +93,7 @@ public class TestNonLoginAndBasicAuthent
 @Test
 public void testAcceptPublicBasic() throws Exception {
 doTestBasic(USER, PWD, CONTEXT_PATH_LOGIN + URI_PUBLIC,
-false, 200, false, 200);
+false, false, 200, false, 200);
 }
 
 /*
@@ -104,7 +104,19 @@ public class TestNonLoginAndBasicAuthent
 @Test
 public void testAcceptProtectedBasic() throws Exception {
 doTestBasic(USER, PWD, CONTEXT_PATH_LOGIN + URI_PROTECTED,
-true, 401, false, 200);
+false, true, 401, false, 200);
+}
+
+/*
+ * Try to access a protected resource in a webapp that
+ * has a BASIC login method defined. Verify the server is
+ * prepared to accept non-standard case for the auth scheme.
+ * The access should be challenged, authenticated and then permitted.
+ */
+@Test
+public void testAuthMethodCaseBasic() throws Exception {
+doTestBasic(USER, PWD, CONTEXT_PATH_LOGIN + URI_PROTECTED,
+true, true, 401, false, 200);
 }
 
 /*
@@ -117,11 +129,11 @@ public class TestNonLoginAndBasicAuthent
 @Test
 public void testBasicLoginSessionTimeout() throws Exception {
 doTestBasic(USER, PWD, CONTEXT_PATH_LOGIN + URI_PROTECTED,
-true, 401, false, 200);
+false, true, 401, false, 200);
 // wait long enough for the session above to expire
 Thread.sleep(LONG_TIMEOUT_DELAY_MSECS);
 doTestBasic(USER, PWD, CONTEXT_PATH_LOGIN + URI_PROTECTED,
-true, 401, false, 200);
+false, true, 401, false, 200);
 }
 
 /*
@@ -134,7 +146,7 @@ public class TestNonLoginAndBasicAuthent
 @Test
 public void testBasicLoginRejectProtected() throws Exception {
 doTestBasic(USER, PWD, CONTEXT_PATH_LOGIN + URI_PROTECTED,
-true, 401, false, 200);
+false, true, 401, false, 200);
 doTestNonLogin(CONTEXT_PATH_NOLOGIN + URI_PROTECTED,
 true, 403);
 }
@@ -163,6 +175,7 @@ public class TestNonLoginAndBasicAuthent
 }
 
 private void doTestBasic(String user, String pwd, String uri,
+boolean verifyAuthSchemeCase,
 boolean expectedReject1, int expectedRC1,
 boolean expectedReject2, int expectedRC2) throws Exception {
 
@@ -190,7 +203,8 @@ public class TestNonLoginAndBasicAuthent
 String credentials = user + : + pwd;
 byte[] credentialsBytes = ByteChunk.convertToBytes(credentials);
 String base64auth = Base64.encode(credentialsBytes);
-String authLine = Basic  + base64auth;
+String authScheme = verifyAuthSchemeCase ? bAsIc  : Basic ;
+String authLine = authScheme + base64auth;
 
 ListString auth = new ArrayListString();
 auth.add(authLine);

Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1345708r1=1345707r2=1345708view=diff
==
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Sun Jun  3 16:47:16 2012
@@ -60,6 +60,10 @@
 bug52055/bug: An additional fix to ensure that the
 ChunkedInputFilter is correctly recycled. (markt)
   /fix
+  add
+bug53008/bug: Additional test cases for BASIC authentication and
+RFC2617 compliance. Patch provided by Brian Burch. (markt)
+  /add
   fix
 bug53021/bug: Correct WebSocket protocol version detection. (pero)
   /fix



-
To unsubscribe, e-mail: 

[Bug 53008] New test case for Basic Authenticator

2012-06-03 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=53008

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

   What|Removed |Added

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

--- Comment #1 from Mark Thomas ma...@apache.org ---
Thanks for the additional test. Applied to trunk and 7.0.x and will included in
7.0.28 onwards.

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

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



[Bug 53353] New: Malformed contentType attribute results in two charset values

2012-06-03 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=53353

  Priority: P2
Bug ID: 53353
  Assignee: dev@tomcat.apache.org
   Summary: Malformed contentType attribute results in two charset
values
  Severity: normal
Classification: Unclassified
OS: Windows XP
  Reporter: knst.koli...@gmail.com
  Hardware: PC
Status: NEW
   Version: 7.0.27
 Component: Catalina
   Product: Tomcat 7

If contentType attribute of a JSP page has a broken value, Tomcat 7 can behave
strangely and send two charset values in Content-Type header.

To reproduce:
1. Create this simple JSP file, ROOT/test.jsp
Note, that there is a typo: UTF-8 instead of charset=UTF-8. It is what
triggers this issue.

[[[
%@page pageEncoding=UTF-8 contentType=text/html; UTF-8 %
Hello world!
]]]

2. Start Tomcat and access the page with Firefox
http://localhost:8080/test.jsp

(I am using version 12, with Live HTTP Headers addon). When the page loads:
right-click - Page info - look for the value of Encoding. Then look for the
value of Content-Type header.

With current Tomcat 6.0:
Encoding: UTF-8
Content-Type header: text/html; UTF-8;charset=UTF-8

With current Tomcat 7.0 (7.0.23):
Encoding: ISO-8859-1
Content-Type header: text/html; UTF-8;charset=UTF-8;charset=ISO-8859-1

===

I think it is related to new contentType header parser (fix for bug 52811:
r1300154 + r1300155 + r1304275 + r1304895).

It is not a very convincing example, but it looks like it confirms the fears
against backporting the fix for bug 52811 to 6.0.

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

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



[Bug 53353] Malformed contentType attribute results in two charset values

2012-06-03 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=53353

--- Comment #1 from Konstantin Kolinko knst.koli...@gmail.com ---
 With current Tomcat 7.0 (7.0.23)

I meant 7.0.27. The issue is reproducible with 7.0.27 release and with current
trunk of 7.0.x.

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

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



svn commit: r1345731 - /tomcat/trunk/test/org/apache/catalina/websocket/TestWebSocket.java

2012-06-03 Thread markt
Author: markt
Date: Sun Jun  3 18:11:29 2012
New Revision: 1345731

URL: http://svn.apache.org/viewvc?rev=1345731view=rev
Log:
Refactor - no functional change

Modified:
tomcat/trunk/test/org/apache/catalina/websocket/TestWebSocket.java

Modified: tomcat/trunk/test/org/apache/catalina/websocket/TestWebSocket.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/websocket/TestWebSocket.java?rev=1345731r1=1345730r2=1345731view=diff
==
--- tomcat/trunk/test/org/apache/catalina/websocket/TestWebSocket.java 
(original)
+++ tomcat/trunk/test/org/apache/catalina/websocket/TestWebSocket.java Sun Jun  
3 18:11:29 2012
@@ -53,10 +53,6 @@ public class TestWebSocket extends Tomca
 258EAFA5-E914-47DA-95CA-C5AB0DC85B11.getBytes(
 B2CConverter.ISO_8859_1);
 
-private OutputStream os;
-private InputStream is;
-private boolean isContinuation = false;
-
 @Test
 public void testSimple() throws Exception {
 Tomcat tomcat = getTomcatInstance();
@@ -89,10 +85,10 @@ public class TestWebSocket extends Tomca
 }
 
 // Now we can do WebSocket
-sendMessage(foo, false);
-sendMessage(foo, true);
+client.sendMessage(foo, false);
+client.sendMessage(foo, true);
 
-assertEquals(foofoo,readMessage());
+assertEquals(foofoo, client.readMessage());
 
 // Finished with the socket
 client.close();
@@ -240,75 +236,14 @@ public class TestWebSocket extends Tomca
 
 
 
-private void sendMessage(String message, boolean finalFragment)
-throws IOException {
-ByteChunk bc = new ByteChunk(8192);
-C2BConverter c2b = new C2BConverter(bc, UTF-8);
-c2b.convert(message);
-c2b.flushBuffer();
-
-int len = bc.getLength();
-assertTrue(len  126);
-
-byte first;
-if (isContinuation) {
-first = Constants.OPCODE_CONTINUATION;
-} else {
-first = Constants.OPCODE_TEXT;
-}
-if (finalFragment) {
-first = (byte) (0x80 | first);
-}
-os.write(first);
-
-os.write(0x80 | len);
-
-// Zero mask
-os.write(0);
-os.write(0);
-os.write(0);
-os.write(0);
-
-// Payload
-os.write(bc.getBytes(), bc.getStart(), len);
-
-os.flush();
-
-// Will the next frame be a continuation frame
-isContinuation = !finalFragment;
-}
-
-private String readMessage() throws IOException {
-ByteChunk bc = new ByteChunk(125);
-CharChunk cc = new CharChunk(125);
-
-// Skip first byte
-is.read();
-
-// Get payload length
-int len = is.read()  0x7F;
-assertTrue(len  126);
-
-// Read payload
-int read = 0;
-while (read  len) {
-read = read + is.read(bc.getBytes(), read, len - read);
-}
-
-bc.setEnd(len);
-
-B2CConverter b2c = new B2CConverter(UTF-8);
-b2c.convert(bc, cc, len);
-
-return cc.toString();
-}
-
 private class WebSocketClient {
-// Open the socket
+private OutputStream os;
+private InputStream is;
+private boolean isContinuation = false;
 final String encoding = ISO-8859-1;
-Socket socket ;
-Writer writer ;
-BufferedReader reader;
+private Socket socket ;
+private Writer writer ;
+private BufferedReader reader;
 
 private WebSocketClient() {
 SocketAddress addr = new InetSocketAddress(localhost, getPort());
@@ -330,5 +265,67 @@ public class TestWebSocket extends Tomca
 socket.close();
 }
 
+private void sendMessage(String message, boolean finalFragment)
+throws IOException {
+ByteChunk bc = new ByteChunk(8192);
+C2BConverter c2b = new C2BConverter(bc, UTF-8);
+c2b.convert(message);
+c2b.flushBuffer();
+
+int len = bc.getLength();
+assertTrue(len  126);
+
+byte first;
+if (isContinuation) {
+first = Constants.OPCODE_CONTINUATION;
+} else {
+first = Constants.OPCODE_TEXT;
+}
+if (finalFragment) {
+first = (byte) (0x80 | first);
+}
+os.write(first);
+
+os.write(0x80 | len);
+
+// Zero mask
+os.write(0);
+os.write(0);
+os.write(0);
+os.write(0);
+
+// Payload
+os.write(bc.getBytes(), bc.getStart(), len);
+
+os.flush();
+
+// Will the next frame be a continuation frame
+isContinuation = !finalFragment;
+}
+
+private String readMessage() throws IOException {
+ByteChunk bc = new 

svn commit: r1345732 - /tomcat/trunk/test/org/apache/catalina/websocket/TestWebSocket.java

2012-06-03 Thread markt
Author: markt
Date: Sun Jun  3 18:14:20 2012
New Revision: 1345732

URL: http://svn.apache.org/viewvc?rev=1345732view=rev
Log:
More refactoring - no functional change

Modified:
tomcat/trunk/test/org/apache/catalina/websocket/TestWebSocket.java

Modified: tomcat/trunk/test/org/apache/catalina/websocket/TestWebSocket.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/websocket/TestWebSocket.java?rev=1345732r1=1345731r2=1345732view=diff
==
--- tomcat/trunk/test/org/apache/catalina/websocket/TestWebSocket.java 
(original)
+++ tomcat/trunk/test/org/apache/catalina/websocket/TestWebSocket.java Sun Jun  
3 18:14:20 2012
@@ -61,7 +61,7 @@ public class TestWebSocket extends Tomca
 
 tomcat.start();
 
-WebSocketClient client= new WebSocketClient();
+WebSocketClient client= new WebSocketClient(getPort());
 
 
 // Send the WebSocket handshake
@@ -101,7 +101,7 @@ public class TestWebSocket extends Tomca
 tomcat.addWebapp(null, /examples, appDir.getAbsolutePath());
 
 tomcat.start();
-WebSocketClient client= new WebSocketClient();
+WebSocketClient client= new WebSocketClient(getPort());
 
 // Send the WebSocket handshake
 client.writer.write(GET /examples/websocket/echoStream HTTP/1.1 + 
CRLF);
@@ -138,7 +138,7 @@ public class TestWebSocket extends Tomca
 tomcat.addWebapp(null, /examples, appDir.getAbsolutePath());
 
 tomcat.start();
-WebSocketClient client= new WebSocketClient();
+WebSocketClient client= new WebSocketClient(getPort());
 
 
 // Send the WebSocket handshake
@@ -166,7 +166,7 @@ public class TestWebSocket extends Tomca
 tomcat.addWebapp(null, /examples, appDir.getAbsolutePath());
 
 tomcat.start();
-WebSocketClient client= new WebSocketClient();
+WebSocketClient client= new WebSocketClient(getPort());
 
 // Send the WebSocket handshake
 client.writer.write(GET /examples/websocket/echoStream HTTP/1.1 + 
CRLF);
@@ -192,7 +192,7 @@ public class TestWebSocket extends Tomca
 tomcat.addWebapp(null, /examples, appDir.getAbsolutePath());
 
 tomcat.start();
-WebSocketClient client= new WebSocketClient();
+WebSocketClient client= new WebSocketClient(getPort());
 
 // Send the WebSocket handshake
 client.writer.write(GET /examples/websocket/echoStream HTTP/1.1 + 
CRLF);
@@ -235,8 +235,7 @@ public class TestWebSocket extends Tomca
 }
 
 
-
-private class WebSocketClient {
+private static class WebSocketClient {
 private OutputStream os;
 private InputStream is;
 private boolean isContinuation = false;
@@ -245,8 +244,8 @@ public class TestWebSocket extends Tomca
 private Writer writer ;
 private BufferedReader reader;
 
-private WebSocketClient() {
-SocketAddress addr = new InetSocketAddress(localhost, getPort());
+public WebSocketClient(int port) {
+SocketAddress addr = new InetSocketAddress(localhost, port);
 socket = new Socket();
 try {
 socket.setSoTimeout(1);



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



[Tomcat Wiki] Update of FAQ/CharacterEncoding by KonstantinKolinko

2012-06-03 Thread Apache Wiki
Dear Wiki user,

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

The FAQ/CharacterEncoding page has been changed by KonstantinKolinko:
http://wiki.apache.org/tomcat/FAQ/CharacterEncoding?action=diffrev1=20rev2=21

Comment:
Note that JSP documents use UTF-8 by default - from JSP.4.2

  
  References: 
[[http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7.1|HTTP 1.1 
Specification, Section 3.7.1]]
  
+ The above general rules apply to Servlets. The behaviour of JSP pages is 
further specified by the JSP specification. The request character encoding 
handling is the same, but response character encoding behaves a bit 
differently. See chapter JSP.4.2 Response Character Encoding. For JSP pages 
in standard syntax the default response charset is the usual `ISO-8859-1`, but 
for the ones in XML syntax it is `UTF-8`.
  
  BR
  

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



svn commit: r1345737 - in /tomcat/trunk: java/org/apache/catalina/websocket/StreamInbound.java test/org/apache/catalina/websocket/TestWebSocket.java

2012-06-03 Thread markt
Author: markt
Date: Sun Jun  3 18:47:25 2012
New Revision: 1345737

URL: http://svn.apache.org/viewvc?rev=1345737view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53339
Ensure WebSocket event calls are made using the web application's class loader. 
Includes a test case.

Modified:
tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java
tomcat/trunk/test/org/apache/catalina/websocket/TestWebSocket.java

Modified: tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java?rev=1345737r1=1345736r2=1345737view=diff
==
--- tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java Sun Jun  
3 18:47:25 2012
@@ -37,12 +37,18 @@ import org.apache.tomcat.util.net.Abstra
  */
 public abstract class StreamInbound implements UpgradeInbound {
 
+private final ClassLoader applicationClassLoader;
 private UpgradeProcessor? processor = null;
 private WsOutbound outbound;
 private int outboundByteBufferSize = WsOutbound.DEFAULT_BUFFER_SIZE;
 private int outboundCharBufferSize = WsOutbound.DEFAULT_BUFFER_SIZE;
 
 
+public StreamInbound() {
+applicationClassLoader = 
Thread.currentThread().getContextClassLoader();
+}
+
+
 public int getOutboundByteBufferSize() {
 return outboundByteBufferSize;
 }
@@ -121,11 +127,11 @@ public abstract class StreamInbound impl
 byte opCode = frame.getOpCode();
 
 if (opCode == Constants.OPCODE_BINARY) {
-onBinaryData(wsIs);
+doOnBinaryData(wsIs);
 } else if (opCode == Constants.OPCODE_TEXT) {
 InputStreamReader r =
 new InputStreamReader(wsIs, new Utf8Decoder());
-onTextData(r);
+doOnTextData(r);
 } else if (opCode == Constants.OPCODE_CLOSE){
 closeOutboundConnection(frame);
 return SocketState.CLOSED;
@@ -158,11 +164,37 @@ public abstract class StreamInbound impl
 return SocketState.UPGRADED;
 }
 
+private void doOnBinaryData(InputStream is) throws IOException {
+// Need to call onClose using the web application's class loader
+Thread t = Thread.currentThread();
+ClassLoader cl = t.getContextClassLoader();
+t.setContextClassLoader(applicationClassLoader);
+try {
+onBinaryData(is);
+} finally {
+t.setContextClassLoader(cl);
+}
+}
+
+
+private void doOnTextData(Reader r) throws IOException {
+// Need to call onClose using the web application's class loader
+Thread t = Thread.currentThread();
+ClassLoader cl = t.getContextClassLoader();
+t.setContextClassLoader(applicationClassLoader);
+try {
+onTextData(r);
+} finally {
+t.setContextClassLoader(cl);
+}
+}
+
+
 private void closeOutboundConnection(int status, ByteBuffer data) throws 
IOException {
 try {
 getWsOutbound().close(status, data);
 } finally {
-onClose(status);
+doOnClose(status);
 }
 }
 
@@ -170,13 +202,33 @@ public abstract class StreamInbound impl
 try {
 getWsOutbound().close(frame);
 } finally {
-onClose(Constants.OPCODE_CLOSE);
+doOnClose(Constants.OPCODE_CLOSE);
+}
+}
+
+private void doOnClose(int status) {
+// Need to call onClose using the web application's class loader
+Thread t = Thread.currentThread();
+ClassLoader cl = t.getContextClassLoader();
+t.setContextClassLoader(applicationClassLoader);
+try {
+onClose(status);
+} finally {
+t.setContextClassLoader(cl);
 }
 }
 
 @Override
-public void onUpgradeComplete() {
-onOpen(outbound);
+public final void onUpgradeComplete() {
+// Need to call onOpen using the web application's class loader
+Thread t = Thread.currentThread();
+ClassLoader cl = t.getContextClassLoader();
+t.setContextClassLoader(applicationClassLoader);
+try {
+onOpen(outbound);
+} finally {
+t.setContextClassLoader(cl);
+}
 }
 
 /**

Modified: tomcat/trunk/test/org/apache/catalina/websocket/TestWebSocket.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/websocket/TestWebSocket.java?rev=1345737r1=1345736r2=1345737view=diff
==
--- tomcat/trunk/test/org/apache/catalina/websocket/TestWebSocket.java 
(original)
+++ 

svn commit: r1345738 - in /tomcat/tc7.0.x/trunk: ./ test/org/apache/catalina/websocket/TestWebSocket.java

2012-06-03 Thread markt
Author: markt
Date: Sun Jun  3 18:48:34 2012
New Revision: 1345738

URL: http://svn.apache.org/viewvc?rev=1345738view=rev
Log:
Refactor - no functional change

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/test/org/apache/catalina/websocket/TestWebSocket.java

Propchange: tomcat/tc7.0.x/trunk/
--
  Merged /tomcat/trunk:r1345731-1345732

Modified: 
tomcat/tc7.0.x/trunk/test/org/apache/catalina/websocket/TestWebSocket.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/websocket/TestWebSocket.java?rev=1345738r1=1345737r2=1345738view=diff
==
--- tomcat/tc7.0.x/trunk/test/org/apache/catalina/websocket/TestWebSocket.java 
(original)
+++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/websocket/TestWebSocket.java 
Sun Jun  3 18:48:34 2012
@@ -53,10 +53,6 @@ public class TestWebSocket extends Tomca
 258EAFA5-E914-47DA-95CA-C5AB0DC85B11.getBytes(
 B2CConverter.ISO_8859_1);
 
-private OutputStream os;
-private InputStream is;
-private boolean isContinuation = false;
-
 @Test
 public void testSimple() throws Exception {
 Tomcat tomcat = getTomcatInstance();
@@ -65,7 +61,7 @@ public class TestWebSocket extends Tomca
 
 tomcat.start();
 
-WebSocketClient client= new WebSocketClient();
+WebSocketClient client= new WebSocketClient(getPort());
 
 
 // Send the WebSocket handshake
@@ -89,10 +85,10 @@ public class TestWebSocket extends Tomca
 }
 
 // Now we can do WebSocket
-sendMessage(foo, false);
-sendMessage(foo, true);
+client.sendMessage(foo, false);
+client.sendMessage(foo, true);
 
-assertEquals(foofoo,readMessage());
+assertEquals(foofoo, client.readMessage());
 
 // Finished with the socket
 client.close();
@@ -105,7 +101,7 @@ public class TestWebSocket extends Tomca
 tomcat.addWebapp(null, /examples, appDir.getAbsolutePath());
 
 tomcat.start();
-WebSocketClient client= new WebSocketClient();
+WebSocketClient client= new WebSocketClient(getPort());
 
 // Send the WebSocket handshake
 client.writer.write(GET /examples/websocket/echoStream HTTP/1.1 + 
CRLF);
@@ -142,7 +138,7 @@ public class TestWebSocket extends Tomca
 tomcat.addWebapp(null, /examples, appDir.getAbsolutePath());
 
 tomcat.start();
-WebSocketClient client= new WebSocketClient();
+WebSocketClient client= new WebSocketClient(getPort());
 
 
 // Send the WebSocket handshake
@@ -170,7 +166,7 @@ public class TestWebSocket extends Tomca
 tomcat.addWebapp(null, /examples, appDir.getAbsolutePath());
 
 tomcat.start();
-WebSocketClient client= new WebSocketClient();
+WebSocketClient client= new WebSocketClient(getPort());
 
 // Send the WebSocket handshake
 client.writer.write(GET /examples/websocket/echoStream HTTP/1.1 + 
CRLF);
@@ -196,7 +192,7 @@ public class TestWebSocket extends Tomca
 tomcat.addWebapp(null, /examples, appDir.getAbsolutePath());
 
 tomcat.start();
-WebSocketClient client= new WebSocketClient();
+WebSocketClient client= new WebSocketClient(getPort());
 
 // Send the WebSocket handshake
 client.writer.write(GET /examples/websocket/echoStream HTTP/1.1 + 
CRLF);
@@ -239,79 +235,17 @@ public class TestWebSocket extends Tomca
 }
 
 
-
-private void sendMessage(String message, boolean finalFragment)
-throws IOException {
-ByteChunk bc = new ByteChunk(8192);
-C2BConverter c2b = new C2BConverter(bc, UTF-8);
-c2b.convert(message);
-c2b.flushBuffer();
-
-int len = bc.getLength();
-assertTrue(len  126);
-
-byte first;
-if (isContinuation) {
-first = Constants.OPCODE_CONTINUATION;
-} else {
-first = Constants.OPCODE_TEXT;
-}
-if (finalFragment) {
-first = (byte) (0x80 | first);
-}
-os.write(first);
-
-os.write(0x80 | len);
-
-// Zero mask
-os.write(0);
-os.write(0);
-os.write(0);
-os.write(0);
-
-// Payload
-os.write(bc.getBytes(), bc.getStart(), len);
-
-os.flush();
-
-// Will the next frame be a continuation frame
-isContinuation = !finalFragment;
-}
-
-private String readMessage() throws IOException {
-ByteChunk bc = new ByteChunk(125);
-CharChunk cc = new CharChunk(125);
-
-// Skip first byte
-is.read();
-
-// Get payload length
-int len = is.read()  0x7F;
-assertTrue(len  126);
-
-// Read payload
-int read = 0;
-while (read  len) {
-read = read + 

svn commit: r1345739 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/websocket/StreamInbound.java test/org/apache/catalina/websocket/TestWebSocket.java webapps/docs/changelog.xml

2012-06-03 Thread markt
Author: markt
Date: Sun Jun  3 18:50:48 2012
New Revision: 1345739

URL: http://svn.apache.org/viewvc?rev=1345739view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53339
Ensure WebSocket event calls are made using the web application's class loader. 
Includes a test case.

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/catalina/websocket/StreamInbound.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/websocket/TestWebSocket.java
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

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

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/websocket/StreamInbound.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/websocket/StreamInbound.java?rev=1345739r1=1345738r2=1345739view=diff
==
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/websocket/StreamInbound.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/websocket/StreamInbound.java 
Sun Jun  3 18:50:48 2012
@@ -37,12 +37,17 @@ import org.apache.tomcat.util.net.Abstra
  */
 public abstract class StreamInbound implements UpgradeInbound {
 
+private final ClassLoader applicationClassLoader;
 private UpgradeProcessor? processor = null;
 private WsOutbound outbound;
 private int outboundByteBufferSize = WsOutbound.DEFAULT_BUFFER_SIZE;
 private int outboundCharBufferSize = WsOutbound.DEFAULT_BUFFER_SIZE;
 
 
+public StreamInbound() {
+applicationClassLoader = 
Thread.currentThread().getContextClassLoader();
+}
+
 
 public int getOutboundByteBufferSize() {
 return outboundByteBufferSize;
@@ -122,11 +127,11 @@ public abstract class StreamInbound impl
 byte opCode = frame.getOpCode();
 
 if (opCode == Constants.OPCODE_BINARY) {
-onBinaryData(wsIs);
+doOnBinaryData(wsIs);
 } else if (opCode == Constants.OPCODE_TEXT) {
 InputStreamReader r =
 new InputStreamReader(wsIs, new Utf8Decoder());
-onTextData(r);
+doOnTextData(r);
 } else if (opCode == Constants.OPCODE_CLOSE){
 closeOutboundConnection(frame);
 return SocketState.CLOSED;
@@ -159,11 +164,37 @@ public abstract class StreamInbound impl
 return SocketState.UPGRADED;
 }
 
+private void doOnBinaryData(InputStream is) throws IOException {
+// Need to call onClose using the web application's class loader
+Thread t = Thread.currentThread();
+ClassLoader cl = t.getContextClassLoader();
+t.setContextClassLoader(applicationClassLoader);
+try {
+onBinaryData(is);
+} finally {
+t.setContextClassLoader(cl);
+}
+}
+
+
+private void doOnTextData(Reader r) throws IOException {
+// Need to call onClose using the web application's class loader
+Thread t = Thread.currentThread();
+ClassLoader cl = t.getContextClassLoader();
+t.setContextClassLoader(applicationClassLoader);
+try {
+onTextData(r);
+} finally {
+t.setContextClassLoader(cl);
+}
+}
+
+
 private void closeOutboundConnection(int status, ByteBuffer data) throws 
IOException {
 try {
 getWsOutbound().close(status, data);
 } finally {
-onClose(status);
+doOnClose(status);
 }
 }
 
@@ -171,13 +202,33 @@ public abstract class StreamInbound impl
 try {
 getWsOutbound().close(frame);
 } finally {
-onClose(Constants.OPCODE_CLOSE);
+doOnClose(Constants.OPCODE_CLOSE);
+}
+}
+
+private void doOnClose(int status) {
+// Need to call onClose using the web application's class loader
+Thread t = Thread.currentThread();
+ClassLoader cl = t.getContextClassLoader();
+t.setContextClassLoader(applicationClassLoader);
+try {
+onClose(status);
+} finally {
+t.setContextClassLoader(cl);
 }
 }
 
 @Override
-public void onUpgradeComplete() {
-onOpen(outbound);
+public final void onUpgradeComplete() {
+// Need to call onOpen using the web application's class loader
+Thread t = Thread.currentThread();
+ClassLoader cl = t.getContextClassLoader();
+t.setContextClassLoader(applicationClassLoader);
+try {
+onOpen(outbound);
+} finally {
+t.setContextClassLoader(cl);
+}
 }
 
 /**

Modified: 
tomcat/tc7.0.x/trunk/test/org/apache/catalina/websocket/TestWebSocket.java
URL: 

[Bug 53339] ClassNotFoundException when using WebSocketServlet

2012-06-03 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=53339

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

   What|Removed |Added

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

--- Comment #2 from Mark Thomas ma...@apache.org ---
Fixed in trunk and 7.0.x and will be included in 7.0.28 onwards.

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

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



StuckThreadDetectionValve proposal in Tomcat 6 - GitHub link is dead

2012-06-03 Thread Konstantin Kolinko
Hi!

I was going to take another look at this old proposal in Tomcat 6:
* Add StuckThreadDetectionValve
  
https://github.com/sylvainlaurent/tomcat60/commit/252334f958877221ecb2dc64ee0fd12bb77e360b
  +1: slaurent

The GitHub link is dead - there is no tomcat60 repository in
Sylvain's account.

I will think about backporting StuckThreadDetectionValve from scratch,
but I am not yet convinced that I really want it. If there is no
followup I am going to remove that dead proposal.

Just an example of how depending on some external service can go
wrong. Though deleting a patch from people.apache.org would have the
same effect.

Best regards,
Konstantin Kolinko

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



[Bug 53354] New: filter-mapping doesn't find the @WebFilter(filterName)

2012-06-03 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=53354

  Priority: P2
Bug ID: 53354
  Assignee: dev@tomcat.apache.org
   Summary: filter-mapping doesn't find the
@WebFilter(filterName)
  Severity: normal
Classification: Unclassified
  Reporter: bal...@gmail.com
  Hardware: PC
Status: NEW
   Version: 7.0.27
 Component: Servlet  JSP API
   Product: Tomcat 7

As it's not possible to specify the invocation order in a @WebFilter, users are
forced to explicitly specify filter-mapping in web.xml. This works in
combination with a @WebFilter(filterName) in Glassfish and JBoss AS as follows:

@WebFilter(filterName=filter1)
public class Filter1 implements Filter {}

@WebFilter(filterName=filter2)
public class Filter2 implements Filter {}

with

filter-mapping
filter-namefilter1/filter-name
url-pattern/url1/*/url-pattern
/filter-mapping
filter-mapping
filter-namefilter2/filter-name
url-pattern/url2/*/url-pattern
/filter-mapping

However it fails in Tomcat 7.0.27 with the following confusing exception (the
url-pattern *is* been set)

Caused by: java.lang.IllegalArgumentException: Filter mapping must specify
either a url-pattern or a servlet-name
at
org.apache.catalina.core.StandardContext.validateFilterMap(StandardContext.java:3009)
at
org.apache.catalina.core.StandardContext.addFilterMap(StandardContext.java:2968)
at org.apache.catalina.deploy.WebXml.configureContext(WebXml.java:1207)
at
org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1294)
at
org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:855)
at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:345)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5161)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 7 more

-- 
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: r1345744 - /tomcat/trunk/test/org/apache/tomcat/util/http/parser/TestMediaType.java

2012-06-03 Thread markt
Author: markt
Date: Sun Jun  3 19:16:51 2012
New Revision: 1345744

URL: http://svn.apache.org/viewvc?rev=1345744view=rev
Log:
Add quotes that were missed - tests still pass

Modified:
tomcat/trunk/test/org/apache/tomcat/util/http/parser/TestMediaType.java

Modified: 
tomcat/trunk/test/org/apache/tomcat/util/http/parser/TestMediaType.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/parser/TestMediaType.java?rev=1345744r1=1345743r2=1345744view=diff
==
--- tomcat/trunk/test/org/apache/tomcat/util/http/parser/TestMediaType.java 
(original)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/parser/TestMediaType.java Sun 
Jun  3 19:16:51 2012
@@ -39,7 +39,7 @@ public class TestMediaType {
 private static final Parameter PARAM_TOKEN =
 new Parameter(a, b);
 private static final Parameter PARAM_QUOTED =
-new Parameter(x, y);
+new Parameter(x, \y\);
 private static final Parameter PARAM_EMPTY_QUOTED =
 new Parameter(z, \\);
 private static final Parameter PARAM_COMPLEX_QUOTED =



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



svn commit: r1345745 - in /tomcat/tc7.0.x/trunk: ./ test/org/apache/tomcat/util/http/parser/TestMediaType.java

2012-06-03 Thread markt
Author: markt
Date: Sun Jun  3 19:19:52 2012
New Revision: 1345745

URL: http://svn.apache.org/viewvc?rev=1345745view=rev
Log:
Add quotes that were missed - tests still pass

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

tomcat/tc7.0.x/trunk/test/org/apache/tomcat/util/http/parser/TestMediaType.java

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

Modified: 
tomcat/tc7.0.x/trunk/test/org/apache/tomcat/util/http/parser/TestMediaType.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/tomcat/util/http/parser/TestMediaType.java?rev=1345745r1=1345744r2=1345745view=diff
==
--- 
tomcat/tc7.0.x/trunk/test/org/apache/tomcat/util/http/parser/TestMediaType.java 
(original)
+++ 
tomcat/tc7.0.x/trunk/test/org/apache/tomcat/util/http/parser/TestMediaType.java 
Sun Jun  3 19:19:52 2012
@@ -39,7 +39,7 @@ public class TestMediaType {
 private static final Parameter PARAM_TOKEN =
 new Parameter(a, b);
 private static final Parameter PARAM_QUOTED =
-new Parameter(x, y);
+new Parameter(x, \y\);
 private static final Parameter PARAM_EMPTY_QUOTED =
 new Parameter(z, \\);
 private static final Parameter PARAM_COMPLEX_QUOTED =



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



[Bug 53353] Malformed contentType attribute results in two charset values

2012-06-03 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=53353

--- Comment #2 from Mark Thomas ma...@apache.org ---
At one level, this is just a case of garbage in, garbage out with current
7.0.x producing different garbage that 6.0.x for the same input. Granted, the
7.0.x garbage is likely to cause more problems for clients.

Digging a little deeper, it appears that Jasper is making the same error as the
root cause of bug 52811, namely using contentType.indexOf(charset=)  0. That
is probably more forgivable in Jasper than it was in Tomcat.

I'll see if I can configure the parser to handle parameters of the form name
rather than name=value. That should make Tomcat a little more robust against
this sort of input. Since the input is invalid, the specs don't say how this
should be handled so we have a little latitude here.

-- 
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: r1345752 - in /tomcat/trunk: java/org/apache/tomcat/util/http/parser/ test/org/apache/tomcat/util/http/parser/

2012-06-03 Thread markt
Author: markt
Date: Sun Jun  3 19:55:33 2012
New Revision: 1345752

URL: http://svn.apache.org/viewvc?rev=1345752view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53353
Make the HTTP header parser for ContentType tolerant of invalid parameters with 
names but no values. The invalid parameters are available in the collection of 
output nodes but skipped by the various toString() methods.

Modified:
tomcat/trunk/java/org/apache/tomcat/util/http/parser/AstMediaType.java
tomcat/trunk/java/org/apache/tomcat/util/http/parser/AstParameter.java
tomcat/trunk/java/org/apache/tomcat/util/http/parser/HttpParser.java
tomcat/trunk/java/org/apache/tomcat/util/http/parser/HttpParser.jjt
tomcat/trunk/test/org/apache/tomcat/util/http/parser/TestMediaType.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/http/parser/AstMediaType.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/parser/AstMediaType.java?rev=1345752r1=1345751r2=1345752view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/http/parser/AstMediaType.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/http/parser/AstMediaType.java Sun 
Jun  3 19:55:33 2012
@@ -39,8 +39,12 @@ public class AstMediaType extends Simple
 sb.append('/');
 sb.append(children[1].toString());
 for (int i = 2; i  children.length; i++) {
-sb.append(';');
-sb.append(children[i].toString());
+String s = children[i].toString();
+// Invalid parameters will have zero length - skip them
+if (s.length()  0) {
+sb.append(';');
+sb.append(s);
+}
 }
 return sb.toString();
 }

Modified: tomcat/trunk/java/org/apache/tomcat/util/http/parser/AstParameter.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/parser/AstParameter.java?rev=1345752r1=1345751r2=1345752view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/http/parser/AstParameter.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/http/parser/AstParameter.java Sun 
Jun  3 19:55:33 2012
@@ -31,6 +31,10 @@ public class AstParameter extends Simple
 
 @Override
 public String toString() {
+if (children.length != 2) {
+// Invalid input - swallow it.
+return ;
+}
 StringBuilder sb = new StringBuilder();
 sb.append(children[0].toString());
 sb.append(=);

Modified: tomcat/trunk/java/org/apache/tomcat/util/http/parser/HttpParser.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/parser/HttpParser.java?rev=1345752r1=1345751r2=1345752view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/http/parser/HttpParser.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/http/parser/HttpParser.java Sun 
Jun  3 19:55:33 2012
@@ -96,8 +96,15 @@ public class HttpParser/*@bgen(jjtree)*/
   jjtree.openNodeScope(jjtn000);
 try {
   Attribute();
-  jj_consume_token(EQUALS);
-  Value();
+  switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+  case EQUALS:
+jj_consume_token(EQUALS);
+Value();
+break;
+  default:
+jj_la1[1] = jj_gen;
+;
+  }
 } catch (Throwable jjte000) {
   if (jjtc000) {
 jjtree.clearNodeScope(jjtn000);
@@ -156,7 +163,7 @@ public class HttpParser/*@bgen(jjtree)*/

   jjtn000.jjtSetValue(t.image.trim());
 break;
   default:
-jj_la1[1] = jj_gen;
+jj_la1[2] = jj_gen;
 jj_consume_token(-1);
 throw new ParseException();
   }
@@ -176,13 +183,13 @@ public class HttpParser/*@bgen(jjtree)*/
   public Token jj_nt;
   private int jj_ntk;
   private int jj_gen;
-  final private int[] jj_la1 = new int[2];
+  final private int[] jj_la1 = new int[3];
   static private int[] jj_la1_0;
   static {
   jj_la1_init_0();
}
private static void jj_la1_init_0() {
-  jj_la1_0 = new int[] {0x2,0x180,};
+  jj_la1_0 = new int[] {0x2,0x4,0x180,};
}
 
   /** Constructor with InputStream. */
@@ -196,7 +203,7 @@ public class HttpParser/*@bgen(jjtree)*/
 token = new Token();
 jj_ntk = -1;
 jj_gen = 0;
-for (int i = 0; i  2; i++) jj_la1[i] = -1;
+for (int i = 0; i  3; i++) jj_la1[i] = -1;
   }
 
   /** Reinitialise. */
@@ -211,7 +218,7 @@ public class HttpParser/*@bgen(jjtree)*/
 jj_ntk = -1;
 jjtree.reset();
 jj_gen = 0;
-for (int i = 0; i  2; i++) jj_la1[i] = -1;
+for (int i = 0; i  3; i++) jj_la1[i] = -1;
   }
 
   /** Constructor. */
@@ -221,7 +228,7 @@ public class HttpParser/*@bgen(jjtree)*/
   

Re: StuckThreadDetectionValve proposal in Tomcat 6 - GitHub link is dead

2012-06-03 Thread Henri Gomez
Did you contact him ?

Btw, it could allways happen with external contributions, not GitHub related. 

Le 3 juin 2012 à 21:02, Konstantin Kolinko knst.koli...@gmail.com a écrit :

 Hi!
 
 I was going to take another look at this old proposal in Tomcat 6:
 * Add StuckThreadDetectionValve
  
 https://github.com/sylvainlaurent/tomcat60/commit/252334f958877221ecb2dc64ee0fd12bb77e360b
  +1: slaurent
 
 The GitHub link is dead - there is no tomcat60 repository in
 Sylvain's account.
 
 I will think about backporting StuckThreadDetectionValve from scratch,
 but I am not yet convinced that I really want it. If there is no
 followup I am going to remove that dead proposal.
 
 Just an example of how depending on some external service can go
 wrong. Though deleting a patch from people.apache.org would have the
 same effect.
 
 Best regards,
 Konstantin Kolinko
 
 -
 To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: dev-h...@tomcat.apache.org
 

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



svn commit: r1345754 - /tomcat/trunk/java/org/apache/tomcat/util/http/parser/AstMediaType.java

2012-06-03 Thread markt
Author: markt
Date: Sun Jun  3 20:03:30 2012
New Revision: 1345754

URL: http://svn.apache.org/viewvc?rev=1345754view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53353
Additional fix

Modified:
tomcat/trunk/java/org/apache/tomcat/util/http/parser/AstMediaType.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/http/parser/AstMediaType.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/parser/AstMediaType.java?rev=1345754r1=1345753r2=1345754view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/http/parser/AstMediaType.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/http/parser/AstMediaType.java Sun 
Jun  3 20:03:30 2012
@@ -58,8 +58,12 @@ public class AstMediaType extends Simple
 AstParameter p = (AstParameter) children[i];
 if (!CHARSET.equalsIgnoreCase(
 p.children[0].jjtGetValue().toString())) {
-sb.append(';');
-sb.append(p.toString());
+String s = p.toString();
+// Invalid parameters will have zero length - skip them
+if (s.length()  0) {
+sb.append(';');
+sb.append(p.toString());
+}
 }
 }
 return sb.toString();



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



svn commit: r1345755 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/util/http/parser/ test/org/apache/tomcat/util/http/parser/ webapps/docs/

2012-06-03 Thread markt
Author: markt
Date: Sun Jun  3 20:04:08 2012
New Revision: 1345755

URL: http://svn.apache.org/viewvc?rev=1345755view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53353
Make the HTTP header parser for ContentType tolerant of invalid parameters with 
names but no values. The invalid parameters are available in the collection of 
output nodes but skipped by the various toString() methods.

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

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/parser/AstMediaType.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/parser/AstParameter.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/parser/HttpParser.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/parser/HttpParser.jjt

tomcat/tc7.0.x/trunk/test/org/apache/tomcat/util/http/parser/TestMediaType.java
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc7.0.x/trunk/
--
  Merged /tomcat/trunk:r1345752,1345754

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/parser/AstMediaType.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/parser/AstMediaType.java?rev=1345755r1=1345754r2=1345755view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/parser/AstMediaType.java 
(original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/parser/AstMediaType.java 
Sun Jun  3 20:04:08 2012
@@ -39,8 +39,12 @@ public class AstMediaType extends Simple
 sb.append('/');
 sb.append(children[1].toString());
 for (int i = 2; i  children.length; i++) {
-sb.append(';');
-sb.append(children[i].toString());
+String s = children[i].toString();
+// Invalid parameters will have zero length - skip them
+if (s.length()  0) {
+sb.append(';');
+sb.append(s);
+}
 }
 return sb.toString();
 }
@@ -54,8 +58,12 @@ public class AstMediaType extends Simple
 AstParameter p = (AstParameter) children[i];
 if (!CHARSET.equalsIgnoreCase(
 p.children[0].jjtGetValue().toString())) {
-sb.append(';');
-sb.append(p.toString());
+String s = p.toString();
+// Invalid parameters will have zero length - skip them
+if (s.length()  0) {
+sb.append(';');
+sb.append(p.toString());
+}
 }
 }
 return sb.toString();

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/parser/AstParameter.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/parser/AstParameter.java?rev=1345755r1=1345754r2=1345755view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/parser/AstParameter.java 
(original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/parser/AstParameter.java 
Sun Jun  3 20:04:08 2012
@@ -31,6 +31,10 @@ public class AstParameter extends Simple
 
 @Override
 public String toString() {
+if (children.length != 2) {
+// Invalid input - swallow it.
+return ;
+}
 StringBuilder sb = new StringBuilder();
 sb.append(children[0].toString());
 sb.append(=);

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/parser/HttpParser.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/parser/HttpParser.java?rev=1345755r1=1345754r2=1345755view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/parser/HttpParser.java 
(original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/parser/HttpParser.java 
Sun Jun  3 20:04:08 2012
@@ -96,8 +96,15 @@ public class HttpParser/*@bgen(jjtree)*/
   jjtree.openNodeScope(jjtn000);
 try {
   Attribute();
-  jj_consume_token(EQUALS);
-  Value();
+  switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+  case EQUALS:
+jj_consume_token(EQUALS);
+Value();
+break;
+  default:
+jj_la1[1] = jj_gen;
+;
+  }
 } catch (Throwable jjte000) {
   if (jjtc000) {
 jjtree.clearNodeScope(jjtn000);
@@ -156,7 +163,7 @@ public class HttpParser/*@bgen(jjtree)*/

   jjtn000.jjtSetValue(t.image.trim());
 break;
   default:
-jj_la1[1] = jj_gen;
+jj_la1[2] = jj_gen;
 jj_consume_token(-1);
 throw new ParseException();
   }
@@ -176,13 +183,13 

[Bug 53353] Malformed contentType attribute results in two charset values

2012-06-03 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=53353

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

   What|Removed |Added

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

--- Comment #3 from Mark Thomas ma...@apache.org ---
Fixed in trunk and 7.0.x and will be included in 7.0.28 onwards.

Invalid parameters in the content-type header value will now be ignored. The
resulting header for 7.0.x of the input above is:

Content-Type header: text/html;charset=UTF-8

-- 
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: StuckThreadDetectionValve proposal in Tomcat 6 - GitHub link is dead

2012-06-03 Thread Mark Thomas
On 03/06/2012 20:59, Henri Gomez wrote:
 Did you contact him ?
 
 Btw, it could allways happen with external contributions, not GitHub related.

Which is why a patch attached to BZ should be the preferred approach.

 Le 3 juin 2012 à 21:02, Konstantin Kolinko knst.koli...@gmail.com a écrit :
 
 Hi!

 I was going to take another look at this old proposal in Tomcat 6:
 * Add StuckThreadDetectionValve
  
 https://github.com/sylvainlaurent/tomcat60/commit/252334f958877221ecb2dc64ee0fd12bb77e360b
  +1: slaurent

 The GitHub link is dead - there is no tomcat60 repository in
 Sylvain's account.

 I will think about backporting StuckThreadDetectionValve from scratch,
 but I am not yet convinced that I really want it. If there is no
 followup I am going to remove that dead proposal.

I'm not convinced either. I'm fine with dropping it.

Mark

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



buildbot success in ASF Buildbot on tomcat-trunk

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

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

Buildslave for this Build: bb-vm_ubuntu

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

Build succeeded!

sincerely,
 -The Buildbot





buildbot failure in ASF Buildbot on tomcat-trunk

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

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

Buildslave for this Build: bb-vm_ubuntu

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

BUILD FAILED: failed compile_1

sincerely,
 -The Buildbot





svn commit: r1345779 - /tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java

2012-06-03 Thread kkolinko
Author: kkolinko
Date: Sun Jun  3 21:10:56 2012
New Revision: 1345779

URL: http://svn.apache.org/viewvc?rev=1345779view=rev
Log:
Review of r1345737: Correct copy-pasted comments to match the method that is 
actually called there.

Modified:
tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java

Modified: tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java?rev=1345779r1=1345778r2=1345779view=diff
==
--- tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java Sun Jun  
3 21:10:56 2012
@@ -165,7 +165,7 @@ public abstract class StreamInbound impl
 }
 
 private void doOnBinaryData(InputStream is) throws IOException {
-// Need to call onClose using the web application's class loader
+// Need to call onBinaryData using the web application's class loader
 Thread t = Thread.currentThread();
 ClassLoader cl = t.getContextClassLoader();
 t.setContextClassLoader(applicationClassLoader);
@@ -178,7 +178,7 @@ public abstract class StreamInbound impl
 
 
 private void doOnTextData(Reader r) throws IOException {
-// Need to call onClose using the web application's class loader
+// Need to call onTextData using the web application's class loader
 Thread t = Thread.currentThread();
 ClassLoader cl = t.getContextClassLoader();
 t.setContextClassLoader(applicationClassLoader);



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



svn commit: r1345780 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/websocket/StreamInbound.java

2012-06-03 Thread kkolinko
Author: kkolinko
Date: Sun Jun  3 21:12:40 2012
New Revision: 1345780

URL: http://svn.apache.org/viewvc?rev=1345780view=rev
Log:
Merged revision 1345779 from tomcat/trunk:
Review of r1345737: Correct copy-pasted comments to match the method that is 
actually called there.

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

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

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/websocket/StreamInbound.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/websocket/StreamInbound.java?rev=1345780r1=1345779r2=1345780view=diff
==
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/websocket/StreamInbound.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/websocket/StreamInbound.java 
Sun Jun  3 21:12:40 2012
@@ -165,7 +165,7 @@ public abstract class StreamInbound impl
 }
 
 private void doOnBinaryData(InputStream is) throws IOException {
-// Need to call onClose using the web application's class loader
+// Need to call onBinaryData using the web application's class loader
 Thread t = Thread.currentThread();
 ClassLoader cl = t.getContextClassLoader();
 t.setContextClassLoader(applicationClassLoader);
@@ -178,7 +178,7 @@ public abstract class StreamInbound impl
 
 
 private void doOnTextData(Reader r) throws IOException {
-// Need to call onClose using the web application's class loader
+// Need to call onTextData using the web application's class loader
 Thread t = Thread.currentThread();
 ClassLoader cl = t.getContextClassLoader();
 t.setContextClassLoader(applicationClassLoader);



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



svn commit: r1345781 - /tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java

2012-06-03 Thread markt
Author: markt
Date: Sun Jun  3 21:16:25 2012
New Revision: 1345781

URL: http://svn.apache.org/viewvc?rev=1345781view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53354
Don't add empty filter mappings to the set of mappings - they'll fail validation

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

Modified: tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=1345781r1=1345780r2=1345781view=diff
==
--- tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java Sun Jun  3 
21:16:25 2012
@@ -2315,6 +2315,7 @@ public class ContextConfig implements Li
 }
 
 boolean urlPatternsSet = false;
+boolean servletNamesSet = false;
 boolean dispatchTypesSet = false;
 String[] urlPatterns = null;
 
@@ -2333,6 +2334,7 @@ public class ContextConfig implements Li
 } else if (servletNames.equals(name)) {
 String[] servletNames = processAnnotationsStringArray(evp
 .getValue());
+servletNamesSet = servletNames.length  0;
 for (String servletName : servletNames) {
 filterMap.addServletName(servletName);
 }
@@ -2389,8 +2391,10 @@ public class ContextConfig implements Li
 }
 if (!isWebXMLfilterDef) {
 fragment.addFilter(filterDef);
-filterMap.setFilterName(filterName);
-fragment.addFilterMapping(filterMap);
+if (urlPatternsSet || servletNamesSet) {
+filterMap.setFilterName(filterName);
+fragment.addFilterMapping(filterMap);
+}
 }
 if (urlPatternsSet || dispatchTypesSet) {
 SetFilterMap fmap = fragment.getFilterMappings();



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



svn commit: r1345782 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/startup/ContextConfig.java webapps/docs/changelog.xml

2012-06-03 Thread markt
Author: markt
Date: Sun Jun  3 21:18:26 2012
New Revision: 1345782

URL: http://svn.apache.org/viewvc?rev=1345782view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53354
Don't add empty filter mappings to the set of mappings - they'll fail validation

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

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

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=1345782r1=1345781r2=1345782view=diff
==
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java 
Sun Jun  3 21:18:26 2012
@@ -2383,6 +2383,7 @@ public class ContextConfig implements Li
 }
 
 boolean urlPatternsSet = false;
+boolean servletNamesSet = false;
 boolean dispatchTypesSet = false;
 String[] urlPatterns = null;
 
@@ -2401,6 +2402,7 @@ public class ContextConfig implements Li
 } else if (servletNames.equals(name)) {
 String[] servletNames = processAnnotationsStringArray(evp
 .getValue());
+servletNamesSet = servletNames.length  0;
 for (String servletName : servletNames) {
 filterMap.addServletName(servletName);
 }
@@ -2457,8 +2459,10 @@ public class ContextConfig implements Li
 }
 if (!isWebXMLfilterDef) {
 fragment.addFilter(filterDef);
-filterMap.setFilterName(filterName);
-fragment.addFilterMapping(filterMap);
+if (urlPatternsSet || servletNamesSet) {
+filterMap.setFilterName(filterName);
+fragment.addFilterMapping(filterMap);
+}
 }
 if (urlPatternsSet || dispatchTypesSet) {
 SetFilterMap fmap = fragment.getFilterMappings();

Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1345782r1=1345781r2=1345782view=diff
==
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Sun Jun  3 21:18:26 2012
@@ -202,6 +202,10 @@
 Content-Type values that contain invalid parameters by ignoring the
 invalid parameters. (markt)
   /fix
+  fix
+bug53354/bug: Correctly handle code@WebFilter/code annotations
+that do not include a mapping. (markt)
+  /fix
 /changelog
   /subsection
   subsection name=Coyote



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



Re: svn commit: r1345780 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/websocket/StreamInbound.java

2012-06-03 Thread Mark Thomas
On 03/06/2012 22:12, kkoli...@apache.org wrote:
 Author: kkolinko
 Date: Sun Jun  3 21:12:40 2012
 New Revision: 1345780
 
 URL: http://svn.apache.org/viewvc?rev=1345780view=rev
 Log:
 Merged revision 1345779 from tomcat/trunk:
 Review of r1345737: Correct copy-pasted comments to match the method that is 
 actually called there.

Thanks.

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



[Bug 53354] filter-mapping doesn't find the @WebFilter(filterName)

2012-06-03 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=53354

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

   What|Removed |Added

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

--- Comment #1 from Mark Thomas ma...@apache.org ---
Thanks for the report. Fixed in trunk and 7.0.x and will be included in 7.0.28
onwards.

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

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



[Bug 52723] An incomplete fix for the resource leak bugs in StandardManager.java

2012-06-03 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=52723

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

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |WONTFIX

--- Comment #3 from Mark Thomas ma...@apache.org ---
It isn't going to add any benefit so lets not change the 6.0.x code.

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

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



[Bug 52723] An incomplete fix for the resource leak bugs in StandardManager.java

2012-06-03 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=52723

--- Comment #4 from Konstantin Kolinko knst.koli...@gmail.com ---
My comment 2 was wrong. I missed that the original code closes oos (which is
always null there).  It should have closed the file stream instead.

oos constructor can throw IOException because it writes stream header (though
due to buffering it is unlikely).

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

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



Re: svn commit: r1345367 - in /tomcat/trunk/java/org/apache/catalina: core/ startup/ util/

2012-06-03 Thread Konstantin Kolinko
2012/6/2  ma...@apache.org:
 Author: markt
 Date: Fri Jun  1 22:03:10 2012
 New Revision: 1345367

 URL: http://svn.apache.org/viewvc?rev=1345367view=rev
 Log:
 Refactor some duplicate code into an new utility class with an eye to the 
 proposed patch for BZ 5

 Added:
    tomcat/trunk/java/org/apache/catalina/util/Introspection.java   (with 
 props)
 Modified:
    tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java
    tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties
    tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
    tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties
    tomcat/trunk/java/org/apache/catalina/startup/WebAnnotationSet.java
    tomcat/trunk/java/org/apache/catalina/util/LocalStrings.properties


 -                        if (injections != null  
 methodName.startsWith(set)
 -                                 methodName.length()  3
 -                                 method.getParameterTypes().length == 1
 -                                 
 method.getReturnType().getName().equals(void)) {
 -                            String fieldName = getName(method);
 +                        if (injections != null 
 +                                Introspection.isValidSetter(method)) {
 +                            String fieldName = Introspection.getName(method);

If the getName() method was moved into utility class,
maybe rename it to something more specific?
 getFieldName() ? getSetterFieldName() ?

This method creates field name from the name of a setter method.

Best regards,
Konstantin Kolinko

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



Re: svn commit: r1345580 - in /tomcat/trunk/java/org/apache/catalina/deploy: LocalStrings.properties NamingResources.java

2012-06-03 Thread Konstantin Kolinko
2012/6/3  ma...@apache.org:
 Author: markt
 Date: Sat Jun  2 21:18:53 2012
 New Revision: 1345580

 URL: http://svn.apache.org/viewvc?rev=1345580view=rev
 Log:
 Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=5
 Validate JNDI resource types against injection target types and use target 
 types when no type is specified for the resource.
 Based on a patch by Violeta Georgieva.

 Modified:
    tomcat/trunk/java/org/apache/catalina/deploy/LocalStrings.properties
    tomcat/trunk/java/org/apache/catalina/deploy/NamingResources.java


 --- tomcat/trunk/java/org/apache/catalina/deploy/NamingResources.java 
 (original)
 +++ tomcat/trunk/java/org/apache/catalina/deploy/NamingResources.java Sat Jun

 +    private Class? getInjectionTargetType(Context context,
 +            ResourceBase resource) {
 +
 +        Class? result = null;
 +
 +        for (InjectionTarget injectionTarget : 
 resource.getInjectionTargets()) {
 +            Class? clazz = Introspection.loadClass(
 +                    context, injectionTarget.getTargetClass());
 +            if (clazz == null) {
 +                // Can't load class - therefore ignore this target
 +                continue;
 +            }
 +
 +            // Look for a match
 +            String targetName = injectionTarget.getTargetName();
 +            // Look for a setter match first
 +            Class? targetType = getSetterType(clazz, targetName);
 +            if (targetType == null) {
 +                // Try a field match if no setter match
 +                targetType = getFieldType(clazz,targetName);
 +            }
 +            if (targetType == null) {
 +                // No match - ignore this injection target
 +                continue;
 +            }
 +            targetType = convertPrimitiveType(targetType);
 +
 +            // Figure out the common type - if there is one
 +            if (result == null) {
 +                result = targetType;
 +            } else if (targetType.isAssignableFrom(result)) {
 +                // NO-OP - This will work
 +            } else if (result.isAssignableFrom(targetType)) {
 +                // Need to use more specific type
 +                result = targetType;
 +            } else {
 +                // Incompatible types
 +                return null;
 +            }
 +        }
 +        return result;
 +    }

Does something guarantee that there is always common type among
injection targets?

Can there be two disjoint interfaces A and B, which are both
implemented by a resource, so assignment to A or B should succeed, but
getInjectionTargetType() will result in a failure?

Best regards,
Konstantin Kolinko

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



Re: svn commit: r1345580 - in /tomcat/trunk/java/org/apache/catalina/deploy: LocalStrings.properties NamingResources.java

2012-06-03 Thread Mark Thomas


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

2012/6/3  ma...@apache.org:
 Author: markt
 Date: Sat Jun  2 21:18:53 2012
 New Revision: 1345580

 URL: http://svn.apache.org/viewvc?rev=1345580view=rev
 Log:
 Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=5
 Validate JNDI resource types against injection target types and use
target types when no type is specified for the resource.
 Based on a patch by Violeta Georgieva.

 Modified:
  
 tomcat/trunk/java/org/apache/catalina/deploy/LocalStrings.properties
    tomcat/trunk/java/org/apache/catalina/deploy/NamingResources.java


 --- tomcat/trunk/java/org/apache/catalina/deploy/NamingResources.java
(original)
 +++ tomcat/trunk/java/org/apache/catalina/deploy/NamingResources.java
Sat Jun

 +    private Class? getInjectionTargetType(Context context,
 +            ResourceBase resource) {
 +
 +        Class? result = null;
 +
 +        for (InjectionTarget injectionTarget :
resource.getInjectionTargets()) {
 +            Class? clazz = Introspection.loadClass(
 +                    context, injectionTarget.getTargetClass());
 +            if (clazz == null) {
 +                // Can't load class - therefore ignore this target
 +                continue;
 +            }
 +
 +            // Look for a match
 +            String targetName = injectionTarget.getTargetName();
 +            // Look for a setter match first
 +            Class? targetType = getSetterType(clazz, targetName);
 +            if (targetType == null) {
 +                // Try a field match if no setter match
 +                targetType = getFieldType(clazz,targetName);
 +            }
 +            if (targetType == null) {
 +                // No match - ignore this injection target
 +                continue;
 +            }
 +            targetType = convertPrimitiveType(targetType);
 +
 +            // Figure out the common type - if there is one
 +            if (result == null) {
 +                result = targetType;
 +            } else if (targetType.isAssignableFrom(result)) {
 +                // NO-OP - This will work
 +            } else if (result.isAssignableFrom(targetType)) {
 +                // Need to use more specific type
 +                result = targetType;
 +            } else {
 +                // Incompatible types
 +                return null;
 +            }
 +        }
 +        return result;
 +    }

Does something guarantee that there is always common type among
injection targets?

Can there be two disjoint interfaces A and B, which are both
implemented by a resource, so assignment to A or B should succeed, but
getInjectionTargetType() will result in a failure?

Potentially, yes. That case needs to be handled too but in my view only if a 
type is defined in web.xml. I don't think it is reasonable to find a suitable 
type if injection targets define disparate interfaces with no concrete type in 
web.xml.

Mark


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



[GUMP@vmgump]: Project tomcat-tc7.0.x-test (in module tomcat-7.0.x) failed

2012-06-03 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-tc7.0.x-test has an issue affecting its community integration.
This issue affects 1 projects.
The current state of this project is 'Failed', with reason 'Build Failed'.
For reference only, the following projects are affected by this:
- tomcat-tc7.0.x-test :  Tomcat 7.x, a web server implementing Java Servlet 
3.0,
...


Full details are available at:

http://vmgump.apache.org/gump/public/tomcat-7.0.x/tomcat-tc7.0.x-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-tc7.0.x-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-tc7.0.x-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-7.0.x/output/build/logs



The following work was performed:
http://vmgump.apache.org/gump/public/tomcat-7.0.x/tomcat-tc7.0.x-test/gump_work/build_tomcat-7.0.x_tomcat-tc7.0.x-test.html
Work Name: build_tomcat-7.0.x_tomcat-tc7.0.x-test (Type: Build)
Work ended in a state of : Failed
Elapsed: 22 mins 38 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-03062012.jar 
-Dcommons-daemon.native.src.tgz=/srv/gump/public/workspace/apache-commons/daemon/dist/bin/commons-daemon-03062012-native-src.tar.gz
 
-Dtomcat-native.tar.gz=/srv/gump/public/workspace/apache-commons/daemon/dist/bin/commons-daemon-03062012-native-src.tar.gz
 -Dexamples.sources.skip=true 
-Dtomcat-dbcp.home=/srv/gump/public/workspace/tomcat-7.0.x/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-03062012.jar
 
-Dtomcat-dbcp-src.jar=/srv/gump/public/workspace/tomcat-7.0.x/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-7.0.x/tomcat-deps/tomcat-dbcp-03062012.jar
 test 
[Working Directory: /srv/gump/public/workspace/tomcat-7.0.x]
CLASSPATH: 
/usr/lib/jvm/java-6-openjdk/lib/tools.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/webapps/examples/WEB-INF/classes:/srv/gump/public/workspace/tomcat-7.0.x/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-7.0.x/output/build/bin/bootstrap.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/bin/tomcat-juli.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/annotations-api.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/servlet-api.jar:/srv/gump/public/workspace/tomcat-7.0.x/outp
 
ut/build/lib/jsp-api.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/el-api.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/catalina.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/catalina-ant.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/tomcat-coyote.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/jasper.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/jasper-el.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/catalina-tribes.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/catalina-ha.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/tomcat-api.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/tomcat-util.jar:/srv/gump/packages/eclipse/plugins/org.eclipse.jdt.core_3.4.2/jdtcore.jar:/srv/gump/public/workspace/tomcat-7.0.x/tomcat-deps/tomcat-dbcp-03062012.jar:/srv/gump/public/workspace/apache-commons/daemon/dist/commons-daemon-03062012.jar:/srv/gump/
 public/workspace/junit/dist/junit-03062012.jar
-
[junit] at