cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Staffan Kvisth" <staffan.kvi...@chello.se>
Subject Newbie question about Cocoon DatabaseReader
Date Tue, 16 Dec 2003 14:05:30 GMT
I have a set of images stored as blobs in a database that I want to retrieve
using a Cocoon DatabaseReader.

I have defined the reader in the sitemap as follows:

 

  <map:readers default="resource">

    <map:reader name="databasereader"
src="org.apache.cocoon.reading.DatabaseReader"
logger="sitemap.reader.databasereader" pool-max="32" pool-min="1"
pool-grow="4">

      <map:parameter name="use-connection" value="mydatabase"/>

    </map:reader>

  </map:readers>

 

I have defined a datasource in the cocoon.xconf that looks like:

 

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

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

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

          <dburl>jdbc:mysql://localhost/mydatabase</dburl>

          <user>root</user>

          <password/>

    </jdbc>)

 

Then I want to read the images using the following pipeline:

 

<map:pipeline>

    <map:match pattern="images/*.gif">

      <map:read type="databasereader" src="{1}" mime-type="image/gif">

        <map:parameter name="table" value="images"/>

        <map:parameter name="image" value="image"/>

        <map:parameter name="key" value="id"/>

      </map:read>

    </map:match>

 

    ...

</map:pipeline>

 

However, if I call the pipeline with the URL
http://localhost:8888/mytestweb/images/image1.gif”, I get the following
error message:

 

org.apache.cocoon.ProcessingException: Lookup of reader for role
'databasereader' failed.:
org.apache.avalon.framework.component.ComponentException: readers:
ComponentSelector could not find the component for hint [databasereader]
(key [databasereader])

 

Can someone hint me about what I’m doing wrong?

I don’t think there is a problem with my database connection because I can
access the same data in the database from various XSP’s that I’ve also
written (using esql statements), although the image data blobs then come out
as garbage strings of course. 

 

--

Staffan Kvisth

Tranebergsvägen 41

16745 Bromma

+46-8-264999, +46-70-3439409

staffan.kvisth@chello.se

 


Mime
View raw message