You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Will Hartung <wi...@msoft.com> on 2006/08/25 17:19:07 UTC
FataSourceReal, can't find data source
I'm trying to get a DataSourceRealm working for my project.
When I try to log in, I get:
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:769)
at org.apache.naming.NamingContext.lookup(NamingContext.java:152)
at
org.apache.catalina.realm.DataSourceRealm.open(DataSourceRealm.java:401)
Here's my Context.xml (it's short):
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/WebApplication5">
<Resource auth="Container" driverClassName="org.postgresql.Driver"
maxActive="20" maxIdle="10" maxWait="-1" name="jdbc/securedb"
password="password" type="javax.sql.DataSource"
url="jdbc:postgresql://dbhost:5432/securedb" username="secureuser"/>
<ResourceLink global="jdbc/securedb" name="jdbc/securedb"
type="javax.sql.DataSource"/>
<Realm className="org.apache.catalina.realm.DataSourceRealm"
dataSourceName="jdbc/securedb" debug="99" roleNameCol="role"
userCredCol="password" userNameCol="loginid" userRoleTable="userroleview"
userTable="user"/>
</Context>
I also have the proper (I think) references and such in the web.xml:
<resource-ref>
<description>Postgres Datasource</description>
<res-ref-name>jdbc/securedb</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
So, I must be missing something fundamental, but I thought I had all of the
tracks covered.
Any hints appreciated.
Regards,
Will Hartung
(willh@msoft.com)
--
View this message in context: http://www.nabble.com/FataSourceReal%2C-can%27t-find-data-source-tf2165343.html#a5985525
Sent from the Tomcat - User forum at Nabble.com.
---------------------------------------------------------------------
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
Re: FataSourceReal, can't find data source
Posted by David Smith <dn...@cornell.edu>.
Hmm -- config looks good for what you've provided. Might want to take a
look a little higher up in the logs to see if there's another problem
contributing to this one.
--David
Will Hartung wrote:
>>Drop the ResourceLink element -- it's confusing tomcat and not needed
>>here unless you created a global resource.
>>
>>
>
>Thanx for the quick reply David, but, alas, removing the ResourceLink
>resorts in the same error.
>
>Regards,
>
>Will Hartung
>(willh@msoft.com)
>
>
>
---------------------------------------------------------------------
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
Re: FataSourceReal, can't find data source
Posted by Will Hartung <wi...@msoft.com>.
> Drop the ResourceLink element -- it's confusing tomcat and not needed
> here unless you created a global resource.
Thanx for the quick reply David, but, alas, removing the ResourceLink
resorts in the same error.
Regards,
Will Hartung
(willh@msoft.com)
--
View this message in context: http://www.nabble.com/FataSourceReal%2C-can%27t-find-data-source-tf2165343.html#a5985808
Sent from the Tomcat - User forum at Nabble.com.
---------------------------------------------------------------------
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
Re: FataSourceReal, can't find data source
Posted by David Smith <dn...@cornell.edu>.
Drop the ResourceLink element -- it's confusing tomcat and not needed
here unless you created a global resource.
--David
Will Hartung wrote:
>I'm trying to get a DataSourceRealm working for my project.
>
>When I try to log in, I get:
>
>javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
> at org.apache.naming.NamingContext.lookup(NamingContext.java:769)
> at org.apache.naming.NamingContext.lookup(NamingContext.java:152)
> at
>org.apache.catalina.realm.DataSourceRealm.open(DataSourceRealm.java:401)
>
>Here's my Context.xml (it's short):
>
><?xml version="1.0" encoding="UTF-8"?>
><Context path="/WebApplication5">
> <Resource auth="Container" driverClassName="org.postgresql.Driver"
>maxActive="20" maxIdle="10" maxWait="-1" name="jdbc/securedb"
>password="password" type="javax.sql.DataSource"
>url="jdbc:postgresql://dbhost:5432/securedb" username="secureuser"/>
> <ResourceLink global="jdbc/securedb" name="jdbc/securedb"
>type="javax.sql.DataSource"/>
> <Realm className="org.apache.catalina.realm.DataSourceRealm"
>dataSourceName="jdbc/securedb" debug="99" roleNameCol="role"
>userCredCol="password" userNameCol="loginid" userRoleTable="userroleview"
>userTable="user"/>
></Context>
>
>I also have the proper (I think) references and such in the web.xml:
> <resource-ref>
> <description>Postgres Datasource</description>
> <res-ref-name>jdbc/securedb</res-ref-name>
> <res-type>javax.sql.DataSource</res-type>
> <res-auth>Container</res-auth>
> <res-sharing-scope>Shareable</res-sharing-scope>
> </resource-ref>
>
>So, I must be missing something fundamental, but I thought I had all of the
>tracks covered.
>
>Any hints appreciated.
>
>Regards,
>
>Will Hartung
>(willh@msoft.com)
>
>
>
---------------------------------------------------------------------
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