Chris, thank you for your reply
-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net]
Sent: 26 November 2014 04:17
To: Tomcat Users List
Subject: Re: How can code in a Realm gain access to a Globally Named
Resource
-BEGIN PGP SIGNED MESSAGE-
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256
Vince,
On 11/26/14 7:26 AM, vince.w...@thomsonreuters.com wrote:
-Original Message- From: Christopher Schultz
[mailto:ch...@christopherschultz.net] Sent: 26 November 2014
04:17 To: Tomcat Users List Subject: Re: How can code in a Realm
On 26/11/2014 16:23, Christopher Schultz wrote:
snip/
I'm not sure, but I would guess you can't define a Realm in server.xml
and use a DataSource defined in context.xml. If the Realm is in
server.xml, then you should be able to grab the globally-accessible
DataSources by using their existing
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256
Mark,
On 11/26/14 12:01 PM, Mark Thomas wrote:
On 26/11/2014 16:23, Christopher Schultz wrote:
snip/
I'm not sure, but I would guess you can't define a Realm in
server.xml and use a DataSource defined in context.xml. If the
Realm is in
Mark
Thank you. I looked at DataSourceRealm.open() took the following lines and put
them into my custom Realm:
///
if (localDataSource) {
context = ContextBindings.getClassLoader();
context = (Context) context.lookup(comp/env);
} else {
context =
2014-11-27 0:26 GMT+03:00 vince.w...@thomsonreuters.com:
Initially I had difficulty with getServer() giving me null.
To fix it I stopped calling this method from within the Realm's constructor,
instead I get the DataSource the first time it's needed.
Learn about org.apache.catalina.Lifecycle
Hello
Web applications gain access to Globally Named JDBC Resources
GlobalNamingResources by adding a ResourceLink to context.xml
Then using code like:
Context initContext = new InitialContext();
dbLookupStr = java:comp/env/ + dbResourceName;
ds = (DataSource)initContext.lookup(dbLookupStr);
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256
Vince,
On 11/25/14 9:00 PM, vince.w...@thomsonreuters.com wrote:
Web applications gain access to Globally Named JDBC Resources
GlobalNamingResources by adding a ResourceLink to context.xml
Then using code like:
Context initContext = new