Hi John,
        I actually think your approach is correct, I was merely pointing out
that we had a similar problem and suggested a workaround. This workaround is
obviously not efficient if you have multiple contexts that would like to
share the same large pool of connections.
I'd be interested to see if you can get the global pool working...
A

-----Original Message-----
From: John McPeek [mailto:[EMAIL PROTECTED] 
Sent: 10 October 2006 01:10
To: Tomcat Users List
Subject: Re: JNDI inside a JAAS LoginModule


Hi Ashley,
 Thanks for the response. It seems that I misunderstood something. I 
figured that since it was Global that JAAS could see it regardless of 
the app that was using it. Once I put the <ResourceLink> in the context 
for each app, all is well. Why should I need to configure the DataSource 
on each app for JAAS? Is there a way to see Global resources without 
referencing them in every app Context?

Thanks,
John McPeek

>I know we had/have problems with GlobalNamingResources. We have it working
>with the connection pool "<Resource >.." and our JAAS realm configured
under
>the webapp context node.
>Also make sure that your JAAS classes are available to tomcat's
classloader,
>i.e. under common/lib or common classes.
>Like wise the DB drivers should be there too...
>A
>
>
>
>-----Original Message-----
>From: Pid [mailto:[EMAIL PROTECTED] 
>Sent: 09 October 2006 13:15
>To: Tomcat Users List
>Subject: Re: JNDI inside a JAAS LoginModule
>
>
>good question.
>anyone?
>
>
>
>John McPeek wrote:
>  
>
>>Hi all,
>>I am hitting a database form a LoginModule. I would like to use a
>>datasource. I don't have any problem configuring the datasource and
>>accessing it from an app. I have a global resource
>>
>>   <GlobalNamingResources>
>>       ...
>>       <Resource driverClassName="com.mysql.jdbc.Driver" maxActive="20"
>>           maxIdle="5" maxWait="5000" name="jdbc/coolNewApp"
>>           password="password" type="javax.sql.DataSource"
>>           url="jdbc:mysql://localhost:3306/coolNewSchema"
>>           username="username" />
>>      ...
>>   </GlobalNamingResources>
>>
>>
>>And I add a <ResourceLink> in the <context> element. All is well in the
>>app. When I do
>>
>>           Context ctx = new InitialContext();
>>           Object o = ctx.lookup( "java:comp/env/jdbc/coolNewApp" );
>>
>>in the LoginModule I get an exception.
>>       javax.naming.NameNotFoundException: Name jdbc is not bound in
>>this Context
>>
>>Is it possible to use Tomcat's JNDI in a LoginModule, or am I missing
>>configuration.
>>
>>Thanks,
>>John McPeek
>>
>>
>>---------------------------------------------------------------------
>>To start a new topic, e-mail: users@tomcat.apache.org
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To start a new topic, e-mail: users@tomcat.apache.org
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>---------------------------------------------------------------------
>To start a new topic, e-mail: users@tomcat.apache.org
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>  
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to