• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Tomcat Server.xml maxAge "unknown property"

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hoping someone can tell me what I am missing with this.  I added maxAge to the resource name for 100 minutes as seen below; but the log file comes back with:

catalina.out
o.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory - Name = RadiusDataSource Ignoring unknown property: value of "600000" for "maxAge" property

server.xml


I have also tried max-age max-Age and different values. "60" "600" "6000" etc etc.
 
Marshal
Posts: 4499
572
VSCode Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which version of Tomcat?

Here's an easier to read formatted version of your config:
 
Saloon Keeper
Posts: 15510
363
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
maxAge is simply not a valid attribute for a Resource. Don't know what else to tell you. Where did you get the notion of this attribute?
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Tim Holloway
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh, incidentally, com/server/jdbc/RadiusDataSource is a pretty awful JNDI name. Most of us would simply call it jdbc/RadiusDataSource and look it up as java:comp/env/jdbc/RadiusDataSource
 
Those cherries would go best on cherry cheesecake. Don't put those cherries on this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic