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]