cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grégory Roche <webmas...@polymorphisme.org>
Subject Cocoon 2.2 and Mysql 5.0
Date Thu, 12 May 2011 14:21:20 GMT


 Hi, 

after the mail, I'm trying to do a test with a database Mysql 5.0 and a block of Cocoon 2.2.
At this moment, it's a catastrophe, my browser return : 

http://locahost:8888/test/sql-page 

"Hello This is my first Cocoon2 page filled with SQL data!  Failed to obtain connection from
datasource 'dbMySQL5'. Made 5 attempts with 5000ms interval" 

Mysql server is ok, and I have create my database with phpMyAdmin.

For my Cocoon, I have : 

-- in the file META-INF/cocoon/spring/datasource.xml : 

    <bean name="org.apache.avalon.excalibur.datasource.DataSourceComponent/dbMySQL5"
        class="org.apache.cocoon.databases.bridge.spring.avalon.SpringToAvalonDataSourceWrapper">
        <property name="wrappedBean">
            <bean class="org.springframework.jdbc.datasource.DriverManagerDataSource" >
              <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
              <property name="url" value="jdbc:mysql://188.165.XX.XX:3306/db?autoReconnect=true"/>

              <property name="username" value="XXX"/>
              <property name="password" value="XXX"/>
            </bean>  
        </property>
    </bean>   

-- In my sitemap.xmap, I have my SQLTransformer and the pipeline for my sql-page.xml :

  <map:transformer logger="sitemap.transformer.sql"
      name="sql" src="org.apache.cocoon.transformation.SQLTransformer"/> 

    <map:match pattern="*">
        <map:generate src="xdocs/{1}.xml" />   
        <map:transform type="sql">
          <map:parameter name="use-connection" value="dbMySQL5" />
        </map:transform>
        <map:transform src="stylesheets/sql2html.xsl" />
        <map:transform type="servletLinkRewriter" />
        <map:serialize type="html" />
      </map:match>  

-- My file sql-page.xml is very simple, it contains just one request SQL :

<page>
  <title>Hello</title>

  <content>
    <para>This is my first Cocoon2 page filled with SQL data!</para>

    <sql:execute-query xmlns:sql="http://apache.org/cocoon/SQL/2.0">
      <sql:query>
        select id, name, description from department
      </sql:query>   
    </sql:execute-query>
  </content>
</page>

Have you an idea ? Thanks. 

Grégory Roche 

www.polymorphisme.com
webmaster@polymorphisme.org
fixe : +33 (0)5.24.07.64.02
port : +33 (0)6.89.54.14.84
Mime
View raw message