cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alan South" <a...@telia.com>
Subject Re: Would really appreciate help on this MySQL connection issue...
Date Fri, 30 Apr 2004 12:28:46 GMT


Happily, I have found a solution in the archives.
Sorry to bother you good people unnecessarily :-(

Credit to Geoff in relation to a question raised by Derek Holhs on Thu 21 Aug  2003 and entitled
"Cocoon Database samples not working?".

Basically I am running java 1.4.
I have downloaded and installed Cocoon 2.0.4 for vm14.
This works.

Not that I understand the details, but this seems to be an excalibur-datasource vm issue.

BR Alan







  ----- Original Message ----- 
  From: Alan South 
  To: users@cocoon.apache.org 
  Cc: Alan South home 
  Sent: Friday, April 30, 2004 12:00 PM
  Subject: Would really appreciate help on this MySQL connection issue...


  This is a 2 day and 1 night issue todate, but I can't take it any further myself.

  Would really appreciate help!


  My background: I've been using Tomcat to handle J2ME clients for a while, but have also
a growing interest in mobile publishing.
  So I bought a book ("Cocoon, Developer's Guide"), downloaded Cocoon and started work. 
  I have some experience, but I'm way out of my depth here.

  2.1.4 looks and feels nice, but I had problems with the database connectivity.

  So I installed 2.0.3, and did things as near as I could manage according to "the book".

  But I am left with an error message which I don't have the competence to understand.



  Basically, I am trying to use an esql logicsheet to access a MySQL database - the code is
from the book.
  And this is what I get in the log file.

  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

  Now I have been in all those places where I can hope to find help,  but to no avail.

  Note that I have already changed org.gjt.mm.mysql.Driver to com.mysql.jdbc.Driver

  I have prepared a zipped package (not enclosed here) containing all the gory details...

  Below is the ReadMe file from the above package.


  BR Alan South

  --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  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)



Mime
View raw message