- 11:44:45,718 ERROR HibernateSessionResource:42 - hibernate transaction begin failed. closing hibernate session
- java.lang.UnsupportedOperationException: The user must supply a JDBC connection
- at org.hibernate.connection.UserSuppliedConnectionProvider.getConnection(UserSuppliedConnectionProvider.java:54)
- at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
- at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
- at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:142)
- at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:85)
- at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1353)
- at org.jbpm.pvm.internal.tx.HibernateSessionResource.<init>(HibernateSessionResource.java:44)
- at org.jbpm.pvm.internal.wire.descriptor.HibernateSessionDescriptor.construct(HibernateSessionDescriptor.java:87)
- at org.jbpm.pvm.internal.wire.WireContext.construct(WireContext.java:487)
- at org.jbpm.pvm.internal.wire.WireContext.create(WireContext.java:466)
- at org.jbpm.pvm.internal.wire.WireContext.create(WireContext.java:455)
- at org.jbpm.pvm.internal.wire.WireContext.get(WireContext.java:429)
- at org.jbpm.pvm.internal.wire.WireContext.get(WireContext.java:339)
- at org.jbpm.pvm.internal.wire.WireContext.get(WireContext.java:704)
- at org.jbpm.pvm.internal.env.BasicEnvironment.get(BasicEnvironment.java:132)
- at org.jbpm.pvm.internal.env.BasicEnvironment.get(BasicEnvironment.java:123)
- at org.jbpm.pvm.internal.env.EnvironmentImpl.getFromCurrent(EnvironmentImpl.java:207)
- at org.jbpm.pvm.internal.env.EnvironmentImpl.getFromCurrent(EnvironmentImpl.java:196)
- at org.jbpm.pvm.internal.cmd.CheckDbCmd.execute(CheckDbCmd.java:44)
- at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
- at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:50)
- at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
- at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
- at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:56)
- at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
- at org.jbpm.pvm.internal.processengine.ProcessEngineImpl.checkDb(ProcessEngineImpl.java:152)
- at org.jbpm.pvm.internal.processengine.SpringProcessEngine.create(SpringProcessEngine.java:70)
- at org.jbpm.pvm.internal.cfg.ConfigurationImpl.buildProcessEngine(ConfigurationImpl.java:90)
- at org.jbpm.pvm.internal.processengine.SpringHelper.createProcessEngine(SpringHelper.java:50)
- at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
- at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
- at java.lang.reflect.Method.invoke(Unknown Source)
- at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:118)
- at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:332)
- at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:782)
- at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:709)
- at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:384)
- at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
- at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
- at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
- at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
- at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287)
- at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
- at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
- at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
- at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
- at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4205)
- at org.apache.catalina.core.StandardContext.start(StandardContext.java:4704)
- at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
- at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
- at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
- at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)
- at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)
- at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)
- at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1315)
- at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
- at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
- at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1061)
- at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
- at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
- at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
- at org.apache.catalina.core.StandardService.start(StandardService.java:525)
- at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
- at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
- at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
- at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
- at java.lang.reflect.Method.invoke(Unknown Source)
- at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
- at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
解决方法:由于是使用Spring管理,所以jbpm.cfg.xml中的
<import resource="jbpm.tx.hibernate.cfg.xml" />
替换成
<import resource="jbpm.tx.spring.cfg.xml" />