Environment
Windows 2000 SP3
MySQL 4.0.17
Tomcat 4.1.24 running in c:\jakarta-tomcat-4.1.24\...
Cocoon 2.0.3
Connector mysql-connector-java-3.0.10-stable-bin
Java 1.4.1_02
I have been following the exaples in chapter 8 of the book "Cocoon
Developers Handbook".
The connector is in:
c:\cocoon-2.1.4\build\webapp\WEB-INF\lib\
c:\j2sdk1.4.1_02\jre\lib\ext\
c:\jakarta-tomcat-4.1.24\common\lib\
c:\jakarta-tomcat-4.1.24old\common\lib\
of any consequence.
..\webapps\cocoon\WEB-INF\web.xml
<init-param>
<param-name>load-class</param-name>
<param-value>
<!-- For IBM WebSphere:
com.ibm.servlet.classloader.Handler -->
<!-- For MySQL: -->
org.gjt.mm.mysql.Driver
<!-- For Database Driver: -->
org.hsqldb.jdbcDriver
<!-- For parent ComponentManager sample:
org.apache.cocoon.samples.parentcm.Configurator
-->
</param-value>
</init-param>
..\webapps\cocoon\WEB-INF\cocoon.xconf
<jdbc logger="core.datasources.abc" name="abc">
<pool-controller max="10" min="5"/>
<dburl>jdbc:mysql://localhost:3306/abc</dburl>
<user>person</user>
<password>personpass</password>
</jdbc>
Files of interest:
...\webapps\cocoon\sitemap.xmap (the top level sitemap)
...\webapps\cocoon\abc\*.* (my app)
...\webapps\cocoon\WEB-INF\web.xml
...\webapps\cocoon\WEB-INF\cocoon.xconf
Files of interest at each test point:
...\webapps\cocoon\WEB-INF\logs\*.*
Test
From the browser (IE) execute:
http://192.168.0.2:8080/cocoon/abc/tickets.xsp
Store all results in directory Point1
Key info from logs files:
ERROR (2004-04-30) 08:33.11:959 [access] (/cocoon/abc/tickets.xsp)
Thread-10/CocoonServlet: Problem with Cocoon servlet
org.apache.cocoon.ProcessingException: Exception in
ServerPagesGenerator.generate(): java.lang.RuntimeException: Could not get the
datasource org.apache.avalon.excalibur.datasource.NoValidConnectionException:
No valid JdbcConnection class available
Next Test
First, lets remove all the connectors - they are somewhat scattered. Stop
tomcat, remove, restart.
From the browser (IE) execute:
http://192.168.0.2:8080/cocoon/abc/tickets.xsp
Store all results as Point2
Key info from diag files:
WARN (2004-04-30) 09:09.51:201 [access] (Unknown-URI)
Unknown-thread/CocoonServlet: Could not force-load class:
org.gjt.mm.mysql.Driver
java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
Next Test
OK! Replace the connector in the directory c:\j2sdk1.4.1_02\jre\lib\ext\
only.
Stop and restart Tomcat.
From the browser (IE) execute:
http://192.168.0.2:8080/cocoon/abc/tickets.xsp
Store all results as Point3
ERROR (2004-04-30) 09:16.46:238 [access] (/cocoon/abc/tickets.xsp)
Thread-10/CocoonServlet: Problem with Cocoon servlet
org.apache.cocoon.ProcessingException: Exception in
ServerPagesGenerator.generate(): java.lang.RuntimeException: Could not get the
datasource org.apache.avalon.excalibur.datasource.NoValidConnectionException:
No valid JdbcConnection class available
Next Test
Now I've been in the mailing lists, google and the cocoon wiki; I've found
some VERY similar problems, and the only real idea was to change:
org.gjt.mm.mysql.Driver
to
com.mysql.jdbc.Driver
which I have done.
From the browser (IE) execute:
http://192.168.0.2:8080/cocoon/abc/tickets.xsp
Store all results as Point4
We are back to the error message:
ERROR (2004-04-30) 11:02.25:764 [access] (/cocoon/abc/tickets.xsp)
Thread-10/CocoonServlet: Problem with Cocoon servlet
org.apache.cocoon.ProcessingException: Exception in
ServerPagesGenerator.generate(): java.lang.RuntimeException: Could not get the
datasource org.apache.avalon.excalibur.datasource.NoValidConnectionException:
No valid JdbcConnection class available
I really need some help!
(this is about 2 days and 1 nights work! I started with cocoon 2.1.4
(problems with db), then went to 2.0.4, and finally 2.0.3 (to get to what I
thought was the environment for the book's examples)