Bug 54096 - env-entry rejects legal types
Summary: env-entry rejects legal types
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 7.0.30
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-04 18:43 UTC by Mark Thornton
Modified: 2012-11-09 19:34 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Thornton 2012-11-04 18:43:14 UTC
In servlet 3.0 the type in an env-entry can be any type which has a public constructor taking a single String (or character) as an argument. Tomcat only accepts a fixed list of types (see NamingContextListener from line 813).

This is legal in web.xml but not accepted by tomcat:

<env-entry>
  <env-entry-name>location</env-entry-name>
  <env-entry-type>java.io.File</env-entry-type>
  <env-entry-value>/var/lib/tomcat</env-entry-value>
</env-entry>
Comment 1 Mark Thomas 2012-11-09 19:34:30 UTC
Thanks for the report and for tracking down the point in the code that needed to be fixed.

This has been fixed (and a simple test case added) in trunk and 7.0.x and will be included in 7.0.33 onwards.