title: org.hibernate.exception.GenericJDBCException: Cannot open connection
body: <p>I m using JBPM jar to follow some process. Previously we did some code change in jar and build using Malven and it works fine. Now we did again some code change and build using Ant script. but it throws Exception like</p>
  
  <pre><code>java.lang.ExceptionInInitializerError
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
  at org.hibernate.engine.UnsavedValueFactory.instantiate(UnsavedValueFactory.java:22)
  at org.hibernate.engine.UnsavedValueFactory.getUnsavedIdentifierValue(UnsavedValueFactory.java:44)
  at org.hibernate.tuple.PropertyFactory.buildIdentifierProperty(PropertyFactory.java:44)
  at org.hibernate.tuple.entity.EntityMetamodel.&lt;init&gt;(EntityMetamodel.java:124)
  at org.hibernate.persister.entity.AbstractEntityPersister.&lt;init&gt;(AbstractEntityPersister.java:434)
  at org.hibernate.persister.entity.SingleTableEntityPersister.&lt;init&gt;(SingleTableEntityPersister.java:109)
  at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
  at org.hibernate.impl.SessionFactoryImpl.&lt;init&gt;(SessionFactoryImpl.java:226)
  at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1300)
  at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:97)
  at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:95)
  at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:99)
  at org.jbpm.persistence.db.DbPersistenceService.getGraphSession(DbPersistenceService.java:341)
  at org.jbpm.JbpmContext.getGraphSession(JbpmContext.java:571)
  at org.jbpm.JbpmContext.newProcessInstanceForUpdate(JbpmContext.java:417)
  at com.k2.process.adapter.jbpm.JBPMAdapter.createNewProcessInstance(JBPMAdapter.java:79)
  at com.k2.process.ProcessAgentManager.createNewProcessInstance(ProcessAgentManager.java:45)
  at com.k2.process.control.ProcessController.createNewProcess(ProcessController.java:153)
  at com.k2.process.control.ProcessController.createNewProcess(ProcessController.java:90)
  at com.k2.process.ProcessAgentBean.createProcess(ProcessAgentBean.java:104)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
  at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237)
  at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
  at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)
  at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
  at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
  at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
  at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
  at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
  at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
  at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
  at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
  at org.jboss.ejb.Container.invoke(Container.java:960)
  at sun.reflect.GeneratedMethodAccessor644.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
  at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
  at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:169)
  at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)
  at org.jboss.invocation.InvokerInterceptor.invokeLocalMarshalled(InvokerInterceptor.java:295)
  at org.jboss.invocation.MarshallingInvokerInterceptor.invoke(MarshallingInvokerInterceptor.java:61)
  at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
  at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
  at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:112)
  at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
  at $Proxy503.createProcess(Unknown Source)
  
   Caused by: org.hibernate.exception.GenericJDBCException: Cannot open connection
  2011-09-14 11:13:56,457 ERROR [http-192.168.1.131-18080-1] [STDERR]     at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
  2011-09-14 11:13:56,457 ERROR [http-192.168.1.131-18080-1] [STDERR]     at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
  2011-09-14 11:13:56,457 ERROR [http-192.168.1.131-18080-1] [STDERR]     at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
  2011-09-14 11:13:56,457 ERROR [http-192.168.1.131-18080-1] [STDERR]     at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
  2011-09-14 11:13:56,457 ERROR [http-192.168.1.131-18080-1] [STDERR]     at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:426)
  2011-09-14 11:13:56,457 ERROR [http-192.168.1.131-18080-1] [STDERR]     at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
  2011-09-14 11:13:56,457 ERROR [http-192.168.1.131-18080-1] [STDERR]     at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
  2011-09-14 11:13:56,457 ERROR [http-192.168.1.131-18080-1] [STDERR]     at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
  2011-09-14 11:13:56,457 ERROR [http-192.168.1.131-18080-1] [STDERR]     at org.hibernate.loader.Loader.doQuery(Loader.java:673)
  2011-09-14 11:13:56,457 ERROR [http-192.168.1.131-18080-1] [STDERR]     at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
  2011-09-14 11:13:56,457 ERROR [http-192.168.1.131-18080-1] [STDERR]     at org.hibernate.loader.Loader.doList(Loader.java:2213)
  2011-09-14 11:13:56,457 ERROR [http-192.168.1.131-18080-1] [STDERR]     at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
  2011-09-14 11:13:56,457 ERROR [http-192.168.1.131-18080-1] [STDERR]     at org.hibernate.loader.Loader.list(Loader.java:2099)
  2011-09-14 11:13:56,457 ERROR [http-192.168.1.131-18080-1] [STDERR]     at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
  2011-09-14 11:13:56,457 ERROR [http-192.168.1.131-18080-1] [STDERR]     at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
  2011-09-14 11:13:56,457 ERROR [http-192.168.1.131-18080-1] [STDERR]     at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
  2011-09-14 11:13:56,457 ERROR [http-192.168.1.131-18080-1] [STDERR]     at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
  2011-09-14 11:13:56,457 ERROR [http-192.168.1.131-18080-1] [STDERR]     at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
  2011-09-14 11:13:56,457 ERROR [http-192.168.1.131-18080-1] [STDERR]     at com.k2.util.HibernateQuery.execute(HibernateQuery.java:32)
  2011-09-14 11:13:56,457 ERROR [http-192.168.1.131-18080-1] [STDERR]     ... 209 more
  2011-09-14 11:13:56,457 ERROR [http-192.168.1.131-18080-1] [STDERR] Caused by: org.jboss.util.NestedSQLException: Transaction is not active: tx=TransactionImple &lt; ac, BasicAction: -3f57fe7d:998:4e703d1b:201 status: ActionStatus.ABORT_ONLY &gt;; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple &lt; ac, BasicAction: -3f57fe7d:998:4e703d1b:201 status: ActionStatus.ABORT_ONLY &gt;)
  2011-09-14 11:13:56,457 ERROR [http-192.168.1.131-18080-1] [STDERR]     at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:94)
  2011-09-14 11:13:56,457 ERROR [http-192.168.1.131-18080-1] [STDERR]     at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
  2011-09-14 11:13:56,457 ERROR [http-192.168.1.131-18080-1] [STDERR]     at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
  2011-09-14 11:13:56,457 ERROR [http-192.168.1.131-18080-1] [STDERR]     ... 223 more
  2011-09-14 11:13:56,457 ERROR [http-192.168.1.131-18080-1] [STDERR] Caused by: javax.resource.ResourceException: Transaction is not active: tx=TransactionImple &lt; ac, BasicAction: -3f57fe7d:998:4e703d1b:201 status: ActionStatus.ABORT_ONLY &gt;
  2011-09-14 11:13:56,457 ERROR [http-192.168.1.131-18080-1] [STDERR]     at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:304)
  2011-09-14 11:13:56,457 ERROR [http-192.168.1.131-18080-1] [STDERR]     at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:396)
  2011-09-14 11:13:56,457 ERROR [http-192.168.1.131-18080-1] [STDERR]     at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
  2011-09-14 11:13:56,457 ERROR [http-192.168.1.131-18080-1] [STDERR]     at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
  2011-09-14 11:13:56,457 ERROR [http-192.168.1.131-18080-1] [STDERR]     ... 225 more
  </code></pre>
  
  <p>There is no any change in build flow.</p>
  
  <pre><code>&lt;property name="hibernate.connection.datasource"&gt;java:/JbpmDS&lt;/property&gt;
  &lt;property name="hibernate.show_sql"&gt;true&lt;/property&gt;
  &lt;property name="hibernate.format_sql"&gt;true&lt;/property&gt;
  &lt;property name="hibernate.use_sql_comments"&gt;true&lt;/property&gt;
  </code></pre>
  
  <p>Above is my hibernate mapping.
  And here is my line from where exception is generated</p>
  
  <pre><code>sessionFactory=hibernateConfiguration.buildSessionFactory();
  </code></pre>
  
  <p>Thank You in adavance.</p>