You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Leszek Gawron <ou...@wlkp.org> on 2004/05/09 10:57:27 UTC

Hibernate 2.1.3 + cocoon + c3p0 jar hell [repost from dev]

This is a repost from cocoon-dev list. Maybe someone of cocoon users might
help me?

I think there is a serious problem with latest version  of
hibernate (2.1.3) and cocoon integration. There is some kind of jar problem
that did not occur with 2.1.2. I have attached a exception log. The problem
occurs only with hibernate running in cocoon when you want to use c3p0
connection pooling. When you hit the server the exception gets thrown that you
cannot obtain the connection because it has already been closed.

My tests showed that:
1. The problem does not occur with hibernate built-in pooling (but this one is 
unuseable in production environment - at least hibernate web page states that)

2. The problem is not a problem of hibernate itself. I have been able to run
hibernate with c3p0 outside of cocoon and jetty (although all jetty and cocoon
libs were also on the classpath - really strange - maybe jar order on
classpath matters).

3. The problem is not a problem of c3p0 itself. Hibernate 2.1.3 contains a new
version of c3p0 (0.8.4.5) but if you downgrade only hibernate2.jar to 2.1.2
version the problem disapperas.

4. The problem is not database dependent. I have tries both MS SQL Server and
HSQLDB - both do not work with cocoon+hibernate+c3p0.

I use following libraries that are copies to cocoon lib directory:
c3p0-0.8.4.5.jar
cglib-full-2.0.1.jar
commons-dbcp-1.1.jar
commons-pool-1.1.jar
dom4j-1.4.jar
hibernate2.jar
jdbc2_0-stdext.jar
jta.jar
msbase.jar
mssqlserver.jar
msutil.jar
odmg-3.0.jar

The rest needed libraries are already in cocoonlib dir (although versions
differ). Hibernate is using commons collections 2.1 while cocoon uses 3.0 but
this caused no problems with hib2.1.2

My regards
	LG

-- 
            __
         | /  \ |        Leszek Gawron            //  \\
        \_\\  //_/       ouzo@wlkp.org           _\\()//_
         .'/()\'.     Phone: +48(501)720812     / //  \\ \
          \\  //  recursive: adj; see recursive  | \__/ |


Re: Hibernate 2.1.3 + cocoon + c3p0 jar hell [repost from dev]

Posted by Leszek Gawron <lg...@mobilebox.pl>.
Peter,

Peter Velychko wrote:
>>Did you configure dbcp in Tomcat and referred to the pool by JNDI or let 
>>Hibernate manage pool via dbcp (so you set only hibernate.dbcp.* 
>>properties)?
> 
> I configured dbcp in Tomcat.
Out of curiosity: if you have some time could you try to configure 
either dbcp or c3p0 without JNDI usage? I mean just set pool parameters 
in hibernate config and let hibernate handle pool creation. This is how 
I do it.

Thank you for your config.
Another question: I've heard that dbcp and c3p0 have problems with 
performance and memory management. Have you ever had any issues with 
those? I've also read about sites hanging up because of connections 
improperly returned to the pool.

My regards
	LG


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


Re: Hibernate 2.1.3 + cocoon + c3p0 jar hell [repost from dev]

Posted by Peter Velychko <v_...@ukr.net>.
Hello Leszek,

Tuesday, May 11, 2004, 9:48:48 PM, you wrote:

> Peter Velychko wrote:
>> Hello Leszek,
>> 
>> I have in production the following configuration:
>>   tomcat + cocoon 2.1.5-cvs + hibernate 2.1.3 + dbcp.
>> It works without problem.
> Did you configure dbcp in Tomcat and referred to the pool by JNDI or let 
> Hibernate manage pool via dbcp (so you set only hibernate.dbcp.* 
> properties)?
I configured dbcp in Tomcat.

>> Just now I've configured my tomcat to work with c3p0 connection pool
>> and it works corectly also.
> Same question as above. Could you post your configuration files? I tried 
> with tomcat 4.1.27 - same error.
server.xml
<Resource name="jdbc/MyDB" scope="Shareable" type="javax.sql.DataSource" auth="Container"/>
<ResourceParams name="jdbc/MyDB">
        <parameter>
                <name>factory</name>
                <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
        </parameter>
        <!-- DBCP database connection settings -->
        <parameter>
                <name>username</name>
                <value>test</value>
        </parameter>
        <parameter>
                <name>password</name>
                <value>test</value>
        </parameter>
        <parameter>
                <name>driverClassName</name>
                <value>oracle.jdbc.driver.OracleDriver</value>
        </parameter>
        <parameter>
                <name>url</name>                                                        
                <value>jdbc:oracle:thin:@serverurl:1521:db</value>
        </parameter>
        <!-- DBCP connection pooling options -->
        <parameter>
                <name>maxWait</name>
                <value>5000</value>
        </parameter>
        <parameter>
                <name>maxIdle</name>
                <value>2</value>
        </parameter>
        <parameter>
                <name>maxActive</name>
                <value>4</value>
        </parameter>
</ResourceParams>


web.xml
<resource-ref>
        <description>Datasource</description>
        <res-ref-name>jdbc/MyDB</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>  
        <res-auth>Container</res-auth>
</resource-ref>


hibernate.cfg.xml
<hibernate-configuration>
    <session-factory>
        <property name="connection.datasource">java:comp/env/jdbc/MyDB</property>
        <property name="show_sql">false</property>
        <property name="dialect">net.sf.hibernate.dialect.Oracle9Dialect</property>
        <property name="jdbc.use_streams_for_binary">true</property>
        <property name="cache.provider_class">net.sf.ehcache.hibernate.Provider</property>
        <property name="cache.use_query_cache">true</property>
        <property name="jdbc.batch_size">0</property>
        <property name="cache.region_prefix">my</property>
        <property name="jdbc.use_scrollable_resultset">true</property>
        <!-- Mapping files -->
        <mapping resource="mapping.hbm"/>
    </session-factory>
</hibernate-configuration>

>> I'll try to start my application on jetty. What version of jetty are
>> you use?
> 4.2.19.

> I've been trying to use proxool. I was able to run it with proxool 
> configured outside hibernate. With proxool created within hibernate I 
> think there is a bug that occurs when you set hbm2ddl to create.

> Please give more info on your working configuration.

> My regards
>         Leszek Gawron


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

-- 
Best regards,
Peter Velychko                            
v_peter@ukr.net


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


Re: Hibernate 2.1.3 + cocoon + c3p0 jar hell [repost from dev]

Posted by Leszek Gawron <lg...@mobilebox.pl>.
Peter Velychko wrote:
> Hello Leszek,
> 
> I have in production the following configuration:
>   tomcat + cocoon 2.1.5-cvs + hibernate 2.1.3 + dbcp.
> It works without problem.
Did you configure dbcp in Tomcat and referred to the pool by JNDI or let 
Hibernate manage pool via dbcp (so you set only hibernate.dbcp.* 
properties)?

> Just now I've configured my tomcat to work with c3p0 connection pool
> and it works corectly also.
Same question as above. Could you post your configuration files? I tried 
with tomcat 4.1.27 - same error.

> I'll try to start my application on jetty. What version of jetty are
> you use?
4.2.19.

I've been trying to use proxool. I was able to run it with proxool 
configured outside hibernate. With proxool created within hibernate I 
think there is a bug that occurs when you set hbm2ddl to create.

Please give more info on your working configuration.

My regards
	Leszek Gawron


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


Re: Hibernate 2.1.3 + cocoon + c3p0 jar hell [repost from dev]

Posted by Peter Velychko <v_...@ukr.net>.
Some details to my previous posting.
I've just run my app on tomcat 4.1.30.
But with one condition: it runs in root context

> Hello Hugo,

> Tuesday, May 11, 2004, 9:15:35 PM, you wrote:
>> Hello Peter,

>> Can you be a little bit more specific about your Tomcat configuration?
> Of course

>> - Java version?
> 1.4.2-b28 on WinXP


>> - Tomcat version?
> 4.1.18

>> - What is in the Tomcat endorsed lib?
>     xalan-2.6.0.jar
>     xercesImpl-2.6.2.jar
>     xml-apis.jar
> Also I've placed c3p0-0.8.4.5.jar in {$tomcat.dir}/common/lib
    
>> - How did you handle the jars that are both in Hibernate and in Cocoon but
>> have different versions (commons-..., etc.)?
> I have the following libs in classpath:
>     commons-collections-3.0.jar
>     commons-lang-2.0.jar
> I've commented
    
>> - Do you use a recent version of cocoon 2.1.5-cvs?
> Yes, I have cvs version of today's morning.

>> - Is it a Hibernate *release* version 2.1.3?
> Yes, I use hibernate 2.1.3.
> RDBMS - Oracle 9.2

>> Sorry for asking so many questions, but I guess most of them are easy to
>> answer.
> I've set up c3p0 pool only on my computer and it works well (see my
> configuration details below). Please note that I use dbcp on
> production and cannot test c3p0 pooling on Linux

> "server.xml"
> <Resource name="jdbc/MyDB" scope="Shareable" auth="Container"
>                  type="com.mchange.v2.c3p0.ComboPooledDataSource"/>
> <ResourceParams name="jdbc/PHotels2DB">
>         <parameter>
>                 <name>factory</name>
>                 <value>org.apache.naming.factory.BeanFactory</value>
>         </parameter>
>         <parameter>
>                 <name>user</name>
>                 <value>test</value>
>         </parameter>
>         <parameter>
>                 <name>password</name>
>                 <value>test</value>
>         </parameter>
>         <parameter>
>                 <name>driverClass</name>
>                 <value>oracle.jdbc.driver.OracleDriver</value>
>         </parameter>
>         <parameter>
>                 <name>jdbcUrl</name>                                                    
>                 <value>jdbc:oracle:thin:@serverurl:1521:db</value>
>         </parameter>
>         <parameter>
>                 <name>minPoolSize</name>
>                 <value>5</value>
>         </parameter>
>         <parameter>
>                 <name>maxPoolSize</name>
>                 <value>15</value>
>         </parameter>
>         <parameter>
>                 <name>acquireIncrement</name>
>                 <value>5</value>
>         </parameter>
> </ResourceParams>

> "hibernate.cfg.xml"
> <hibernate-configuration>
>     <session-factory>
>         <property name="connection.datasource">java:comp/env/jdbc/MyDB</property>
>         <property name="show_sql">false</property>
>         <property name="dialect">net.sf.hibernate.dialect.Oracle9Dialect</property>
>         <property name="jdbc.use_streams_for_binary">true</property>
>         <property name="cache.provider_class">net.sf.ehcache.hibernate.Provider</property>
>         <property name="cache.use_query_cache">true</property>
>         <property name="jdbc.batch_size">0</property>
>         <property name="cache.region_prefix">my</property>
>         <property name="jdbc.use_scrollable_resultset">true</property>
>         <property name="c3p0.minPoolSize">5</property>
>         <property name="c3p0.maxPoolSize">20</property>
>         <property name="c3p0.timeout">1800</property>
>         <property name="c3p0.max_statement">50</property>
>         <mapping resource="mapping.hbm"/>
>     </session-factory>
> </hibernate-configuration>

> "web.xml"
> <resource-ref>
>     <description>Datasource</description>
>     <res-ref-name>jdbc/MyDB</res-ref-name>
>     <res-type>javax.sql.DataSource</res-type>
>     <res-auth>Container</res-auth>
> </resource-ref>

>> Thanks,

>> Hugo Burm

>>> -----Original Message-----
>>> From: Peter Velychko [mailto:v_peter@ukr.net]
>>> Sent: Tuesday, May 11, 2004 10:39 AM
>>> To: Leszek Gawron
>>> Subject: Re: Hibernate 2.1.3 + cocoon + c3p0 jar hell [repost
>>> from dev]
>>>
>>>
>>> Hello Leszek,
>>>
>>> I have in production the following configuration:
>>>   tomcat + cocoon 2.1.5-cvs + hibernate 2.1.3 + dbcp.
>>> It works without problem.
>>>
>>> Just now I've configured my tomcat to work with c3p0 connection pool
>>> and it works corectly also.
>>>
>>> I'll try to start my application on jetty. What version of jetty are
>>> you use?
>>>
>>> Sunday, May 9, 2004, 11:57:27 AM, you wrote:
>>>
>>> > This is a repost from cocoon-dev list. Maybe someone of
>>> cocoon users might
>>> > help me?
>>>
>>> > I think there is a serious problem with latest version  of
>>> > hibernate (2.1.3) and cocoon integration. There is some
>>> kind of jar problem
>>> > that did not occur with 2.1.2. I have attached a exception
>>> log. The problem
>>> > occurs only with hibernate running in cocoon when you want
>>> to use c3p0
>>> > connection pooling. When you hit the server the exception
>>> gets thrown that you
>>> > cannot obtain the connection because it has already been closed.
>>>
>>> > My tests showed that:
>>> > 1. The problem does not occur with hibernate built-in
>>> pooling (but this one is
>>> > unuseable in production environment - at least hibernate
>>> web page states that)
>>>
>>> > 2. The problem is not a problem of hibernate itself. I have
>>> been able to run
>>> > hibernate with c3p0 outside of cocoon and jetty (although
>>> all jetty and cocoon
>>> > libs were also on the classpath - really strange - maybe
>>> jar order on
>>> > classpath matters).
>>>
>>> > 3. The problem is not a problem of c3p0 itself. Hibernate
>>> 2.1.3 contains a new
>>> > version of c3p0 (0.8.4.5) but if you downgrade only
>>> hibernate2.jar to 2.1.2
>>> > version the problem disapperas.
>>>
>>> > 4. The problem is not database dependent. I have tries both
>>> MS SQL Server and
>>> > HSQLDB - both do not work with cocoon+hibernate+c3p0.
>>>
>>> > I use following libraries that are copies to cocoon lib directory:
>>> > c3p0-0.8.4.5.jar
>>> > cglib-full-2.0.1.jar
>>> > commons-dbcp-1.1.jar
>>> > commons-pool-1.1.jar
>>> > dom4j-1.4.jar
>>> > hibernate2.jar
>>> > jdbc2_0-stdext.jar
>>> > jta.jar
>>> > msbase.jar
>>> > mssqlserver.jar
>>> > msutil.jar
>>> > odmg-3.0.jar
>>>
>>> > The rest needed libraries are already in cocoonlib dir
>>> (although versions
>>> > differ). Hibernate is using commons collections 2.1 while
>>> cocoon uses 3.0 but
>>> > this caused no problems with hib2.1.2
>>>
>>> > My regards
>>> >         LG
>>>
>>>
>>> --
>>> Best regards,
>>> Peter Velychko
>>> v_peter@ukr.net
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>> For additional commands, e-mail: users-help@cocoon.apache.org
>>>
>>>


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


-- 
Best regards,
Peter Velychko                            
v_peter@ukr.net


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


Re: Hibernate 2.1.3 + cocoon + c3p0 jar hell [repost from dev]

Posted by Peter Velychko <v_...@ukr.net>.
Hello Hugo,

Tuesday, May 11, 2004, 9:15:35 PM, you wrote:
> Hello Peter,

> Can you be a little bit more specific about your Tomcat configuration?
Of course

> - Java version?
1.4.2-b28 on WinXP


> - Tomcat version?
4.1.18

> - What is in the Tomcat endorsed lib?
    xalan-2.6.0.jar
    xercesImpl-2.6.2.jar
    xml-apis.jar
Also I've placed c3p0-0.8.4.5.jar in {$tomcat.dir}/common/lib
    
> - How did you handle the jars that are both in Hibernate and in Cocoon but
> have different versions (commons-..., etc.)?
I have the following libs in classpath:
    commons-collections-3.0.jar
    commons-lang-2.0.jar
I've commented
    
> - Do you use a recent version of cocoon 2.1.5-cvs?
Yes, I have cvs version of today's morning.

> - Is it a Hibernate *release* version 2.1.3?
Yes, I use hibernate 2.1.3.
RDBMS - Oracle 9.2

> Sorry for asking so many questions, but I guess most of them are easy to
> answer.
I've set up c3p0 pool only on my computer and it works well (see my
configuration details below). Please note that I use dbcp on
production and cannot test c3p0 pooling on Linux

"server.xml"
<Resource name="jdbc/MyDB" scope="Shareable" auth="Container"
                 type="com.mchange.v2.c3p0.ComboPooledDataSource"/>
<ResourceParams name="jdbc/PHotels2DB">
        <parameter>
                <name>factory</name>
                <value>org.apache.naming.factory.BeanFactory</value>
        </parameter>
        <parameter>
                <name>user</name>
                <value>test</value>
        </parameter>
        <parameter>
                <name>password</name>
                <value>test</value>
        </parameter>
        <parameter>
                <name>driverClass</name>
                <value>oracle.jdbc.driver.OracleDriver</value>
        </parameter>
        <parameter>
                <name>jdbcUrl</name>                                                    
                <value>jdbc:oracle:thin:@serverurl:1521:db</value>
        </parameter>
        <parameter>
                <name>minPoolSize</name>
                <value>5</value>
        </parameter>
        <parameter>
                <name>maxPoolSize</name>
                <value>15</value>
        </parameter>
        <parameter>
                <name>acquireIncrement</name>
                <value>5</value>
        </parameter>
</ResourceParams>

"hibernate.cfg.xml"
<hibernate-configuration>
    <session-factory>
        <property name="connection.datasource">java:comp/env/jdbc/MyDB</property>
        <property name="show_sql">false</property>
        <property name="dialect">net.sf.hibernate.dialect.Oracle9Dialect</property>
        <property name="jdbc.use_streams_for_binary">true</property>
        <property name="cache.provider_class">net.sf.ehcache.hibernate.Provider</property>
        <property name="cache.use_query_cache">true</property>
        <property name="jdbc.batch_size">0</property>
        <property name="cache.region_prefix">my</property>
        <property name="jdbc.use_scrollable_resultset">true</property>
        <property name="c3p0.minPoolSize">5</property>
        <property name="c3p0.maxPoolSize">20</property>
        <property name="c3p0.timeout">1800</property>
        <property name="c3p0.max_statement">50</property>
        <mapping resource="mapping.hbm"/>
    </session-factory>
</hibernate-configuration>

"web.xml"
<resource-ref>
    <description>Datasource</description>
    <res-ref-name>jdbc/MyDB</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
</resource-ref>

> Thanks,

> Hugo Burm

>> -----Original Message-----
>> From: Peter Velychko [mailto:v_peter@ukr.net]
>> Sent: Tuesday, May 11, 2004 10:39 AM
>> To: Leszek Gawron
>> Subject: Re: Hibernate 2.1.3 + cocoon + c3p0 jar hell [repost
>> from dev]
>>
>>
>> Hello Leszek,
>>
>> I have in production the following configuration:
>>   tomcat + cocoon 2.1.5-cvs + hibernate 2.1.3 + dbcp.
>> It works without problem.
>>
>> Just now I've configured my tomcat to work with c3p0 connection pool
>> and it works corectly also.
>>
>> I'll try to start my application on jetty. What version of jetty are
>> you use?
>>
>> Sunday, May 9, 2004, 11:57:27 AM, you wrote:
>>
>> > This is a repost from cocoon-dev list. Maybe someone of
>> cocoon users might
>> > help me?
>>
>> > I think there is a serious problem with latest version  of
>> > hibernate (2.1.3) and cocoon integration. There is some
>> kind of jar problem
>> > that did not occur with 2.1.2. I have attached a exception
>> log. The problem
>> > occurs only with hibernate running in cocoon when you want
>> to use c3p0
>> > connection pooling. When you hit the server the exception
>> gets thrown that you
>> > cannot obtain the connection because it has already been closed.
>>
>> > My tests showed that:
>> > 1. The problem does not occur with hibernate built-in
>> pooling (but this one is
>> > unuseable in production environment - at least hibernate
>> web page states that)
>>
>> > 2. The problem is not a problem of hibernate itself. I have
>> been able to run
>> > hibernate with c3p0 outside of cocoon and jetty (although
>> all jetty and cocoon
>> > libs were also on the classpath - really strange - maybe
>> jar order on
>> > classpath matters).
>>
>> > 3. The problem is not a problem of c3p0 itself. Hibernate
>> 2.1.3 contains a new
>> > version of c3p0 (0.8.4.5) but if you downgrade only
>> hibernate2.jar to 2.1.2
>> > version the problem disapperas.
>>
>> > 4. The problem is not database dependent. I have tries both
>> MS SQL Server and
>> > HSQLDB - both do not work with cocoon+hibernate+c3p0.
>>
>> > I use following libraries that are copies to cocoon lib directory:
>> > c3p0-0.8.4.5.jar
>> > cglib-full-2.0.1.jar
>> > commons-dbcp-1.1.jar
>> > commons-pool-1.1.jar
>> > dom4j-1.4.jar
>> > hibernate2.jar
>> > jdbc2_0-stdext.jar
>> > jta.jar
>> > msbase.jar
>> > mssqlserver.jar
>> > msutil.jar
>> > odmg-3.0.jar
>>
>> > The rest needed libraries are already in cocoonlib dir
>> (although versions
>> > differ). Hibernate is using commons collections 2.1 while
>> cocoon uses 3.0 but
>> > this caused no problems with hib2.1.2
>>
>> > My regards
>> >         LG
>>
>>
>> --
>> Best regards,
>> Peter Velychko
>> v_peter@ukr.net
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>


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


-- 
Best regards,
Peter Velychko                            
v_peter@ukr.net


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


RE: Hibernate 2.1.3 + cocoon + c3p0 jar hell [repost from dev]

Posted by Hugo Burm <hu...@xs4all.nl>.
Hello Peter,

Can you be a little bit more specific about your Tomcat configuration?

- Java version?
- Tomcat version?
- What is in the Tomcat endorsed lib?
- How did you handle the jars that are both in Hibernate and in Cocoon but
have different versions (commons-..., etc.)?
- Do you use a recent version of cocoon 2.1.5-cvs?
- Is it a Hibernate *release* version 2.1.3?

Sorry for asking so many questions, but I guess most of them are easy to
answer.

Thanks,

Hugo Burm

> -----Original Message-----
> From: Peter Velychko [mailto:v_peter@ukr.net]
> Sent: Tuesday, May 11, 2004 10:39 AM
> To: Leszek Gawron
> Subject: Re: Hibernate 2.1.3 + cocoon + c3p0 jar hell [repost
> from dev]
>
>
> Hello Leszek,
>
> I have in production the following configuration:
>   tomcat + cocoon 2.1.5-cvs + hibernate 2.1.3 + dbcp.
> It works without problem.
>
> Just now I've configured my tomcat to work with c3p0 connection pool
> and it works corectly also.
>
> I'll try to start my application on jetty. What version of jetty are
> you use?
>
> Sunday, May 9, 2004, 11:57:27 AM, you wrote:
>
> > This is a repost from cocoon-dev list. Maybe someone of
> cocoon users might
> > help me?
>
> > I think there is a serious problem with latest version  of
> > hibernate (2.1.3) and cocoon integration. There is some
> kind of jar problem
> > that did not occur with 2.1.2. I have attached a exception
> log. The problem
> > occurs only with hibernate running in cocoon when you want
> to use c3p0
> > connection pooling. When you hit the server the exception
> gets thrown that you
> > cannot obtain the connection because it has already been closed.
>
> > My tests showed that:
> > 1. The problem does not occur with hibernate built-in
> pooling (but this one is
> > unuseable in production environment - at least hibernate
> web page states that)
>
> > 2. The problem is not a problem of hibernate itself. I have
> been able to run
> > hibernate with c3p0 outside of cocoon and jetty (although
> all jetty and cocoon
> > libs were also on the classpath - really strange - maybe
> jar order on
> > classpath matters).
>
> > 3. The problem is not a problem of c3p0 itself. Hibernate
> 2.1.3 contains a new
> > version of c3p0 (0.8.4.5) but if you downgrade only
> hibernate2.jar to 2.1.2
> > version the problem disapperas.
>
> > 4. The problem is not database dependent. I have tries both
> MS SQL Server and
> > HSQLDB - both do not work with cocoon+hibernate+c3p0.
>
> > I use following libraries that are copies to cocoon lib directory:
> > c3p0-0.8.4.5.jar
> > cglib-full-2.0.1.jar
> > commons-dbcp-1.1.jar
> > commons-pool-1.1.jar
> > dom4j-1.4.jar
> > hibernate2.jar
> > jdbc2_0-stdext.jar
> > jta.jar
> > msbase.jar
> > mssqlserver.jar
> > msutil.jar
> > odmg-3.0.jar
>
> > The rest needed libraries are already in cocoonlib dir
> (although versions
> > differ). Hibernate is using commons collections 2.1 while
> cocoon uses 3.0 but
> > this caused no problems with hib2.1.2
>
> > My regards
> >         LG
>
>
> --
> Best regards,
> Peter Velychko
> v_peter@ukr.net
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>


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


Re: Hibernate 2.1.3 + cocoon + c3p0 jar hell [repost from dev]

Posted by Peter Velychko <v_...@ukr.net>.
Hello Leszek,

I have in production the following configuration:
  tomcat + cocoon 2.1.5-cvs + hibernate 2.1.3 + dbcp.
It works without problem.

Just now I've configured my tomcat to work with c3p0 connection pool
and it works corectly also.

I'll try to start my application on jetty. What version of jetty are
you use?

Sunday, May 9, 2004, 11:57:27 AM, you wrote:

> This is a repost from cocoon-dev list. Maybe someone of cocoon users might
> help me?

> I think there is a serious problem with latest version  of
> hibernate (2.1.3) and cocoon integration. There is some kind of jar problem
> that did not occur with 2.1.2. I have attached a exception log. The problem
> occurs only with hibernate running in cocoon when you want to use c3p0
> connection pooling. When you hit the server the exception gets thrown that you
> cannot obtain the connection because it has already been closed.

> My tests showed that:
> 1. The problem does not occur with hibernate built-in pooling (but this one is 
> unuseable in production environment - at least hibernate web page states that)

> 2. The problem is not a problem of hibernate itself. I have been able to run
> hibernate with c3p0 outside of cocoon and jetty (although all jetty and cocoon
> libs were also on the classpath - really strange - maybe jar order on
> classpath matters).

> 3. The problem is not a problem of c3p0 itself. Hibernate 2.1.3 contains a new
> version of c3p0 (0.8.4.5) but if you downgrade only hibernate2.jar to 2.1.2
> version the problem disapperas.

> 4. The problem is not database dependent. I have tries both MS SQL Server and
> HSQLDB - both do not work with cocoon+hibernate+c3p0.

> I use following libraries that are copies to cocoon lib directory:
> c3p0-0.8.4.5.jar
> cglib-full-2.0.1.jar
> commons-dbcp-1.1.jar
> commons-pool-1.1.jar
> dom4j-1.4.jar
> hibernate2.jar
> jdbc2_0-stdext.jar
> jta.jar
> msbase.jar
> mssqlserver.jar
> msutil.jar
> odmg-3.0.jar

> The rest needed libraries are already in cocoonlib dir (although versions
> differ). Hibernate is using commons collections 2.1 while cocoon uses 3.0 but
> this caused no problems with hib2.1.2

> My regards
>         LG


-- 
Best regards,
Peter Velychko                            
v_peter@ukr.net


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