cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derek Hohls" <>
Subject Mysql connection error
Date Wed, 13 Jul 2005 10:47:41 GMT
I am struggling with getting a new server to communicate with a mySQL database on another machine.

The database and queries work fine, when running on machine A, where the database is installed,
as does the Cocoon application when running there.  

However, when I try and emulate the Cocoon application on machine B 
(same OS, same Cocoon version - Linux, C2.1.6),
 I get a null pointer exception that I cannot seem to solve.

Here is what I have done.

1. Copied the mysql-connector-java-3.1.7-bin.jar file to tomcat\webapps\cocoon\WEB-INF\lib\

2. Added an entry in web.xml for "com.mysql.jdbc.Driver"

3. Aded an entry in the cocoon.xconf for:

	<jdbc name="mydb">
		<pool-controller min="1" max="50"/>

4. Restarted Cocoon

5. Added a "myuser" entry to the mySQL user table on the database machine, with 

USE mysql;
GRANT USAGE ON *.* to myuser@"" IDENTIFIED BY 'mypassword';
GRANT SELECT ON mydbname.* to ffpreporter@"";

(obviously I am using the actual IP address of Machine B)

6.  The pipeline in question looks like:

<map:match pattern="testproject">
    <map:generate src="sql.xml"/>
    <!-- === SQL Connector ====  -->      
    <map:transform type="sql">
      <map:parameter name="use-connection" value="mydb"/>
      <map:parameter name="show-nr-of-rows" value="true"/> 
      <map:parameter name="clob-encoding" value="UTF-8"/> 
    <map:serialize type="xml"/>

7.  the SQL file contains:

<?xml version="1.0" encoding="UTF-8" ?> 
<sq2:execute-query xmlns:sq2="">
 <sq2:query name="themes">

8.  The stacktrace from Cocoon is a java.lang.NullPointerException;
looking in the error.log reveals:

ERROR   (2005-07-13) 12:40.11:694   [sitemap.transformer.sql] 
(/cocoon/myapp/testproject) http-8080-Processor4/SQLTransformer.Query: Caught a SQLException
java.sql.SQLException: Failed to obtain connection. Made 5 attempts with 5000ms interval

How do I go about trying to pin down why this is happening?


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

View raw message