cancel
Showing results for 
Search instead for 
Did you mean: 

Spring data jpa + activiti error!!

kinorsi
Champ in-the-making
Champ in-the-making
My project is using Spring Data Jpa + Activiti + Hibernate。
But the app can't start. The database connection will always closed!
Does anyone have a demo using Spring data jpa with activiti?
17 REPLIES 17

trademak
Star Contributor
Star Contributor
Yes in the activiti-rest module we have a JPA test that is implement with exactly this setup.

Best regards,

kinorsi
Champ in-the-making
Champ in-the-making
Thank you very much!
But I Use the same configure to run my project, the following exception occurs. Can you give me some advice? This really brothers me too long..

<java>
2013-9-24 20:46:01 org.apache.catalina.core.StandardContext listenerStart
Serious: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'assetService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.activiti.engine.RuntimeService net.qyrcbank.assetmanager.service.AssetService.runtimeService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine': FactoryBean threw exception on object creation; nested exception is org.springframework.orm.hibernate3.HibernateSystemException: commit failed; nested exception is org.hibernate.TransactionException: commit failed
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:288)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1122)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:522)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:626)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4723)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.activiti.engine.RuntimeService net.qyrcbank.assetmanager.service.AssetService.runtimeService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine': FactoryBean threw exception on object creation; nested exception is org.springframework.orm.hibernate3.HibernateSystemException: commit failed; nested exception is org.hibernate.TransactionException: commit failed
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:514)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:285)
… 21 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine': FactoryBean threw exception on object creation; nested exception is org.springframework.orm.hibernate3.HibernateSystemException: commit failed; nested exception is org.hibernate.TransactionException: commit failed
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:149)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:102)
at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1448)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:353)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1031)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:927)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:490)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:910)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:853)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:768)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:486)
… 23 more
Caused by: org.springframework.orm.hibernate3.HibernateSystemException: commit failed; nested exception is org.hibernate.TransactionException: commit failed
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:690)
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:105)
at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:517)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:755)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:724)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:148)
at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
at org.activiti.engine.impl.ProcessEngineImpl.<init>(ProcessEngineImpl.java:76)
at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:365)
at org.activiti.spring.SpringProcessEngineConfiguration.buildProcessEngine(SpringProcessEngineConfiguration.java:64)
at org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:56)
at org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:32)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
… 40 more
Caused by: org.hibernate.TransactionException: commit failed
at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:185)
at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:75)
at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:513)
… 51 more
Caused by: org.hibernate.TransactionException: unable to commit against JDBC connection
at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.doCommit(JdbcTransaction.java:116)
at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:178)
… 53 more
Caused by: org.h2.jdbc.JdbcSQLException: The object is already closed [90007-173]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:331)
at org.h2.message.DbException.get(DbException.java:171)
at org.h2.message.DbException.get(DbException.java:148)
at org.h2.message.DbException.get(DbException.java:137)
at org.h2.jdbc.JdbcConnection.checkClosed(JdbcConnection.java:1410)
at org.h2.jdbc.JdbcConnection.checkClosedForWrite(JdbcConnection.java:1398)
at org.h2.jdbc.JdbcConnection.commit(JdbcConnection.java:446)
at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.doCommit(JdbcTransaction.java:112)
… 54 more
</java>

trademak
Star Contributor
Star Contributor
With only a stacktrace it's really hard to say something.
Can you create a unit test showing your problem?

Best regards,

kinorsi
Champ in-the-making
Champ in-the-making
Hi,
The stacktrace comes when starting the project.
So I even cant' start my project. This is the problem.
Attachment is my source code in zip format. Would you mind running it and see the problem?
The main config file is : src/main/resources/applicationContext-act.xml. In this file I prepare two kinds of transactionManager. One is JpaTransactionManager, the other is DataSourceTransactionManager. Please see the comments on them.
Looking forward to your answer. Thanks a lot!

kinorsi
Champ in-the-making
Champ in-the-making
I have found out the problem. Hibernate version causes this! In you activiti-rest module is 4.1.9.Final. If you try the version higher then the 4.2.2.Final. The problem should occur. Currently, anyone who want to use hibernate as jpa vendor, better use 4.1.9.Final version.

frederikherema1
Star Contributor
Star Contributor
Thanks for sharing the cause of this issue

edoardo
Champ in-the-making
Champ in-the-making
Hi ,
i'm facing the same issue using Spring + JPA with the 4.4.2 Hibernate version . Unfortunately i can't use the 4.1.9.Final
Is this an activiti-related problem or i must wait for Hibernate to fix the bug ?

If someone find a workaround would be much appreciated.

thanks.

trademak
Star Contributor
Star Contributor
We'll look into this and respond when we have more background info for this.

edoardo
Champ in-the-making
Champ in-the-making
Thank you .

In case you need, i'm posting  my configuration and the stack-trace .

Hibernate 2.2.3 Final
Spring 3.2.2. RELEASE
Activiti 5.13
springDataJpa 1.4.1.RELEASE.

My entityManager configuration from root-context.xml :
<code>
   <context:annotation-config />
  
   <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
      <property name="jndiName" value="java:/comp/env/jdbc/DefaultDB" />
   </bean>

   <bean id="multiTenantIdentifierResolver" class="it.sydema.laweb.utils.MultiTenantIdentifierResolver">
      <property name="defaultTenant" value="default" />
      <property name="tenants">
         <map>
            <entry key="default" value="DefaultDB" />
            <entry key="alternative" value="AlternativeDB" />
         </map>
      </property>
   </bean>
  
   <bean id="entityManagerFactory"
      class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
      <property name="jpaVendorAdapter">
         <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" />
      </property>
      <property name="jpaPropertyMap">
         <map>
            <entry key="hibernate.show_sql" value="true" />
            <entry key="hibernate.use_sql_comments" value="true" />
            <entry key="hibernate.format_sql" value="true" />
            <entry key="hibernate.dialect" value="it.sydema.laweb.utils.SQLServerDialectEx" />
            <entry key="hibernate.connection.datasource" value="java:/comp/env/jdbc/DefaultDB" />
            <entry key="hibernate.multiTenancy" value="DATABASE" />
            <entry key="hibernate.tenant_identifier_resolver">
               <ref bean="multiTenantIdentifierResolver" />
            </entry>
            <entry key="org.hibernate.envers.store_data_at_delete" value="true" />
            <entry key="hibernate.cache.region.factory_class"
               value="org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory" />
            <entry key="hibernate.cache.use_second_level_cache" value="true" />
            <entry key="hibernate.cache.use_query_cache" value="true" />
            <entry key="net.sf.ehcache.configurationResourceName" value="/ehcache.xml" />
      </map>
      </property>
      <property name="dataSource" ref="dataSource" />
   </bean>

   <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
   </bean>

   <tx:annotation-driven transaction-manager="transactionManager" />
</code>

Activiti configuration from activiti-context.xml


<code>
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
  
   <property name="databaseType" value="mssql" /> 
     <property name="dataSource" ref="dataSource" />
     <property name="transactionManager" ref="transactionManager" />
    
     <property name="databaseSchemaUpdate" value="false" />
     <property name="jobExecutorActivate" value="false" />
     <property name="jpaEntityManagerFactory" ref="entityManagerFactory" />
    <property name="jpaHandleTransaction" value="true" />
    <property name="jpaCloseEntityManager" value="true" />
   
    <property name="mailServerHost" value="localhost" />
    <property name="mailServerPort" value="5025" />
    <property name="customFormTypes">
      <list>
        <bean class="org.activiti.explorer.form.UserFormType"/>
        <bean class="org.activiti.explorer.form.ProcessDefinitionFormType"/>
        <bean class="org.activiti.explorer.form.MonthFormType"/>  
        <bean class="it.sydema.laweb.activiti.FormTypeAmount" />
        <bean class="it.sydema.laweb.activiti.FormTypeDecimal" />
        <bean class="it.sydema.laweb.activiti.FormTypeInteger"/>
        <bean class="it.sydema.laweb.activiti.FormTypeText"/>
        <bean class="it.sydema.laweb.activiti.FormTypeEntity"/>
        <bean class="it.sydema.laweb.activiti.FormTypeValidationRule"/>
      </list>
    </property>
    <!– property for custom user and groups –> 
     <property name="customSessionFactories">
        <list>
        <bean class="it.sydema.laweb.activiti.CustomUserManagerFactory">
         <constructor-arg ref="MyConnectionParams" />
      </bean>              
      <bean class="it.sydema.laweb.activiti.CustomGroupManagerFactory">
             <constructor-arg ref="MyConnectionParams" />              
       </bean>
      </list>
   </property>
</bean>       

<bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean" destroy-method="destroy">
   <property name="processEngineConfiguration" ref="processEngineConfiguration" />
</bean>
</code>



error stacktrace :

<code>
nov 19, 2013 10:33:09 AM org.apache.catalina.core.StandardContext listenerStart
Grave: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'activitiController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.activiti.engine.ProcessEngine it.sydema.laweb.controllers.ActivitiController.processEngine; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine': FactoryBean threw exception on object creation; nested exception is org.springframework.orm.hibernate3.HibernateSystemException: commit failed; nested exception is org.hibernate.TransactionException: commit failed
   at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:288)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1116)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
   at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628)
   at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
   at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791)
   at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)
   at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
   at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
   at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
   at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
   at java.util.concurrent.FutureTask.run(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.activiti.engine.ProcessEngine it.sydema.laweb.controllers.ActivitiController.processEngine; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine': FactoryBean threw exception on object creation; nested exception is org.springframework.orm.hibernate3.HibernateSystemException: commit failed; nested exception is org.hibernate.TransactionException: commit failed
   at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:514)
   at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
   at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:285)
   … 23 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine': FactoryBean threw exception on object creation; nested exception is org.springframework.orm.hibernate3.HibernateSystemException: commit failed; nested exception is org.hibernate.TransactionException: commit failed
   at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:149)
   at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:102)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1454)
   at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:306)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:912)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:855)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:770)
   at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:486)
   … 25 more
Caused by: org.springframework.orm.hibernate3.HibernateSystemException: commit failed; nested exception is org.hibernate.TransactionException: commit failed
   at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:690)
   at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:104)
   at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:516)
   at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:755)
   at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:724)
   at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:148)
   at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
   at org.activiti.engine.impl.ProcessEngineImpl.<init>(ProcessEngineImpl.java:76)
   at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:365)
   at org.activiti.spring.SpringProcessEngineConfiguration.buildProcessEngine(SpringProcessEngineConfiguration.java:64)
   at org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:56)
   at org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:32)
   at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
   … 33 more
Caused by: org.hibernate.TransactionException: commit failed
   at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:185)
   at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:75)
   at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:512)
   … 44 more
Caused by: org.hibernate.TransactionException: unable to commit against JDBC connection
   at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.doCommit(JdbcTransaction.java:116)
   at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:178)
   … 46 more
Caused by: java.sql.SQLException: Connection is closed.
   at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.checkOpen(PoolingDataSource.java:185)
   at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.commit(PoolingDataSource.java:210)
   at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.doCommit(JdbcTransaction.java:112)
   … 47 more
</code>


I've already tried Hibernate 4.2.7.SP1 without any changes.

if you need some more info,  just ask.