You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by sm...@arcor.de on 2004/09/22 17:15:19 UTC

database test how to

hello experts,

i tried to connect to a my-sql database connection. since there's no lenya
tutorial to do this, i referred to the cocoon book of stephan niedermeier.
(www.logabit.de)

now i get an error (when calling mytest.xml in the browser) wich tells me:

"The requested document '/mysqltest.xml' with document-id '/mysqltest' does not exist."

here's what i did, would be happy about some hints/help:
(maybe i think to complicated)

1. i went to lenya/WEB-INF/cocoon.xconf. i added the following lines:

 <jdbc name="mysql-pool" logger="mysql-pool">
  <pool-controller max="10" min="5" />
  <auto-commit>true</auto-commit>
   <driver>com.mysql.jdbc.Driver</driver>
   <dburl>jdbc:mysql://recher:3306/database</dburl>
   <user>xxx</user>
    <passwort>xxx</passwort>
  </jdbc>
  
2. i went to lenya/lenya/pubs/my-pub/publication-sitemap.xmap
 <map:transformers>
   <map:transformer name="sql"
        logger="sitemap.transformer.sql"
        src="org.apache.cocoon.transformation.SQLTransformer"/>
   </map:transformers>
    	
3. i added a pipiline to test the connection:
 <map:pipeline>
   <map:match pattern="**mysqltest.xml**">
       <map:generate type="file" src="content/live/mysqltest.xml"/>
       <map:transform type="sql">
          <map:parameter name="use-connection" value="mysql-pool"/>
       </map:transform>
    </map:match>
    </map:pipeline>

i put a file called mysqltest.xml in the directory. this file looks as
follows:
<?xml version="1.0" encoding="utf-8"?>
<!-- Diese Datei dient zum Test der Datenbank Verbindung -->
<sql:execute-query
 xmlns:sql="http://apache.org/cocoon/SQL/2.0">
    <sql:query>
       SELECT * FROM gebaeude
    </sql:query>
</sql:execute-query>


Arcor-DSL: jetzt ohne Einrichtungspreis einsteigen oder wechseln
Sie sparen 99,95 Euro. Arcor-DSL ist in vielen Anschlussgebieten
verfügbar. http://www.arcor.de/home/redir.php/emf-dsl-1


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


Re: database test how to

Posted by Andreas Hartmann <an...@apache.org>.
sm-foren@arcor.de wrote:
> hello experts,
> 
> i tried to connect to a my-sql database connection. since there's no lenya
> tutorial to do this, i referred to the cocoon book of stephan niedermeier.
> (www.logabit.de)
> 
> now i get an error (when calling mytest.xml in the browser) wich tells me:
> 
> "The requested document '/mysqltest.xml' with document-id '/mysqltest' does not exist."
> 
> here's what i did, would be happy about some hints/help:
> (maybe i think to complicated)
> 

[...]

> 3. i added a pipiline to test the connection:

In which sitemap?

>  <map:pipeline>
>    <map:match pattern="**mysqltest.xml**">
>        <map:generate type="file" src="content/live/mysqltest.xml"/>
>        <map:transform type="sql">
>           <map:parameter name="use-connection" value="mysql-pool"/>
>        </map:transform>
>     </map:match>
>     </map:pipeline>

What do the logfiles say?
Is there an exception in handle-errors.log?

-- Andreas


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