This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Tomcat Server.xml maxAge "unknown property"

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • 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: 3156
466
Android Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which version of Tomcat?

Here's an easier to read formatted version of your config:
 
Saloon Keeper
Posts: 12165
258
  • Mark post as helpful
  • send pies
  • 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: 22289
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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: 22289
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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
 
My pie came with a little toothpic holding up this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic