posted 4 years ago
Tomcat uses plug-replaceable DBCP Connection Pool modules and they changed which one came pre-installed somewhere around Tomcat 8.
The Resource element defines a JavaBean that produces javax.sql.Datasource objects. Tomcat's XML is fluid, so there's no schema for it, and in particular, there's no standard definition for a Connection Pool bean. Instead, the Digester takes the Resource attributes and attempts to apply them as properties to the Connection Pool bean object.
In other words, the particular Connecton Pool class that is being used here doesn't have a "setMaxAge()" method that the Digester can use to inject an age value into the pool object.
If this was a critical function, I'd recommend looking for an alternative Connection Pool to plug in, but really, it's best to just not define maxAge in the Resource. It won't be missed.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.