This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Building Blockchain Apps and have Michael Yuan on-line!
See this thread for details.
Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization 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
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

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.
 
Saloon Keeper
Posts: 3027
418
Android Eclipse IDE Angular Framework MySQL Database TypeScript Redhat 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: 11488
247
  • 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?
 
Bartender
Posts: 21756
148
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
Bartender
Posts: 21756
148
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
 
Roses are red, violets are blue. Some poems rhyme and some don't. And some poems are a tiny ad.
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!