Using global datasource in web-app DataSourceRealm
posted 5 years ago
I have a DataSource for a connection pool defined at the tomcat level (tomcat/conf/context.xml). In the context.xml configuration of one of my web-apps I have an authentication DataSourceRealm defined and I'd like it to use the global datasource to do the authentication, but that datasource is not bound in the web-app context and so it throws an error. I know I can move the realm configuration from the webapp to the conf/server.xml config, but I dont want it used for all my webapps; just one in particular. The way I see I have two options: create a separate virtual host (service) in conf/server.xml just for this one web-app; or just use a JDBCRealm instead. Are there other options?