You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Grzegorz Kossakowski (JIRA)" <ji...@apache.org> on 2007/08/06 13:48:00 UTC

[jira] Issue Comment Edited: (COCOON-2106) DatabaseReader and SQLTransformer cannot obtain datasource

    [ https://issues.apache.org/jira/browse/COCOON-2106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12517896 ] 

grek edited comment on COCOON-2106 at 8/6/07 4:47 AM:
----------------------------------------------------------------------

If one wants to use datasources defined as Spring beans she should take advantage of functionality (SpringToAvalonDataSourceBridge) implemented in COCOON-2083.

Since we need[1] to support shorter notion for component selection bean's declaration should look like this:

    <bean name="org.apache.avalon.excalibur.datasource.DataSourceComponent/personnel"
          class="org.springframework.jdbc.datasource.DriverManagerDataSource">
      (...)
    </bean>

Then, the datasource should be referenced with "personnel" name.

Kazo, could you try to define your data source like this and confirm if it works *without* applying your patches?

[1] http://article.gmane.org/gmane.text.xml.cocoon.devel/74438

      was (Author: grek):
    If one wants to use datasources defined as Spring beans she should take advantage of functionality (SpringToAvalonDataSourceBridge) implemented in COCOON-2083.

Since we need[1] to support shorter notion for component selection bean's declaration should look like this:

    <bean name="org.apache.avalon.excalibur.datasource.DataSourceComponent/personnel"
          class="org.springframework.jdbc.datasource.DriverManagerDataSource">
      (...)
    </bean>

Then, the datasource should be referenced with "personnel" name.

Kazo, could you try to define your data source like this and confirm if it works *without* applying your patches?
  
> DatabaseReader and SQLTransformer cannot obtain datasource
> ----------------------------------------------------------
>
>                 Key: COCOON-2106
>                 URL: https://issues.apache.org/jira/browse/COCOON-2106
>             Project: Cocoon
>          Issue Type: Bug
>          Components: Blocks: Databases
>    Affects Versions: 2.2-dev (Current SVN)
>            Reporter: Kazó Csaba
>            Assignee: Grzegorz Kossakowski
>         Attachments: dbreader.diff, sqltrans.diff
>
>
> The DatabaseReader and SQLTransformer components fail to obtain the configured data source and throw a ServiceException like "Component with 'org.apache.avalon.excalibur.datasource.DataSourceComponent/personnel' is not defined in this service manager. (Key='AvalonServiceManager')". The failing function call in both cases is:
> this.manager.lookup(DataSourceComponent.ROLE + '/' + datasourceName)
> The result is the same regardless of whether the data source is defined as an Avalon component or a Spring bean.
> Changing the code to use ServiceSelector as in the "Creating a Reader" document [1] and the modular database actions solves the problem for both cases. The attached patch applies this modification to DatabaseReader.java.
> [1] http://cocoon.zones.apache.org/daisy/cdocs/g1/g1/g2/g1/g2/681.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.