cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Savory <>
Subject RE: Newbie: yet ANOTHER problem: db access (NoValidConnectionException)
Date Sat, 05 Apr 2003 10:43:44 GMT

Hi Phil,

On Sat, 5 Apr 2003, Phil Coultard wrote:

> Frustrated and feeling rather thick,

Don't worry, I've spent many hours on db connection problems, it's always
a sticking point and a nightmare to get sorted out.

Here's some step-by-step checks (worth repeating, as typos are often the

1) Is the mysql server running and accepting connections?

- Test this using the mysql command-line client:

  mysql -D your_db_name -h localhost -P 3306 -pyour_password -u your_user

  Make sure you can select the information you want to use in the XSP (to
  ensure the user you're connecting as has rights to the db and the

  SELECT foo FROM bar;

- Test connections with telnet:

  telnet localhost 3306
  (you should see something like "3.23.56-log$8,u+r}>" which shows you
  can at least connect to localhost)

2) Is the (right) mysql jar available?

- Check that you downloaded the correct jar for your JDK, as jdbc
connectors are java version-specific.

- Check in $TOMCAT_HOME/webapps/cocoon/WEB-INF/lib/ for the presence of
mysql-connector-java-3.0.6-bin.jar or similar.

- Check that it is correctly referenced in WEB-INF/web.xml:

        <!-- For Database Driver: -->

3) Is the Cocoon database connection pool configured?

- Check that it's correctly configured in WEB-INF/cocoon.xconf:

    <jdbc logger="core.datasources.your_db_name" name="your_db_name">
      <pool-controller max="10" min="5"/>

4) Is the XSP written correctly?

- Try the simplest possible XSP that could work, first:

<?xml version="1.0"?>

<xsp:page language="java" xmlns:xsp="" xmlns:esql="">


        <esql:query>SELECT foo FROM bar</esql:query>
            <foo><esql:get-string column="foo"/></foo>



That said, from looking at what you've done so far, you've got everything
correct :-/


Andrew Savory                                Email:
Managing Director                              Tel:  +44 (0)870 741 6658
Luminas Internet Applications                  Fax:  +44 (0)700 598 1135
This is not an official statement or order.    Web:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message