tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roger Keays <roger.ke...@ninthavenue.com.au>
Subject javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
Date Tue, 15 Apr 2008 06:22:54 GMT
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: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message