Ok, first I have no clue on JAAS as I have not used it. From the trace you
are missing the resource link in the context declaration. With a global you
have to provide a link in the context segment.
Doug
www.parsonstechnical.com
----- Original Message -----
From: "Beloglazov Maksim" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 21, 2004 3:25 PM
Subject: Jaas and Jndi problem
> Hello,
>
> I'm stuck with the problem trying to get a way out for several hours:
> I have a database resource declared in server.xml in
> GlobalNamingResources part
> Also I have a JAAS login module which is intended to use this JNDI
> database resource.
> And I can't get access to this resource my JAAS login module. The error is
>
> ...
> javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
> at org.apache.naming.NamingContext.lookup(NamingContext.java:815)
> at org.apache.naming.NamingContext.lookup(NamingContext.java:198)
> at
> ru.mb.security.jaas.RDBMSJAASLoginModule.rdbmsValidate(Unknown Source)
> at ru.mb.security.jaas.RDBMSJAASLoginModule.login(Unknown Source)
> ...
>
> server.xml:
> <GlobalNamingResources>
> <Resource name="jdbc/MerxDB" auth="Container"
> type="javax.sql.DataSource" scope="Sharable"/>
>
> <ResourceParams name="jdbc/MerxDB">
> <parameter>
> <name>factory</name>
> <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
> </parameter>
> <parameter>
> <name>maxActive</name>
> <value>100</value>
> </parameter>
> <parameter>
> <name>maxIdle</name>
> <value>30</value>
> </parameter>
> <parameter>
> <name>maxWait</name>
> <value>10000</value>
> </parameter>
> <parameter>
> <name>username</name>
> <value>SYSDBA</value>
> </parameter>
> <parameter>
> <name>password</name>
> <value>masterkey</value>
> </parameter>
> <parameter>
> <name>driverClassName</name>
> <value>org.firebirdsql.jdbc.FBDriver</value>
> </parameter>
> <parameter>
> <name>url</name>
>
> <value>jdbc:firebirdsql:localhost/3050:/var/db/firebird/merx.gdb</value>
> </parameter>
> </ResourceParams>
> ...
> </GlobalNamingResources>
>
> code from login module:
> ...
> Context ctx = new InitialContext();
> if (null==ctx) throw new Exception("No context");
> Context envCtx = (Context)ctx.lookup("java:comp/env");
> if (null==envCtx) throw new Exception("No context");
> DataSource ds = (DataSource)envCtx.lookup("jdbc/MerxDB");
> ...
>
> Is there any way out? Any help is greatly appreciated.
>
> Maksim Beloglazov
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]