You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Kieran Kirwan <KK...@dto.ie> on 2003/07/28 13:22:24 UTC

Cocoon and MySQL databases

I'm using Apache Tomcat 4.0 and Cocoon 2.0.4.
I've got a MySQL database called 'abc' which contains a table 'TroubleTickets'.
I can view this using mySQL.exe and it appears to be fine.

... however I can't seem to access this from Cocoon.  I'm following the steps in 'Cocoon Developers Handbook' as follows.

1	Place mysql-connector-java-3.0.8-stable-bin.jar in C:\Program Files\Apache Tomcat 4.0\common\lib
2	Preload JDBC driver
3	Define connection pool
4	Create ESQL query
5	Sitemap Entry


The key inputs i'm using are as follows.

2	Preload JDBC driver (web.xml)
<init-param>
      <param-name>load-class</param-name>
      <param-value>
        org.gjt.mm.mysql.Driver
      </param-value>
</init-param>


2	Define connection pool (cocooon.xconf)
<jdbc name="abc" logger="core.datasources.abc">
<pool-controller min="5" max="10"/>
<auto-commit>false</auto-commit>
<dburl>jdbc:mysql://localhost/abc</dburl>  
<user>root</user>
<password/>
</jdbc>


3	Create ESQL query (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">
<page>
 <content>
  <esql:connection>
   <esql:pool>abc</esql:pool>
   <esql:execute-query>
    <esql:query>
		select * from TroubleTickets
    </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>


4	Sitemap Entry
<map:match pattern="tickets">
	<map:generate type="serverpages" src="tickets.xsp"/>
	<map:serialize type="xml"/>
</map:match>



I'm getting an error in core.log as follows:

DEBUG   (2003-07-28) 12:07.41:467   [core.datasources.abc] (/cocoon/traffic-xml/ticketsXML) HttpProcessor[8080][4]/JdbcConnectionFactory: Exception in JdbcConnectionFactory.newInstance:
java.lang.ClassNotFoundException: org.apache.avalon.excalibur.datasource.Jdbc3Connection

Am I doing something silly? Or is this a Cocoon bug?
I also found this link: http://archives.real-time.com/pipermail/cocoon-devel/2003-June/015269.html


Thanks for you help,

Kieran

_____________________________________________
Kieran Kirwan
Executive Transportation Planner
Transportation Modelling Department
 
Dublin Transportation Office
Hainault House,
69/71 St. Stephen's Green,
Dublin 2,
Ireland.
Tel: +353 (0)1 4778113
Fax: +353 (0) 1 478 5935
website: www.dto.ie <http://www.dto.ie/> 
 
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
Mail Marshal for the presence of computer viruses.

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


Re: Cocoon and MySQL databases

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 28.Jul.2003 -- 12:22 PM, Kieran Kirwan wrote:
> I'm using Apache Tomcat 4.0 and Cocoon 2.0.4.

> java.lang.ClassNotFoundException: org.apache.avalon.excalibur.datasource.Jdbc3Connection

JDBC2 vs JDBC3 problem?

Are you using a jkd1.4 with a Cocoon for jdk1.4 and a JDBC driver for
JDBC3? Try a jdk1.3 with a Cocoon for jdk1.3 to see if it makes a
difference...

	Chris.
-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

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


Re: Cocoon and MySQL databases

Posted by Rod Giffin <ro...@giffinscientific.com>.
Kieran Kirwan said:
> 2	Define connection pool (cocooon.xconf)
> <jdbc name="abc" logger="core.datasources.abc">
> <pool-controller min="5" max="10"/>
> <auto-commit>false</auto-commit>
> <dburl>jdbc:mysql://localhost/abc</dburl>
> <user>root</user>
> <password/>
> </jdbc>

Did you try specifying the port that MySQL is running on?  eg, if you were
using the default setup the dburl would be:
jdbc:mysql://localhost:3306/abc

Rod.




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


Re: Cocoon and MySQL databases

Posted by Geoff Howard <co...@leverageweb.com>.
What happens if you put the mysql jar in WEB-INF\lib?  Also, is this a 
binary version of 2.0.4 or did you build from source?

Geoff

Kieran Kirwan wrote:
> I'm using Apache Tomcat 4.0 and Cocoon 2.0.4.
> I've got a MySQL database called 'abc' which contains a table 'TroubleTickets'.
> I can view this using mySQL.exe and it appears to be fine.
> 
> ... however I can't seem to access this from Cocoon.  I'm following the steps in 'Cocoon Developers Handbook' as follows.
> 
> 1	Place mysql-connector-java-3.0.8-stable-bin.jar in C:\Program Files\Apache Tomcat 4.0\common\lib
> 2	Preload JDBC driver
> 3	Define connection pool
> 4	Create ESQL query
> 5	Sitemap Entry
> 
> 
> The key inputs i'm using are as follows.
> 
> 2	Preload JDBC driver (web.xml)
> <init-param>
>       <param-name>load-class</param-name>
>       <param-value>
>         org.gjt.mm.mysql.Driver
>       </param-value>
> </init-param>
> 
> 
> 2	Define connection pool (cocooon.xconf)
> <jdbc name="abc" logger="core.datasources.abc">
> <pool-controller min="5" max="10"/>
> <auto-commit>false</auto-commit>
> <dburl>jdbc:mysql://localhost/abc</dburl>  
> <user>root</user>
> <password/>
> </jdbc>
> 
> 
> 3	Create ESQL query (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">
> <page>
>  <content>
>   <esql:connection>
>    <esql:pool>abc</esql:pool>
>    <esql:execute-query>
>     <esql:query>
> 		select * from TroubleTickets
>     </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>
> 
> 
> 4	Sitemap Entry
> <map:match pattern="tickets">
> 	<map:generate type="serverpages" src="tickets.xsp"/>
> 	<map:serialize type="xml"/>
> </map:match>
> 
> 
> 
> I'm getting an error in core.log as follows:
> 
> DEBUG   (2003-07-28) 12:07.41:467   [core.datasources.abc] (/cocoon/traffic-xml/ticketsXML) HttpProcessor[8080][4]/JdbcConnectionFactory: Exception in JdbcConnectionFactory.newInstance:
> java.lang.ClassNotFoundException: org.apache.avalon.excalibur.datasource.Jdbc3Connection
> 
> Am I doing something silly? Or is this a Cocoon bug?
> I also found this link: http://archives.real-time.com/pipermail/cocoon-devel/2003-June/015269.html
> 
> 
> Thanks for you help,
> 
> Kieran
> 
> _____________________________________________
> Kieran Kirwan
> Executive Transportation Planner
> Transportation Modelling Department
>  
> Dublin Transportation Office
> Hainault House,
> 69/71 St. Stephen's Green,
> Dublin 2,
> Ireland.
> Tel: +353 (0)1 4778113
> Fax: +353 (0) 1 478 5935
> website: www.dto.ie <http://www.dto.ie/> 
>  
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the system manager.
> 
> This footnote also confirms that this email message has been swept by
> Mail Marshal for the presence of computer viruses.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
> 
> 



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