cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roger I Martin PhD" <hypernex...@hypernexinc.com>
Subject Re: [repost] MySQL no suitable driver
Date Fri, 16 Aug 2002 19:29:48 GMT
Look at http://xml.apache.org/cocoon/developing/datasources.html

It's good if the pool is initialized long before your xsp's need it.

In your web.xml file. The you need the following snippet with :

...
<init-param>
  <param-name>load-class</param-name>
  <param-value>
    <!-- For MySQL Database: -->
   com.mysql.jdbc.Driver

    <!-- For PostgeSQL Database: -->
    postgresql.Driver

    <!-- For Oracle Database: -->
    oracle.jdbc.driver.OracleDriver

  </param-value>
</init-param>
...
with the MySQL driver added.  Then in your cocoon.xconf you need:

...
<datasources>
<jdbc name="MY_POOL">
<driver>com.mysql.jdbc.Driver</driver>
<pool-controller min="1" max="10"/>
<!--auto-commit>false</auto-commit-->
<dburl>jdbc:mysql://localhost:3306/test</dburl>
<user>root</user>
<password>5h4p3r5</password>
</jdbc>
</datasources>
...

Then in one of your xsp's
...
            <esql:connection>
              <esql:pool>MY_POOL</esql:pool>
              <esql:execute-query>
                <esql:query>select * from MY_DATABASE_TABLE</esql:query>
                <esql:results>
                  <esql:row-results>
                      <!-- do what you want with the results here-->
                  </esql:row-results>
                </esql:results>
              </esql:execute-query>
            </esql:connection>
...

I'm using mysql-connector-java-3.0.0-beta-bin.jar. It does not appear to be
compressed.  I have found that if you want to apply a bleeding edge
technology such as Cocoon it's good if you have the audacity to go all of
the way and use the latest of every part until you get a fairly stable
environment, protect it by backing up and be willing to try the latest again
and again.  If the latest fails then go back to your backup if your at the
stage you have one but try again within a few weeks.  This actually
minimizes your time of looking at what you think your doing wrong but
aren't.

Try jdk1.4.1 and the cvs HEAD of Cocoon.  If your going to be on the edge,
then being one or two versions back can be rougher than being where the
developers are;  the developers are more likely to address any problems you
discover if your working with the cvs HEAD.

--Roger


----- Original Message -----
From: "Jan Willem Penterman" <jw@shapers.nl>
To: "'Cocoon'" <cocoon-users@xml.apache.org>
Sent: Friday, August 16, 2002 10:38 AM
Subject: [repost] MySQL no suitable driver


> [repost] still stuck on this [/repost]
>
> I'm quite new to Cocoon but want to set up a MySQL connection using
> ESQL. I followed the directives on
> http://www.cocooncenter.de/cc/documents/resources/db-app/index.html and
> altered the settings for MySQL like I see them everwhere in the mail
> archives. So I have an XSP page generated from a subsitemap of the
> default cocoon app:
>
> <?xml version="1.0"?>
> <xsp:page
> language="java"
> xmlns:xsp="http://apache.org/xsp"
> xmlns:esql="http://apache.org/cocoon/SQL/v2">
> <root>
> <esql:connection>
> <esql:execute-query>
> <!-- pooling (doesn't work) -->
> <!-- esql:pool>mysql</esql:pool -->
>
> <!-- basic connection. no pooling
> (doesn't work either) -->
>
> <esql:driver>org.gjt.mm.mysql.Driver</esql:driver>
>
> <esql:dburl>jdbc:mysql://localhost:3306/test</esql:dburl>
> <esql:username>root</esql:username>
> <esql:password>5h4p3r5</esql:password>
>
> ...
>
> </esql:execute-query>
>
> </esql:connection>
> </root>
> </xsp:page>
>
> As you can see it doesn't work both pooling and non-pooling. This is the
> error:
>
> error.log:
> org.apache.cocoon.ProcessingException: Exception in
> ServerPagesGenerator.generate(): java.lang.RuntimeException: Error
> opening connection to dburl: : No suitable driver
>
> Traces I find of the driver:
>
> access.log:
> DEBUG   (2002-08-15) 02:32.20:253   [access] (Unknown-URI)
> Unknown-thread/CocoonServlet: Trying to load class:
> org.gjt.mm.mysql.Driver
>
> core.log:
> DEBUG   (2002-08-15) 02:54.03:637   [core] (Unknown-URI)
> Unknown-thread/Cocoon: Classpath =
> <alotofjars/>;D:\apache-tomcat-4.0.4\webapps\cocoon\WEB-INF\lib\mm.mysql
> -2.0.14-bin.jar;<alotofjars/>;
>
> I can however make a jdbc:mysql connection with a regular servlet. So
> nothing wrong with that.
>
> My system:
>
> Windows XP
> j2sdk1.3.1_4
> tomcat 4.0.4
> cocoon 2.0.3
> MySQL 3.23.49-nt
> mm.mysql-2.0.14
>
> JW
>
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>
>
>



---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message