tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Graham Leggett <minf...@sharp.fm>
Subject Feedback: JNDI Datasource HOW-TO
Date Fri, 14 Nov 2003 23:36:50 GMT
Hi all,

I have been following the JNDI Datasource HOW-TO published at 
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html, 
to try and create a postgresql database pool, and a basic authentication 
realm associated with it.

The docs say the config is untested - and having tested it, I can report 
that the config does not work.

The config I tried was this:

<Context path="/patricia" reloadable="true" 
docBase="/home/gatekeeper/minfrin/src/fma/patricia/target/patricia" 
workDir="/home/gatekeeper/minfrin/src/fma/patricia/work/org/apache/jsp" >
     <Logger className="org.apache.catalina.logger.SystemOutLogger" 
verbosity="4" timestamp="true"/>
         <Resource name="jdbc/patricia" auth="Container"
           type="javax.sql.DataSource"/>

         <ResourceParams name="jdbc/patricia">
           <parameter>
             <name>factory</name>
             <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
           </parameter>
           <parameter>
             <name>driverClassName</name>
             <value>org.postgresql.Driver</value>
           </parameter>
           <parameter>
             <name>url</name>
             <value>jdbc:postgresql://127.0.0.1:5432/patricia</value>
           </parameter>
           <parameter>
             <name>username</name>
             <value>user_name</value>
           </parameter>
           <parameter>
             <name>password</name>
             <value>password</value>
           </parameter>
           <parameter>
             <name>maxActive</name>
             <value>20</value>
           </parameter>
           <parameter>
             <name>maxIdle</name>
             <value>10</value>
           </parameter>
           <parameter>
             <name>maxWait</name>
             <value>-1</value>
           </parameter>
         </ResourceParams>
<Realm className="org.apache.catalina.realm.DataSourceRealm" debug="99"
    dataSourceName="jdbc/patricia"
    userTable="person" userNameCol="uid" userCredCol="user_password"
    userRoleTable="company_person" roleNameCol="role_name"/>
</Context>

The error I got was this:

javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
	at org.apache.naming.NamingContext.lookup(NamingContext.java:811)
	at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
	at org.apache.catalina.realm.DataSourceRealm.open(DataSourceRealm.java:467)

The error message is not very descriptive, being new to this, I wouldn't 
have the first clue where to look for a solution.

Anyone have any clues as to what is going on?

Regards,
Graham
--


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


Mime
View raw message