The following configuration gives me a javax.naming.NameNotFoundException:

<Context path="/">

  <!-- connection pool for database -->
  <Resource name="jdbc/data" auth="Container" type="javax.sql.DataSource"
            driverClassName="org.postgresql.Driver"
            url="jdbc:postgresql://localhost/test"
            username="postgres" password=""
            maxActive="5" maxIdle="2" maxWait="-1"/>

  <!-- authentication realm -->
  <Realm className="org.apache.catalina.realm.DataSourceRealm"
         dataSourceName="jdbc/data" digest="MD5"
         userTable="web_users" userRoleTable="web_user_roles"
         userNameCol="id" userCredCol="password" roleNameCol="role"/>
</Context>

However, if I move the JNDI resource up it works as expected:

<GlobalNamingResources>

  <!-- connection pool for database -->
  <Resource name="jdbc/data" auth="Container" type="javax.sql.DataSource"
            driverClassName="org.postgresql.Driver"
            url="jdbc:postgresql://localhost/test"
            username="postgres" password=""
            maxActive="5" maxIdle="2" maxWait="-1"/>
</GlobalNamingResources>
...
<Context path="/">

  <!-- authentication realm -->
  <Realm className="org.apache.catalina.realm.DataSourceRealm"
         dataSourceName="jdbc/data" digest="MD5"
         userTable="web_users" userRoleTable="web_user_roles"
         userNameCol="id" userCredCol="password" roleNameCol="role"/>
</Context>



Is that the intended behaviour?

Cheers,

Roger


---------------------------------------------------------------------
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