You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Richard Cunliffe <ri...@cunliffe.net> on 2003/02/02 23:51:38 UTC

Cocoon and MySQL

(I have attached my cocoon and tomcat logs as Zip files)

 

 

Hi,

 

            MS Windows      XP

            Apache              2.0.43

            Tomcat             4.0.6

            Cocoon              2.0.4

            JDK                   1.3.1_06

            MySQL              3.23.55

            JDBC                 2.0.14

 

 

I am trying to connect to a MySQL database and have followed the
instructions provided by Flash Guides and Wiki, but cocoon does not
start-up after I edit the cocoon.xconf. If I comment out the inserted
code, and restart tomcat then cocoon will load.

 

I have download the JDBC file: mysql-connector-java-2.0.14.jar and have
put it in the following directories:

 

 
C:\tomcat\webapps\cocoon\WEB-INF\lib\mysql-connector-java-2.0.14-bin.jar

      C:\tomcat\lib\mysql-connector-java-2.0.14-bin.jar

 

 

 

The relevant part of web.xml looks like this:

 

 

     <init-param>

        <param-name>load-class</param-name>

        <param-value>

          <!-- For MySQL Driver: -->

        com.mysql.jdbc.Driver

        <!-- For Database Driver: -->

             org.hsqldb.jdbcDriver

 

        <!-- For parent ComponentManager sample:

        org.apache.cocoon.samples.parentcm.Configurator

        -->

        </param-value>

            </init-param>

 

 

 

 

 

The relevant part of cocoon.xconf looks like so:

 

 

  <!-- Datasources: -->

  <datasources>

    <jdbc logger="core.datasources.personnel" name="personnel">

      <!--

          If you have an Oracle database, and are using the the

      pool-controller below, you should add the attribute

      "oradb" and set it to true.

 

      <pool-controller min="5" max="10" oradb="true"/>

 

      That way the test to see if the server has disconnected

      the JdbcConnection will function properly.

      -->

      <pool-controller max="10" min="5"/>

      <!--

          If you need to ensure an autocommit is set to true or

      false, then create the "auto-commit" element below.

 

      <auto-commit>false</auto-commit>

 

      The default is true.

      -->

      <dburl>jdbc:hsqldb:hsql://localhost:9002</dburl>

      <user>sa</user>

      <password/>

    

      <jdbc name="personnel">

            <pool-controller min="5" max="10"/>

            <auto-commit>true</auto-commit>

            <dburl>jdbc:mysql://192.168.44.21:3306/soundpool</dbrul>

            <user>r_cunliffe</user>

            <password>????????</password>

      </jdbc>

 

 

      </jdbc>

  </datasources>

 

 

 

The following line I was unsure about:

 

<dburl>jdbc:mysql://192.168.44.21:3306</dbrul>

 

I got the localhost address from MySQL Admin - I'm not sure if this is
right? I uncommented these items from the my.ini file.

 

I am also not sure about <jdbc name = "">.  I have tried researching
this but I'm still unsure.

 

 

 

On the Flash Guide it suggested that I should delete the following
directory, which I have done:

 

C:\tomcat\work\Standalone\localhost\cocoon

 

But it recreates itself.

 

What can you suggest? Is there anything on the MySQL side I should be
checking?

 

 

 

Thanks,

 

Richard.

 

 

 


Re: Directories

Posted by Konstantin Piroumian <kp...@apache.org>.
This can be done in Tomcat settings (see <tomcat-home>/conf/server.xml) and
then add a new context pointing to your cocoon webapp directory with empty
contex path, something like this:

        <Context path="" docBase="cocoon">
            ...
        </Context>

-- Konstantin

----- Original Message -----
From: "Richard Cunliffe" <ri...@cunliffe.net>
To: <co...@xml.apache.org>
Sent: Tuesday, February 04, 2003 18:20
Subject: Directories


> Hi,
>
> Cocoon 2.0.4
> Tomcat 4.0.6
>
> Can someone point me in the right direction for setting up directories?
> For example my current URI and hard disk location looks like this:
>
> http://192.168.0.5:8080/cocoon/soundpool/soundpool.html
> C:\tomcat\webapps\cocoon\soundpool.xml
>
> If I wanted to change the URI address to this:
> http://192.168.0.5:8080/soundpool/soundpool.html
>
> How would I change the disk location, and in what files would I need to
> change for it to direct the incoming request to the right disk location?
>
> Is there an equivalent to flash guide on this subject?
>
> Thanks,
>
> Richard.
>
>
>
> ---------------------------------------------------------------------
> 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:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Directories

Posted by SAXESS - Hussayn Dabbous <da...@saxess.com>.
ok,

1.) you must be pretty clear, that simply moving your
directories into another folder under webapps wont be the
solution of your problem.

2.) it depends what you want to achieve. the simplest solution
would be to make a sitemap mount. this is done as follows
(i pray, i did no mistake here, shout at me, if its wrong..)

1.) go to your cocoon main folder.
2.) cretae a folder named soundpool
3.) move your xsl xml files to that folder
4.) create a file named sitemap.xmap
     put all that YOU(!) have put into the original
     cocoon sitemap.xmap into this new file

5.) revert the cocoon.xmap in the cocoon main directory
     to its delivery state.

6.) Now edit the reverted sitemap.xmap and add the following:

     a. search for the line <map:pipelines>
     b. directly beneath this line add the following to your sitemap:

     <map:pipeline>
       <map:match pattern="*/**">
         <map:mount check-reload="yes"
                    reload-method="synchron"
                    src="{1}/"
                    uri-prefix="{1}"/>
      </map:match>
     </map:pipeline>

7.) go to the subfolder soundpool and edit the sitemap.xconf there

     a. at the top of the file add the following:

      <map:components>
       <map:generators default="file"/>
       <map:transformers default="xslt"/>
       <map:serializers default="html"/>
       <map:matchers default="wildcard"/>
      </map:components>

      im not shure if this is really needed...

8.) Now you can enter on your URL

     http://192.168.0.5:8080/soundpool/soundpool.html

     and you will get what you want.

Maybe you are seeking for a solution where you can completely
separate cocoon and your soundpool physically. If you want this,
you can by creating a backend webapp soundpool and use cocoon as
frontend webapp, but this is far more complex. I just did this for
a very complex environment. But you have to think twice, if you
really want to do it like that.

regards, hussayn


Richard Cunliffe wrote:
> Jonathan,
> 
> I have just tried the suggestion by Konstantin, which was this:
> 
>         <Context path="" docBase="cocoon">
>             ...
>         </Context>
> 
> This has changed the address, but has not changed the physical directory
> that they are in. I am trying to clean up my directories!
> 
> I have made a new folder called soundpool in webapps like you suggested,
> but what do I need to change in the server.xml. I have found the section
> vitual host and have copied it below:
> 
> 
> <!-- Define the default virtual host -->
> <Host name="localhost" debug="0" appBase="webapps" unpackWARs="true">
> <Listener className="org.apache.ajp.tomcat4.config.ApacheConfig"
> append="true"/>
> 
> 
> Which part of this would I change for it to point it in the right
> direction?
> 
> I am also not sure what you mean by my cocoon's main sitemap is mounting
> my soundpool sitemap. The way I have it set up at the moment is that I
> have main sitemap in the following directory:
> 
> C:\tomcat\webapps\cocoon\sitemap.xml
> 
> My XML and XSL files are also stored in this directory, hence the need
> for some organisation. Obviously I would need to move my sitemap with
> the files to there new folder, so how would I my main sitemap mount the
> soundpool sitemap?
> 
> Thanks,
> 
> Richard.
> 
> (By the way I had a quick look on the wiki site, and couldn't find
> anything, hence my ask for help here)
> 
> 
> 
> -----Original Message-----
> From: Jonathan Patrick Freeman [mailto:jonathan@jonathanpatrick.com] 
> Sent: 04 February 2003 15:35
> To: cocoon-users@xml.apache.org
> Subject: Re: Directories
> 
> Richard,
> 
> Unless I'm wrong (and usually I am :) I think you need to move your
> directory "soundpool" to a webapp level and update the virtual host
> section
> of your server.xml file in tomcat's conf directory. Your cocoon's main
> sitemap is mounting your soundpool sitemap, correct? The cocoon
> directory is
> already a webapp. You simply need to make soundpool a webapp with its
> main
> sitemap and WEB-INF folder, jars, libs, etc...
> 
> Something like:  C:\tomcat\webapps\soundpool
> 
> This really should be documented on Wiki too. Maybe it already is?
> 
> Regards,
> -Jonathan
> 
> 
> ----- Original Message -----
> From: "Richard Cunliffe" <ri...@cunliffe.net>
> To: <co...@xml.apache.org>
> Sent: Tuesday, February 04, 2003 10:20 AM
> Subject: Directories
> 
> 
> 
>>Hi,
>>
>>Cocoon 2.0.4
>>Tomcat 4.0.6
>>
>>Can someone point me in the right direction for setting up
> 
> directories?
> 
>>For example my current URI and hard disk location looks like this:
>>
>>http://192.168.0.5:8080/cocoon/soundpool/soundpool.html
>>C:\tomcat\webapps\cocoon\soundpool.xml
>>
>>If I wanted to change the URI address to this:
>>http://192.168.0.5:8080/soundpool/soundpool.html
>>
>>How would I change the disk location, and in what files would I need
> 
> to
> 
>>change for it to direct the incoming request to the right disk
> 
> location?
> 
>>Is there an equivalent to flash guide on this subject?
>>
>>Thanks,
>>
>>Richard.
>>
> 
> 
> 
> 
> ---------------------------------------------------------------------
> 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:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@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:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
> 

-- 
Dr. Hussayn Dabbous
SAXESS Software Design GmbH
Neuenhöfer Allee 125
50935 Köln
Telefon: +49-221-56011-0
Fax:     +49-221-56011-20
E-Mail:  dabbous@saxess.com


---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


RE: Directories

Posted by Richard Cunliffe <ri...@cunliffe.net>.
Jonathan,

I have just tried the suggestion by Konstantin, which was this:

        <Context path="" docBase="cocoon">
            ...
        </Context>

This has changed the address, but has not changed the physical directory
that they are in. I am trying to clean up my directories!

I have made a new folder called soundpool in webapps like you suggested,
but what do I need to change in the server.xml. I have found the section
vitual host and have copied it below:


<!-- Define the default virtual host -->
<Host name="localhost" debug="0" appBase="webapps" unpackWARs="true">
<Listener className="org.apache.ajp.tomcat4.config.ApacheConfig"
append="true"/>


Which part of this would I change for it to point it in the right
direction?

I am also not sure what you mean by my cocoon's main sitemap is mounting
my soundpool sitemap. The way I have it set up at the moment is that I
have main sitemap in the following directory:

C:\tomcat\webapps\cocoon\sitemap.xml

My XML and XSL files are also stored in this directory, hence the need
for some organisation. Obviously I would need to move my sitemap with
the files to there new folder, so how would I my main sitemap mount the
soundpool sitemap?

Thanks,

Richard.

(By the way I had a quick look on the wiki site, and couldn't find
anything, hence my ask for help here)



-----Original Message-----
From: Jonathan Patrick Freeman [mailto:jonathan@jonathanpatrick.com] 
Sent: 04 February 2003 15:35
To: cocoon-users@xml.apache.org
Subject: Re: Directories

Richard,

Unless I'm wrong (and usually I am :) I think you need to move your
directory "soundpool" to a webapp level and update the virtual host
section
of your server.xml file in tomcat's conf directory. Your cocoon's main
sitemap is mounting your soundpool sitemap, correct? The cocoon
directory is
already a webapp. You simply need to make soundpool a webapp with its
main
sitemap and WEB-INF folder, jars, libs, etc...

Something like:  C:\tomcat\webapps\soundpool

This really should be documented on Wiki too. Maybe it already is?

Regards,
-Jonathan


----- Original Message -----
From: "Richard Cunliffe" <ri...@cunliffe.net>
To: <co...@xml.apache.org>
Sent: Tuesday, February 04, 2003 10:20 AM
Subject: Directories


> Hi,
>
> Cocoon 2.0.4
> Tomcat 4.0.6
>
> Can someone point me in the right direction for setting up
directories?
> For example my current URI and hard disk location looks like this:
>
> http://192.168.0.5:8080/cocoon/soundpool/soundpool.html
> C:\tomcat\webapps\cocoon\soundpool.xml
>
> If I wanted to change the URI address to this:
> http://192.168.0.5:8080/soundpool/soundpool.html
>
> How would I change the disk location, and in what files would I need
to
> change for it to direct the incoming request to the right disk
location?
>
> Is there an equivalent to flash guide on this subject?
>
> Thanks,
>
> Richard.
>



---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Directories

Posted by Jonathan Patrick Freeman <jo...@jonathanpatrick.com>.
Richard,

Unless I'm wrong (and usually I am :) I think you need to move your
directory "soundpool" to a webapp level and update the virtual host section
of your server.xml file in tomcat's conf directory. Your cocoon's main
sitemap is mounting your soundpool sitemap, correct? The cocoon directory is
already a webapp. You simply need to make soundpool a webapp with its main
sitemap and WEB-INF folder, jars, libs, etc...

Something like:  C:\tomcat\webapps\soundpool

This really should be documented on Wiki too. Maybe it already is?

Regards,
-Jonathan


----- Original Message -----
From: "Richard Cunliffe" <ri...@cunliffe.net>
To: <co...@xml.apache.org>
Sent: Tuesday, February 04, 2003 10:20 AM
Subject: Directories


> Hi,
>
> Cocoon 2.0.4
> Tomcat 4.0.6
>
> Can someone point me in the right direction for setting up directories?
> For example my current URI and hard disk location looks like this:
>
> http://192.168.0.5:8080/cocoon/soundpool/soundpool.html
> C:\tomcat\webapps\cocoon\soundpool.xml
>
> If I wanted to change the URI address to this:
> http://192.168.0.5:8080/soundpool/soundpool.html
>
> How would I change the disk location, and in what files would I need to
> change for it to direct the incoming request to the right disk location?
>
> Is there an equivalent to flash guide on this subject?
>
> Thanks,
>
> Richard.
>



---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Directories

Posted by Richard Cunliffe <ri...@cunliffe.net>.
Hi,

Cocoon 2.0.4
Tomcat 4.0.6

Can someone point me in the right direction for setting up directories?
For example my current URI and hard disk location looks like this:

http://192.168.0.5:8080/cocoon/soundpool/soundpool.html
C:\tomcat\webapps\cocoon\soundpool.xml

If I wanted to change the URI address to this:
http://192.168.0.5:8080/soundpool/soundpool.html

How would I change the disk location, and in what files would I need to
change for it to direct the incoming request to the right disk location?

Is there an equivalent to flash guide on this subject?

Thanks,

Richard.



---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Cocoon and MySQL

Posted by Martin Holz <ho...@fiz-chemie.de>.
"Richard Cunliffe" <ri...@cunliffe.net> writes:

> Martin,
> 
> I have made your suggested changes and the web page still comes up
> completely blank. Is there anything else I should be looking at?

Lower log level and look into the logs :-(.
Usually SQLTransformer complains about sql errors.
Change serialize type to xml, if yoz disabled 
the XSLTransformer - maybe there is some 
error message hiding.


Martin

---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: IRC, SILC

Posted by Andrew Savory <an...@luminas.co.uk>.
On Mon, 3 Feb 2003, Antonio Gallardo wrote:

> Heiko Milke dijo:
> > Hey folks,
> >
> > is there any channel on IRCNet or SILCNET for cocoon?
>
> Good question. ;-)

irc.oftc.net #cocoon


Andrew.

-- 
Andrew Savory                                Email: andrew@luminas.co.uk
Managing Director                              Tel:  +44 (0)870 741 6658
Luminas Internet Applications                  Fax:  +44 (0)700 598 1135
This is not an official statement or order.    Web:    www.luminas.co.uk

---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: IRC, SILC

Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Heiko Milke dijo:
> Hey folks,
>
> is there any channel on IRCNet or SILCNET for cocoon?

Good question. ;-)

Antonio
>
> Heiko Milke
>
>
> ---------------------------------------------------------------------
> 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:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


IRC, SILC

Posted by Heiko Milke <he...@cosmoblonde.de>.
Hey folks,

is there any channel on IRCNet or SILCNET for cocoon?

Heiko Milke


---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


AW: Cocoon and MySQL

Posted by Marco Rolappe <m_...@web.de>.
richard,

once again my advice: take a look at the logs (here access.log):

DEBUG   (2003-02-03) 13:18.51:614   [access]
(/cocoon/soundpool/database.html)
HttpProcessor[8080][4]/AbstractEnvironment: Reset context to
file:/C:/tomcat/webapps/cocoon/
WARN    (2003-02-03) 13:18.51:614   [access]
(/cocoon/soundpool/database.html) HttpProcessor[8080][4]/CocoonServlet: The
resource was not found
org.apache.cocoon.ResourceNotFoundException: Resource not found
file:/C:/tomcat/webapps/cocoon/soundpool/database.xml:
java.io.FileNotFoundException:
C:\tomcat\webapps\cocoon\soundpool\database.xml (The system cannot find the
path specified)
	at
org.apache.cocoon.components.source.FileSource.getInputStream(FileSource.jav
a:145)
	at
org.apache.cocoon.components.source.AbstractStreamSource.getInputSource(Abst
ractStreamSource.java:161)
	at
org.apache.cocoon.components.source.AbstractStreamSource.toSAX(AbstractStrea
mSource.java:206)
	at
org.apache.cocoon.generation.FileGenerator.generate(FileGenerator.java:143)
	at
org.apache.cocoon.components.pipeline.CachingEventPipeline.process(CachingEv
entPipeline.java:250)
	at
org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingS
treamPipeline.java:395)
...


> -----Ursprungliche Nachricht-----
> Von: cocoon-users-return-46045-m_rolappe=web.de@xml.apache.org
> [mailto:cocoon-users-return-46045-m_rolappe=web.de@xml.apache.org]Im
> Auftrag von Richard Cunliffe
> Gesendet: Montag, 3. Februar 2003 15:29
> An: cocoon-users@xml.apache.org
> Betreff: RE: Cocoon and MySQL
>
>
> Martin,
>
> I have made your suggested changes and the web page still comes up
> completely blank. Is there anything else I should be looking at?
>
> Thanks,
>
> Richard.
>
>
> -----Original Message-----
> From: holz@fiz-chemie.de [mailto:holz@fiz-chemie.de]
> Sent: 03 February 2003 14:02
> To: cocoon-users@xml.apache.org
> Subject: Re: Cocoon and MySQL
>
> Hello Richard,
>
>
> "Richard Cunliffe" <ri...@cunliffe.net> writes:
>
> > (logs attached)
> >
> > Hi,
> >
> > I have now got cocoon to start, and I have now put my pipeline in, but
> > the page is coming up blank, when viewed through IE6.
> >
> > My pipeline in the sitemap looks like this:
> >
> >
> > <!-- soundpool Database (SQL) -->
> >
> > <map:pipeline>
> >             <map:match pattern="soundpool/database.html">
> > 			<map:generate src="soundpool/database.xml"/>
> > 			<map:transform type="sql">
> > 			<map:parameter name="RICHARD"
> > value="soundpool"/>
> > 			</map:transform>
> > 			<map:transform src="databasepc.xsl"/>
> Do one step after the other -- disable the transformer
> for testing or use labels.
>
> > 			<map:serialize/>
> >             </map:match>
> > </map:pipeline>
> >
> >
> >
> > I am unsure what should go under name="". I have assumed it's the
> local
> > host name given in mysql?
>
> No, it is the name of the connection as defined in your cocoon.xconf.
> My entry looks like this:
>
>   <!-- Datasources: -->
>    <datasources>
>     <jdbc name="slide" logger="vsc.sql" >
>       <pool-controller min="2" max="6" />
>       <auto-commit>true</auto-commit>
>       <dburl>jdbc:postgresql://bog.fiz-chemie.de/slidestore</dburl>
>       <user>slide</user>
>       <password>geheim</password>
>     </jdbc>
>    </datasources>
>
> So the parameter to the SQL Transformer is:
>   <map:transform type="sql">
>       <map:parameter name="use-connection" value="slide"/>
>   </map:transform>
> Remember to restart your servlet engine after changes to cocoon.xconf.
>
> >
> > My web.xml looks like so:
> Looks okay.
>
> >
> > My database.xml looks like this:
> >
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <document>
> > 	<text>soundpool</text>
> > 	<title>the databse</title>
> > 	<sql:execute-query xmlns:sql="http://apache.org/cocoon/SQL/2.0">
>
> > <sql:use-connection>localhost/soundpool</sql:use-connection>
> You don't need this line.
>
> > 		<sql:query>
> > 			SELECT generalMusicTitle FROM album
> > 		</sql:query>
> > 	</sql:execute-query>
> > </document>
>
>
> --
> Martin Holz                FIZ CHEMIE Berlin
> <ho...@fiz-chemie.de>
>
>
>
> ---------------------------------------------------------------------
> 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:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@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:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


RE: Cocoon and MySQL

Posted by Richard Cunliffe <ri...@cunliffe.net>.
Martin,

I have made your suggested changes and the web page still comes up
completely blank. Is there anything else I should be looking at?

Thanks,

Richard.


-----Original Message-----
From: holz@fiz-chemie.de [mailto:holz@fiz-chemie.de] 
Sent: 03 February 2003 14:02
To: cocoon-users@xml.apache.org
Subject: Re: Cocoon and MySQL

Hello Richard,


"Richard Cunliffe" <ri...@cunliffe.net> writes:

> (logs attached)
> 
> Hi,
> 
> I have now got cocoon to start, and I have now put my pipeline in, but
> the page is coming up blank, when viewed through IE6.
> 
> My pipeline in the sitemap looks like this:
> 
> 
> <!-- soundpool Database (SQL) -->
> 
> <map:pipeline>
>             <map:match pattern="soundpool/database.html">
> 			<map:generate src="soundpool/database.xml"/>
> 			<map:transform type="sql">
> 			<map:parameter name="RICHARD"
> value="soundpool"/>
> 			</map:transform>
> 			<map:transform src="databasepc.xsl"/>
Do one step after the other -- disable the transformer
for testing or use labels.

> 			<map:serialize/>
>             </map:match>
> </map:pipeline>
> 
> 
> 
> I am unsure what should go under name="". I have assumed it's the
local
> host name given in mysql?

No, it is the name of the connection as defined in your cocoon.xconf.
My entry looks like this:

  <!-- Datasources: -->
   <datasources>
    <jdbc name="slide" logger="vsc.sql" > 
      <pool-controller min="2" max="6" />
      <auto-commit>true</auto-commit>
      <dburl>jdbc:postgresql://bog.fiz-chemie.de/slidestore</dburl>
      <user>slide</user>
      <password>geheim</password>
    </jdbc>
   </datasources>

So the parameter to the SQL Transformer is:
  <map:transform type="sql">
      <map:parameter name="use-connection" value="slide"/>
  </map:transform>
Remember to restart your servlet engine after changes to cocoon.xconf.

> 
> My web.xml looks like so:
Looks okay.

> 
> My database.xml looks like this:
> 
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <document>
> 	<text>soundpool</text>
> 	<title>the databse</title>
> 	<sql:execute-query xmlns:sql="http://apache.org/cocoon/SQL/2.0">
 	
> <sql:use-connection>localhost/soundpool</sql:use-connection>
You don't need this line.

> 		<sql:query>
> 			SELECT generalMusicTitle FROM album
> 		</sql:query>
> 	</sql:execute-query>
> </document>


--
Martin Holz                FIZ CHEMIE Berlin
<ho...@fiz-chemie.de>  



---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Cocoon and MySQL

Posted by Martin Holz <ho...@fiz-chemie.de>.
Hello Richard,


"Richard Cunliffe" <ri...@cunliffe.net> writes:

> (logs attached)
> 
> Hi,
> 
> I have now got cocoon to start, and I have now put my pipeline in, but
> the page is coming up blank, when viewed through IE6.
> 
> My pipeline in the sitemap looks like this:
> 
> 
> <!-- soundpool Database (SQL) -->
> 
> <map:pipeline>
>             <map:match pattern="soundpool/database.html">
> 			<map:generate src="soundpool/database.xml"/>
> 			<map:transform type="sql">
> 			<map:parameter name="RICHARD"
> value="soundpool"/>
> 			</map:transform>
> 			<map:transform src="databasepc.xsl"/>
Do one step after the other -- disable the transformer
for testing or use labels.

> 			<map:serialize/>
>             </map:match>
> </map:pipeline>
> 
> 
> 
> I am unsure what should go under name="". I have assumed it's the local
> host name given in mysql?

No, it is the name of the connection as defined in your cocoon.xconf.
My entry looks like this:

  <!-- Datasources: -->
   <datasources>
    <jdbc name="slide" logger="vsc.sql" > 
      <pool-controller min="2" max="6" />
      <auto-commit>true</auto-commit>
      <dburl>jdbc:postgresql://bog.fiz-chemie.de/slidestore</dburl>
      <user>slide</user>
      <password>geheim</password>
    </jdbc>
   </datasources>

So the parameter to the SQL Transformer is:
  <map:transform type="sql">
      <map:parameter name="use-connection" value="slide"/>
  </map:transform>
Remember to restart your servlet engine after changes to cocoon.xconf.

> 
> My web.xml looks like so:
Looks okay.

> 
> My database.xml looks like this:
> 
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <document>
> 	<text>soundpool</text>
> 	<title>the databse</title>
> 	<sql:execute-query xmlns:sql="http://apache.org/cocoon/SQL/2.0">
 	
> <sql:use-connection>localhost/soundpool</sql:use-connection>
You don't need this line.

> 		<sql:query>
> 			SELECT generalMusicTitle FROM album
> 		</sql:query>
> 	</sql:execute-query>
> </document>


--
Martin Holz                FIZ CHEMIE Berlin
<ho...@fiz-chemie.de>  



---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


RE: Cocoon and MySQL

Posted by Richard Cunliffe <ri...@cunliffe.net>.
(logs attached)

Hi,

I have now got cocoon to start, and I have now put my pipeline in, but
the page is coming up blank, when viewed through IE6.

My pipeline in the sitemap looks like this:


<!-- soundpool Database (SQL) -->

<map:pipeline>
            <map:match pattern="soundpool/database.html">
			<map:generate src="soundpool/database.xml"/>
			<map:transform type="sql">
			<map:parameter name="RICHARD"
value="soundpool"/>
			</map:transform>
			<map:transform src="databasepc.xsl"/>
			<map:serialize/>
            </map:match>
</map:pipeline>



I am unsure what should go under name="". I have assumed it's the local
host name given in mysql?




My web.xml looks like so:

<init-param>
			<param-name>load-class</param-name>
			<param-value>
				<!-- For MySQL Driver: -->
			com.mysql.jdbc.Driver
			<!-- For Database Driver:
        		org.hsqldb.jdbcDriver -->
				<!-- For parent ComponentManager sample:
        org.apache.cocoon.samples.parentcm.Configurator
        -->
			</param-value>
		</init-param>




My database.xml looks like this:


<?xml version="1.0" encoding="UTF-8"?>
<document>
	<text>soundpool</text>
	<title>the databse</title>
	<sql:execute-query xmlns:sql="http://apache.org/cocoon/SQL/2.0">
	
<sql:use-connection>localhost/soundpool</sql:use-connection>
		<sql:query>
			SELECT generalMusicTitle FROM album
		</sql:query>
	</sql:execute-query>
</document>





My databasepc.xsl looks like this:


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:sql="http://apache.org/cocoon/SQL/2.0">

<xsl:template match="document">
	<html><body><table>
		<xsl:apply-templates select="sql:rowset/sql:row"/>
	</table></body></html>
</xsl:template>

		<xsl:template match="sql:row">
			<tr>
				<xsl:apply-templates/>
			</tr>
		</xsl:template>
		
		<xsl:template match="sql:generalMusicTitle">
			<td>
				<xsl:value-of select="."/>
			</td>
		</xsl:template>
</xsl:stylesheet>


I have had a look at the logs and I think that cocoon can not find my
database. I know it does exist under the name of soundpool, and have
double checked this looking in the MySQL Admin, and it is listed under
the database tab. The structure looks like this:

	RICHARD (192.168.44.21)
		|- mysql
		|- soundpool
		|- test

Any suggestions,

Thanks,

Richard.



AW: Cocoon and MySQL

Posted by Marco Rolappe <m_...@web.de>.
hi richard,

first point: don't be afraid to look at the logs yourself ;-) most of the
time they'll reveal what's going wrong. for example in the error.log you
attached:

ERROR   (2003-02-02) 22:45.52:747   [core] (Unknown-URI)
Unknown-thread/Cocoon: Could not configure Cocoon environment
org.xml.sax.SAXParseException: The element type "dburl" must be terminated
by the matching end-tag "</dburl>".
	at
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorHand
lerWrapper.java:232)
	at
org.apache.xerces.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.ja
va:213)
	...

looking at the following:

> The following line I was unsure about:

> <dburl>jdbc:mysql://192.168.44.21:3306</dbrul>
                                          ^^^ this one's wrong ;-)

ok, next point:

> I got the localhost address from MySQL Admin - I'm not sure if this is
right? I uncommented these items from the my.ini file.

you can just use 'localhost' (assuming the db is running on the same
machine).

> I am also not sure about <jdbc name = "">.  I have tried researching this
but I'm still unsure.

you can name the datasource as you wish, e.g.:

        <jdbc name="emotion">
            <pool-controller max="10" min="5"/>
            <auto-commit>true</auto-commit>
            <dburl>jdbc:mysql://localhost/soundpool</dbrul> <!-- mysql
database soundpool must exist -->
            <user>r_cunliffe</user> <!-- mysql user r_cunliffe must
exist -->
            <password>????????</password>
        </jdbc>

of course, the data given in this configuration must correspond to your
database configuration. in the dburl you can leave out the port if you're
using the standard.

-----Ursprungliche Nachricht-----
Von: cocoon-users-return-46007-m_rolappe=web.de@xml.apache.org
[mailto:cocoon-users-return-46007-m_rolappe=web.de@xml.apache.org]Im Auftrag
von Richard Cunliffe
Gesendet: Sonntag, 2. Februar 2003 23:52
An: cocoon-users@xml.apache.org
Betreff: Cocoon and MySQL


(I have attached my cocoon and tomcat logs as Zip files)


Hi,

            MS Windows      XP
            Apache              2.0.43
            Tomcat             4.0.6
            Cocoon              2.0.4
            JDK                   1.3.1_06
            MySQL              3.23.55
            JDBC                 2.0.14


I am trying to connect to a MySQL database and have followed the
instructions provided by Flash Guides and Wiki, but cocoon does not start-up
after I edit the cocoon.xconf. If I comment out the inserted code, and
restart tomcat then cocoon will load.

I have download the JDBC file: mysql-connector-java-2.0.14.jar and have put
it in the following directories:


C:\tomcat\webapps\cocoon\WEB-INF\lib\mysql-connector-java-2.0.14-bin.jar
      C:\tomcat\lib\mysql-connector-java-2.0.14-bin.jar



The relevant part of web.xml looks like this:


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

        <!-- For parent ComponentManager sample:
        org.apache.cocoon.samples.parentcm.Configurator
        -->
        </param-value>
            </init-param>





The relevant part of cocoon.xconf looks like so:


  <!-- Datasources: -->
  <datasources>
    <jdbc logger="core.datasources.personnel" name="personnel">
      <!--
          If you have an Oracle database, and are using the the
      pool-controller below, you should add the attribute
      "oradb" and set it to true.

      <pool-controller min="5" max="10" oradb="true"/>

      That way the test to see if the server has disconnected
      the JdbcConnection will function properly.
      -->
      <pool-controller max="10" min="5"/>
      <!--
          If you need to ensure an autocommit is set to true or
      false, then create the "auto-commit" element below.

      <auto-commit>false</auto-commit>

      The default is true.
      -->
      <dburl>jdbc:hsqldb:hsql://localhost:9002</dburl>
      <user>sa</user>
      <password/>

      <jdbc name="personnel">
            <pool-controller min="5" max="10"/>
            <auto-commit>true</auto-commit>
            <dburl>jdbc:mysql://192.168.44.21:3306/soundpool</dbrul>
            <user>r_cunliffe</user>
            <password>????????</password>
      </jdbc>


      </jdbc>
  </datasources>



The following line I was unsure about:

<dburl>jdbc:mysql://192.168.44.21:3306</dbrul>

I got the localhost address from MySQL Admin - I'm not sure if this is
right? I uncommented these items from the my.ini file.

I am also not sure about <jdbc name = "">.  I have tried researching this
but I'm still unsure.



On the Flash Guide it suggested that I should delete the following
directory, which I have done:

C:\tomcat\work\Standalone\localhost\cocoon

But it recreates itself.

What can you suggest? Is there anything on the MySQL side I should be
checking?



Thanks,

Richard.


---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>