• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

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: 3409
493
Android 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: 12734
277
  • 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: 23282
158
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: 23282
158
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
 
There are no more "hours", it's centi-days. They say it's better, but this tiny ad says it's stupid:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic