hi phil,

please try com.mysql.jdbc.Driver as the driver class. that should work. your
dburl seems to be correct.

otherwise have a look into your mysql-connector jar. there should be a
README inside.

HTH

> -----Ursprüngliche Nachricht-----
> Von: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> Auftrag von Phil Coultard
> Gesendet: Freitag, 4. April 2003 19:53
> An: [EMAIL PROTECTED]
> Betreff: Newbie: yet ANOTHER problem: db access
> (NoValidConnectionException)
>
>
> Geoff: Thanks for all your help, you are a star.
>
> Big apologies from a newbie struggling with the basics of Cocoon...
>
> I have run into yet another problem which I don't seem to be able to get
> over...
>
> This time I am trying to connect to a MySQL db but get the message:
>
> ERROR   (2003-04-04) 16:18.09:150   [sitemap.generator.serverpages]
> (/ltd_coultard/mount/com_coultard/tickets) Thread-10/tickets_xsp:
> Could not
> get the datasource
> org.apache.avalon.excalibur.datasource.NoValidConnectionException:
>  No valid
> JdbcConnection class available
>
> in the error log file
> (tomcat/webapps/applicationname/WEB-INF/logs/error.log) when I run my xsp
> (enclosed below)
>
> I am also new to MySQL but am familiar with MSSQL so...
>
> I have:
> -made the db (called coultard) and made sure MySQL is running (it
> works fine
> solo)
> -put the MySQL db jar file (mysql-connector-java-3.0.6-stable-bin.jar) in
> C:\tomcat\common\lib
> -put the init-param for preloading the driver in web.xml as below.
> -defined the connection pool as below
> -attempted to run the xsp below
>
> I just spits out the title of the page and the session user value (which I
> have set via a login script) which would be consistent with their being no
> results except the same sql statement returns results if run directly in
> MySQL and the error message suggests to me it's not even getting that far.
>
> I am using:
> Win 98
> JDK 1.3.1
> Tomcat 4.1.24
> Cocoon 2.0.4
>
> MySQL 4.0.12Win
> jar file from: mysql-connector-java-3.0.6-stable
>
> What confuses me is that my book (Cocoon developers handbook) assures me
> that any errors preloading the driver or defining the connection pool will
> be thrown up when they are attempted (when the application
> starts) and shown
> in access.log and core.log respectfully. My entries in these two logs look
> fine:
>
> ------------------------------------------------------------------
> ----------
> ----
> DEBUG   (2003-04-04) 16:14.22:850   [access] (Unknown-URI)
> Unknown-thread/CocoonServlet: Trying to load class:
> org.gjt.mm.mysql.Driver
> ------------------------------------------------------------------
> ----------
> ----
>
> ------------------------------------------------------------------
> ----------
> ----
> DEBUG   (2003-04-04) 16:14.24:010   [core.manager] (Unknown-URI)
> Unknown-thread/DefaultComponentFactory: logger attribute is
> core.datasources.coultard
> DEBUG   (2003-04-04) 16:14.24:390   [core.manager] (Unknown-URI)
> Unknown-thread/ThreadSafeComponentHandler: ComponentHandler
> initialized for:
> org.apache.avalon.excalibur.datasource.ResourceLimitingJdbcDataSource
> DEBUG   (2003-04-04) 16:14.24:390   [core.manager] (Unknown-URI)
> Unknown-thread/ExcaliburComponentSelector: Adding
> org.apache.avalon.excalibur.datasource.ResourceLimitingJdbcDataSource for
> hint [coultard]
> DEBUG   (2003-04-04) 16:14.24:390   [core.manager] (Unknown-URI)
> Unknown-thread/ThreadSafeComponentHandler: ComponentHandler
> initialized for:
> org.apache.avalon.excalibur.component.ExcaliburComponentSelector
> ------------------------------------------------------------------
> ----------
> ----
>
> And yet the error thrown when I try to load the page rather suggests to me
> that it can't find, or hasn't 'installed' the jar file properly...
>
> On the assumption that the preload and connection pool substantiations are
> working I have two theories (which I'm sure are probably wrong!)
> 1. That the <param-value>org.gjt.mm.mysql.Driver is incorrect. I got this
> value from my book  but it is sadly for an older MySQL driver. I
> notice the
> first line of the README which comes with the jar file reads "MySQL
> Connector/J 3.0.6 Stable (formerly MM.MySQL)" and was wondering if this
> change in naming convention is mirrored somehow in it. I have
> been unable to
> find a reference for the correct string for this value (MySQL referring to
> "read your servlet engine or application server vendor's documentation";
> Cocoon seemingly not making a reference to what these strings should be
> except for the commented WebSphere, Oracle and IBMWebshpere). Further
> attempts to substantiate this theory and attempts at guessing its
> value have
> been unfruitful.
>
> 2. That my reference to the dburl is incorrect. My db is
> physically located
> in C:\mysql\data\ and not under the tomcat/webapps dir so I was
> wondering if
> this had any influence on the matter.
>
>
> Thankfully
>
> Phil
>
>
> ------------------------------------------------------------------
> ----------
> ----
> extract from tomcat/webapps/applicationname/WEB-INF/web.xml
> ------------------------------------------------------------------
> ----------
> ----
>     <init-param>
>       <param-name>load-class</param-name>
>       <param-value>
>         org.gjt.mm.mysql.Driver
>       </param-value>
>     </init-param>
>
> ------------------------------------------------------------------
> ----------
> ----
> extract from tomcat/webapps/applicationname/WEB-INF/cocoon.xconf
> ------------------------------------------------------------------
> ----------
> ----
>   <!-- Datasources: -->
>   <datasources>
>     <jdbc name="coultard" logger="core.datasources.coultard">
>       <pool-controller max="10" min="5"/>
>       <auto-commit>false</auto-commit>
>       <dburl>jdbc:mysql://localhost/coultard</dburl>
>       <user>root</user>
>       <password/>
>     </jdbc>
>   </datasources>
>
> ------------------------------------------------------------------
> ----------
> ----
> tickets.xsp
> ------------------------------------------------------------------
> ----------
> ----
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> <xsp:page language="java"
>   xmlns:xsp="http://apache.org/xsp";
>   xmlns:esql="http://apache.org/cocoon/SQL/v2";
>   xmlns:xsp-session="http://apache.org/xsp/session/2.0";
> >
>
> <page>
>
>  <page-title>Trouble tickets for <xsp-session:get-attribute
> name="user"/></page-title>
>
>  <content>
>
>   <esql:connection>
>    <esql:pool>coultard</esql:pool>
>    <esql:execute-query>
>     <esql:query>
>      select * from TroubleTickets where Customer =
>      '<xsp-session:get-attribute name="user"/>'
>      order by TicketOpened
>     </esql:query>
>     <esql:results>
>      <tickets>
>       <esql:row-results>
>        <ticket>
>         <esql:get-columns/>
>        </ticket>
>       </esql:row-results>
>      </tickets>
>     </esql:results>
>    </esql:execute-query>
>   </esql:connection>
>
>  </content>
> </page>
>
> </xsp:page>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.465 / Virus Database: 263 - Release Date: 25/03/03
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to