org.hibernate.exception.GenericJDBCException

could not prepare statement

Samebug tips0

We couldn't find tips for this exception.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web1

  • via Unknown by Angelo D,
  • Stack trace

    • org.hibernate.exception.GenericJDBCException: could not prepare statement at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1387) at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1310) at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:316) at org.jbpm.shared.services.impl.JpaPersistenceContext.queryStringWithParameters(JpaPersistenceContext.java:188) at org.jbpm.shared.services.impl.JpaPersistenceContext.queryAndLockWithParametersInTransaction(JpaPersistenceContext.java:65) at org.jbpm.executor.impl.jpa.ExecutorQueryServiceImpl$LockAndUpdateRequestInfoCommand.execute(ExecutorQueryServiceImpl.java:238) at org.jbpm.executor.impl.jpa.ExecutorQueryServiceImpl$LockAndUpdateRequestInfoCommand.execute(ExecutorQueryServiceImpl.java:224) at org.jbpm.shared.services.impl.TransactionalCommandService.execute(TransactionalCommandService.java:71) at org.jbpm.executor.impl.jpa.ExecutorQueryServiceImpl.getRequestForProcessing(ExecutorQueryServiceImpl.java:211) at org.jbpm.executor.impl.AvailableJobsExecutor.executeJob(AvailableJobsExecutor.java:36) at org.jbpm.executor.impl.ExecutorRunnable.run(ExecutorRunnable.java:42) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: org.hibernate.exception.GenericJDBCException: could not prepare statement at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:124) at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:193) at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:157) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1881) at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1858) at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1838) at org.hibernate.loader.Loader.doQuery(Loader.java:906) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:348) at org.hibernate.loader.Loader.doList(Loader.java:2550) at org.hibernate.loader.Loader.doList(Loader.java:2536) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2366) at org.hibernate.loader.Loader.list(Loader.java:2361) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:495) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:357) at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:198) at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1230) at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101) at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:287) ... 15 more Caused by: java.sql.SQLException: error enlisting a JdbcConnectionHandle of a JdbcPooledConnection from datasource jdbc/jbpm in state ACCESSIBLE with usage count 1 wrapping a JDBC LrcXACo nnection on conn1: url=jdbc:h2:file:~/jbpm user=SA on a JDBC LrcConnectionHandle on a JDBC LrcXAResource in state NO_TX at bitronix.tm.resource.jdbc.JdbcConnectionHandle.enlistResource(JdbcConnectionHandle.java:87) at bitronix.tm.resource.jdbc.JdbcConnectionHandle.prepareStatement(JdbcConnectionHandle.java:242) at sun.reflect.GeneratedMethodAccessor91.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at bitronix.tm.resource.jdbc.BaseProxyHandlerClass.invoke(BaseProxyHandlerClass.java:64) at com.sun.proxy.$Proxy148.prepareStatement(Unknown Source) at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:159) at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:183) ... 31 more Caused by: bitronix.tm.internal.BitronixSystemException: cannot enlist an XAResourceHolderState with uniqueName=jdbc/jbpm XAResource=a JDBC LrcXAResource in state NO_TX with XID a Bitroni x XID [746F6D6361742D62746D2D6E6F646530000000008043822400000125 : 746F6D6361742D62746D2D6E6F646530000000008043822500000126], error=XAER_PROTO at bitronix.tm.BitronixTransaction.enlistResource(BitronixTransaction.java:139) at bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:69) at bitronix.tm.resource.jdbc.JdbcConnectionHandle.enlistResource(JdbcConnectionHandle.java:85) ... 39 more Caused by: bitronix.tm.internal.BitronixXAException: resource already started on XID a Bitronix XID [746F6D6361742D62746D2D6E6F646530000000008043817000000123 : 746F6D6361742D62746D2D6E6F6 46530000000008043817200000124] at bitronix.tm.resource.jdbc.lrc.LrcXAResource.start(LrcXAResource.java:123) at bitronix.tm.internal.XAResourceHolderState.start(XAResourceHolderState.java:220) at bitronix.tm.internal.XAResourceManager.enlist(XAResourceManager.java:111) at bitronix.tm.BitronixTransaction.enlistResource(BitronixTransaction.java:130) ... 41 more

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Unknown visitor
    Unknown visitorOnce,