You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Lidonis Calhau <lc...@openbluelab.org> on 2007/03/28 11:18:30 UTC

cocoon 2.2 and hibernate 3

I would like to use cocoon 2.2 and hibernate 3 with mysql 5.0
I don't know how to use hibernate with cocoon datasource.
I try to configure cocoon datasource in cocoon.my.xconf like this :

<?xml version="1.0"?>
<cocoon version="2.2">
<components>
  <datasources>
    <jdbc logger="core.datasources.test" name="test">
      <pool-controller min="5" max="10" />
      <auto-commit>false</auto-commit>
      <dburl>jdbc:mysql:///test</dburl>
      <user>test</user>
      <password>test</password>
    </jdbc>
  </datasources>
</components>
</cocoon>

I get the following error :

org.springframework.beans.factory.BeanDefinitionStoreException: Unable 
to read Avalon configuration from '/WEB-INF/cocoon.my.xconf'.; nested 
exception is 
org.apache.avalon.framework.configuration.ConfigurationException: 
Unknown component type 'components' at 
file:/home/lidonis/workspace/comp/company_webapp/target/company_webapp-1.0-SNAPSHOT/WEB-INF/cocoon.my.xconf:3:13
Caused by: 
org.apache.avalon.framework.configuration.ConfigurationException: 
Unknown component type 'components' at 
file:/home/lidonis/workspace/comp/company_webapp/target/company_webapp-1.0-SNAPSHOT/WEB-INF/cocoon.my.xconf:3:13 


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


Re: cocoon 2.2 and hibernate 3

Posted by Olivier Billard <ol...@laposte.net>.
Joerg Heinicke wrote:
> On 19.09.2007 8:58 Uhr, Olivier Billard wrote:
> 
>> IMHO, the only use you could have with defining a data source for 
>> Cocoon, is to use it directly, bypassing Hibernate.
> 
> Hey, where have you found this old thread? :)
> (It was still unread for me as well.)

Reflex :)
I only saw the date after posting... damned Thunderbird thread sorting...
But at least this could help others O_o !...


> Accessing the data source directly in your own springified code does 
> work also without any problems. The question is only about usage of a 
> data source declared in Spring but used in Avalon components. Even this 
> should work after Grek has therefore added/fixed the 
> SpringToAvalonDataSourceBridge/Wrapper [1, 2].

Yep, I read something like this in the dev list, thanks for this info Joerg !


> Joerg
> 
> [1] https://issues.apache.org/jira/browse/COCOON-2083
> [2] https://issues.apache.org/jira/browse/COCOON-2106

--
Olivier Billard


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


Re: cocoon 2.2 and hibernate 3

Posted by Joerg Heinicke <jo...@gmx.de>.
On 19.09.2007 8:58 Uhr, Olivier Billard wrote:

> IMHO, the only use you could have with defining a data source for 
> Cocoon, is to use it directly, bypassing Hibernate.

Hey, where have you found this old thread? :)
(It was still unread for me as well.)

Accessing the data source directly in your own springified code does 
work also without any problems. The question is only about usage of a 
data source declared in Spring but used in Avalon components. Even this 
should work after Grek has therefore added/fixed the 
SpringToAvalonDataSourceBridge/Wrapper [1, 2].

Joerg

[1] https://issues.apache.org/jira/browse/COCOON-2083
[2] https://issues.apache.org/jira/browse/COCOON-2106

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


Re: cocoon 2.2 and hibernate 3

Posted by Olivier Billard <ol...@laposte.net>.
Hi Lidonis,

If you choose to use Hibernate as your ORM, and use Cocoon 2.2 that is based on Spring, I recommend using a standard Spring definition for your data 
source and inject it to Hibernate (no link to Cocoon, you can easily find samples on the net).
IMHO, the only use you could have with defining a data source for Cocoon, is to use it directly, bypassing Hibernate. But this is very, very bad, as 
you could have problems with Hibernate cache, and also of course loose the power and decoupling of the ORM.
I successfully use this configuration for my project (Hibernate, DAOs, Spring and Cocoon 2.2).

HTH,
-
Olivier Billard



Lidonis Calhau wrote:
> I would like to use cocoon 2.2 and hibernate 3 with mysql 5.0
> I don't know how to use hibernate with cocoon datasource.
> I try to configure cocoon datasource in cocoon.my.xconf like this :
> 
> <?xml version="1.0"?>
> <cocoon version="2.2">
> <components>
>  <datasources>
>    <jdbc logger="core.datasources.test" name="test">
>      <pool-controller min="5" max="10" />
>      <auto-commit>false</auto-commit>
>      <dburl>jdbc:mysql:///test</dburl>
>      <user>test</user>
>      <password>test</password>
>    </jdbc>
>  </datasources>
> </components>
> </cocoon>
> 
> I get the following error :
> 
> org.springframework.beans.factory.BeanDefinitionStoreException: Unable 
> to read Avalon configuration from '/WEB-INF/cocoon.my.xconf'.; nested 
> exception is 
> org.apache.avalon.framework.configuration.ConfigurationException: 
> Unknown component type 'components' at 
> file:/home/lidonis/workspace/comp/company_webapp/target/company_webapp-1.0-SNAPSHOT/WEB-INF/cocoon.my.xconf:3:13 
> 
> Caused by: 
> org.apache.avalon.framework.configuration.ConfigurationException: 
> Unknown component type 'components' at 
> file:/home/lidonis/workspace/comp/company_webapp/target/company_webapp-1.0-SNAPSHOT/WEB-INF/cocoon.my.xconf:3:13 
> 


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