I saw one other post on the archives about this but it has no resolution.

I have set up Tomcat 4.0.4 to use the jndi resource factory to use pgsql
jdbc connection "pooling" (fake pooling).

Whenever I call the second
line of this code:
Context ctx = (Context) new InitialContext().lookup("java:comp/env");
conn = ((DataSource) ctx.lookup("jdbc/IFDB")).getConnection();

I get a "Something unusual has occured to cause the driver to fail. Please
report this exception: Exception: java.lang.NullPointerException Stack
Trace: java.lang.NullPointerException at
org.postgresql.Connection.openConnection(Connection.java:155)"
error.

My server.xml resource looks like this within the context tag:
  <ResourceParams name="jdbc/IFDB">
    <parameter>
      <name>user</name>
      <value>kenjackson</value>
    </parameter>
    <parameter>
      <name>password</name>
      <value>29gzy8</value>
    </parameter>
    <parameter>
      <name>driverClassName</name>
      <value>org.postgresql.Driver</value>
    </parameter>
    <parameter>
      <name>driverName</name>
      <value>jdbc:postgresql://postgresql1.eapps.com:5432/</value>
    </parameter>
  </ResourceParams>

NOTE: I have changed the user parameter to name "username" but that
doesn't help and the tyrex api asks for "user" so I'm assuming that's
right.

 and my webapp web.xml:
  <resource-ref>
    <description>
    Resource reference to a factory for java.sql.Connection
    instances that may be used for talking to a particular
    database that is configured in the server.xml file.
    </description>
    <res-ref-name>
      jdbc/IFDB
    </res-ref-name>
    <res-type>
      javax.sql.DataSource
    </res-type>
    <res-auth>
      Container
    </res-auth>
  </resource-ref>

Has anyone else run into a similar problem. From what I have seen on the
list the Tyrex api is a problem, but I'm currently stuck with it.

thanks,
Adam Kramer



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

Reply via email to