cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olivier Billard <olivier.billard.coc...@laposte.net>
Subject Re: cocoon 2.2 and hibernate 3
Date Wed, 19 Sep 2007 12:58:30 GMT
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


Mime
View raw message