You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Kanda Upendra <UK...@agris.com> on 2005/04/19 19:06:29 UTC

Problems with DataSourceRealm Tomcat 5.5

Hi,

  I am using Tomcat 5.5 and having problems with the DataSourceRealm
finding the data source in the JNDI. 

Here is the configuration of my context.xml,

<Realm className="org.apache.catalina.realm.DataSourceRealm" debug="99"
             dataSourceName="jdbc/myDB"
           userTable="users" userNameCol="login" userCredCol="password"
           userRoleTable="user_roles" roleNameCol="role_name" />


<Resource name="jdbc/myDB" 	auth="Container"
type="javax.sql.DataSource"
      maxActive="10" maxIdle="5" maxWait="100"  username="myDB"
password="myDB" driverClassName="com.mysql.jdbc.Driver"
	url="jdbc:mysql://localhost/myDB?autoReconnect=true"/>



I get this error "Name jdbc not bound in this context". I tried moving
the Resource configuration under <GlobalNamingResources> in server.xml,
but I get the same error. JDBCRealm works, but I want it use a
connection pool and hence I am trying to change it to a DataSourceRealm.

Also, interestingly, when I try to access the data source from a jsp in
my webapplication it works. The problem seems to be with the
DataSourceRealm looking up for the resource using JNDI.

Any help will be appreciated.

Thanks,

Upendra





---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org