tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John McPeek <cs...@bellsouth.net>
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

    <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: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message