Hi,

Try just "jdbc/db".

HTH

-----Original Message-----
From: Kevin HaleBoyes [mailto:[EMAIL PROTECTED]]
Sent: Donnerstag, 19. Dezember 2002 20:05
To: [EMAIL PROTECTED]
Subject: help with DataSourceRealm in 4.1.17


I've been using JDBCRealm successfully in my application but
jumped on the DataSourceRealm when I saw it in 4.1.17.

So, I replaced my JDBCRealm definition to the DataSourceRealm
but have run into a problem.  I have the following in the
CATALINA_HOME/webapps/cml.xml file:

<Context path="/cml"
      docBase="/usr/local/jakarta/cml"
        debug="99"
   privileged="false">

    <Resource name="jdbc/Db" auth="Container"
type="javax.sql.DataSource"/>
    <ResourceParams name="jdbc/Db">
        <parameter><name>factory</name>
                  
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value></parameter>
        <parameter><name>driverClassName</name>
                  
<value>oracle.jdbc.OracleDriver</value></parameter>
        <parameter><name>url</name>
                  
<value>jdbc:oracle:thin:@200.65.6.188:1521:tiggs9i</value></parameter>
        <parameter><name>username</name>
                   <value>cml</value></parameter>
        <parameter><name>password</name>
                   <value>cml</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>
        <parameter><name>validationQuery</name>
                   <value>select sysdate from
dual</value></parameter>
    </ResourceParams>

    <Realm  className="org.apache.catalina.realm.DataSourceRealm"
                debug="99"
       dataSourceName="java:comp/env/jdbc/Db"
            userTable="mmis_users"
          userNameCol="user_name"
          userCredCol="user_pass"
        userRoleTable="mmis_user_roles"
          roleNameCol="role_name"
               digest="MD5"
        />
</Context>




I know the jdbc/Db JNDI resource is configured properly because
I'm able to access the datasource from the application using:

        Context initCtx = new InitialContext();
        Context envCtx = (Context)initCtx.lookup("java:comp/env");
        DataSource ds = (DataSource)envCtx.lookup("jdbc/Db");
        return ds.getConnection();

but when Tomcat starts up I get the following error:

2002-12-19 14:55:01 DataSourceRealm[/cml]: Exception performing
authentication
javax.naming.NameNotFoundException: Name java:comp 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:463)
        at
org.apache.catalina.realm.DataSourceRealm.start(DataSourceRealm.java:582)
        at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3543)
etc...


I even tried using
       dataSourceName="java:/comp/env/jdbc/Db"
in the Realm definition (note the slash after the colon as
was shown in the Realm HOW-TO) but this gave a similar exception.

Does anyone know what name I should use for the data source?
Thanks,
Kevin.


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to