tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John McPeek <>
Subject JNDI inside a JAAS LoginModule
Date Sun, 08 Oct 2006 02:21:31 GMT
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

        <Resource driverClassName="com.mysql.jdbc.Driver" maxActive="20"
            maxIdle="5" maxWait="5000" name="jdbc/coolNewApp"
            password="password" type="javax.sql.DataSource"
            username="username" />

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 

John McPeek

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message