tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Wallace <tomca...@rwsoft-online.com>
Subject JNDI JDBC COnnection pooling problem...
Date Mon, 12 Aug 2002 15:33:09 GMT
Hello. This has to be a very simple one for those who know.

I'm getting a java.lang.NullPointerException in my app, in the second
line here:

Context ctx = (Context) new InitialContext().lookup("java:comp/env");
conn = ((DataSource) ctx.lookup("jdbc/pgsql")).getConnection(); **Error
happens here**

And have the following in my server.xml (I put my whole context in case
my error is there) 

        <Context path="/lto" docBase="lto" debug="0"                 
reloadable="true" crossContext="true">
          <Logger className="org.apache.catalina.logger.FileLogger"
                     prefix="localhost_lto_log." suffix=".txt"
                  timestamp="true"/>
          <Environment name="maxExemptions" type="java.lang.Integer"
                      value="15"/>
          <Parameter name="context.param.name"
value="context.param.value" override="false"/>

        <Resource name="jdbc/pgsql" auth="Container"
                    type="javax.sql.DataSource"/>
          <ResourceParams name="jdbc/pgsql">
           
<parameter><name>user</name><value>awallace</value></parameter>
           
<parameter><name>password</name><value>passwd</value></parameter>
            <parameter><name>driverClassName</name>
              <value>org.postgresql.Driver</value></parameter>
            <parameter><name>driverName</name>
             
<value>jdbc:postgresql://10.100.101.1/awallace</value></parameter>
          </ResourceParams>
          <Resource name="mail/Session" auth="Container"
                    type="javax.mail.Session"/>
          <ResourceParams name="mail/Session">
            <parameter>
              <name>mail.smtp.host</name>
              <value>localhost</value>
            </parameter>
          </ResourceParams>
                
                <Realm className="org.apache.catalina.realm.JDBCRealm"
debug="99"
                        driverName="org.postgresql.Driver"
                       
connectionURL="jdbc:postgresql://10.100.101.1/awallace?user=awallace;password=passwd"
                        userTable="tbl_users" userNameCol="user_name"
userCredCol="password"
                        userRoleTable="user_roles"
roleNameCol="role_name"
                        digest="MD5"/>
        </Context>



Thank you in advance.




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


Mime
View raw message