0 Replies Latest reply on Oct 27, 2015 3:50 AM by nabilf

    [jbpm 6.3.0 / Tomcat8 / Oracle 11G ] Hibernate error when calling rest/query/task?status=Ready

    nabilf Newbie

      Dear JBPM Team,

       

      We downloaded the kie-wb-distribution-wars-6.3.0-20150925.144314-891-tomcat7.war and installed it successfully under Tomcat 8 and then linked the jbpm application to oracle. we are getting an error when calling the below REST webservice :

       

      http://localhost:8080/jbpm-console/rest/query/task?status=Ready

      We are using org.hibernate.dialect.Oracle10gDialect and ojdbc7.jar in Tomcat/lib

      The exception is :

       

      <exception>
          <status>FAILURE</status>
          <url>http://localhost:8080/jbpm-console/rest/query/task?status=Ready</url>
          <message>PersistenceException thrown with message 'org.hibernate.exception.SQLGrammarException: could not extract ResultSet'</message>
          <stackTrace>org.kie.remote.services.rest.exception.KieRemoteRestOperationException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
      at org.kie.remote.services.rest.exception.KieRemoteRestOperationException.internalServerError(KieRemoteRestOperationException.java:151)
      at org.kie.remote.services.cdi.ProcessRequestBean.doTaskOperation(ProcessRequestBean.java:419)
      at org.kie.remote.services.cdi.ProcessRequestBean.doRestTaskOperation(ProcessRequestBean.java:426)
      at org.kie.remote.services.cdi.ProcessRequestBean$Proxy$_$$_WeldClientProxy.doRestTaskOperation(ProcessRequestBean$Proxy$_$$_WeldClientProxy.java)
      at org.kie.remote.services.rest.ResourceBase.doRestTaskOperationWithTaskId(ResourceBase.java:600)
      at org.kie.remote.services.rest.QueryResourceImpl.doTaskSummaryQuery(QueryResourceImpl.java:158)
      at org.kie.remote.services.rest.QueryResourceImpl.taskSummaryQuery(QueryResourceImpl.java:130)
      at org.kie.remote.services.rest.QueryResourceImpl$Proxy$_$$_WeldClientProxy.taskSummaryQuery(QueryResourceImpl$Proxy$_$$_WeldClientProxy.java)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:168)
      at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:269)
      at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:227)
      at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:216)
      at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:541)
      at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:523)
      at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:125)
      at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
      at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
      at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.kie.remote.services.rest.jaxb.DynamicJaxbContextFilter.doFilter(DynamicJaxbContextFilter.java:63)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.uberfire.ext.security.server.BasicAuthSecurityFilter.doFilter(BasicAuthSecurityFilter.java:53)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.uberfire.ext.security.server.SecureHeadersFilter.doFilter(SecureHeadersFilter.java:53)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.uberfire.ext.security.server.SecurityIntegrationFilter.doFilter(SecurityIntegrationFilter.java:45)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
      at org.kie.integration.tomcat.JACCValve.invoke(JACCValve.java:101)
      at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:516)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1086)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:659)
      at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:285)
      at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2439)
      at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2428)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.lang.Thread.run(Thread.java:745)
      Caused by: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
      at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1763)
      at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1677)
      at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:458)
      at org.hibernate.jpa.criteria.compile.CriteriaQueryTypeQueryAdapter.getResultList(CriteriaQueryTypeQueryAdapter.java:67)
      at org.jbpm.services.task.persistence.TaskQueryCriteriaUtil.createQueryAndCallApplyMetaCriteriaAndGetResult(TaskQueryCriteriaUtil.java:580)
      at org.jbpm.services.task.persistence.TaskQueryCriteriaUtil.doCriteriaQuery(TaskQueryCriteriaUtil.java:221)
      at org.jbpm.services.task.persistence.JPATaskPersistenceContext.doTaskSummaryCriteriaQuery(JPATaskPersistenceContext.java:489)
      at org.jbpm.services.task.impl.TaskQueryServiceImpl.query(TaskQueryServiceImpl.java:633)
      at org.jbpm.services.task.impl.TaskQueryServiceImpl.getTasksByVariousFields(TaskQueryServiceImpl.java:589)
      at org.jbpm.services.task.commands.GetTasksByVariousFieldsCommand.execute(GetTasksByVariousFieldsCommand.java:241)
      at org.jbpm.services.task.commands.GetTasksByVariousFieldsCommand.execute(GetTasksByVariousFieldsCommand.java:43)
      at org.jbpm.services.task.commands.TaskCommandExecutorImpl$SelfExecutionCommandService.execute(TaskCommandExecutorImpl.java:65)
      at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)
      at org.jbpm.services.task.persistence.TaskTransactionInterceptor.execute(TaskTransactionInterceptor.java:69)
      at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)
      at org.drools.persistence.jta.TransactionLockInterceptor.execute(TransactionLockInterceptor.java:73)
      at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)
      at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.execute(OptimisticLockRetryInterceptor.java:82)
      at org.jbpm.services.task.commands.TaskCommandExecutorImpl.execute(TaskCommandExecutorImpl.java:40)
      at org.jbpm.services.task.impl.command.CommandBasedTaskService.execute(CommandBasedTaskService.java:156)
      at org.jbpm.kie.services.impl.UserTaskServiceImpl.execute(UserTaskServiceImpl.java:923)
      at org.jbpm.services.cdi.impl.UserTaskServiceCDIImpl$Proxy$_$$_WeldClientProxy.execute(UserTaskServiceCDIImpl$Proxy$_$$_WeldClientProxy.java)
      at org.kie.remote.services.cdi.ProcessRequestBean.doTaskOperation(ProcessRequestBean.java:411)
      ... 56 more
      Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
      at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:80)
      at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49)
      at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126)
      at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:112)
      at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:91)
      at org.hibernate.loader.Loader.getResultSet(Loader.java:2066)
      at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1863)
      at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1839)
      at org.hibernate.loader.Loader.doQuery(Loader.java:910)
      at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:355)
      at org.hibernate.loader.Loader.doList(Loader.java:2554)
      at org.hibernate.loader.Loader.doList(Loader.java:2540)
      at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2370)
      at org.hibernate.loader.Loader.list(Loader.java:2365)
      at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:497)
      at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:387)
      at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:236)
      at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1300)
      at org.hibernate.internal.QueryImpl.list(QueryImpl.java:103)
      at org.hibernate.jpa.internal.QueryImpl.list(QueryImpl.java:573)
      at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:449)
      ... 76 more
      Caused by: java.sql.SQLSyntaxErrorException: ORA-00979: not a GROUP BY expression

      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:450)
      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:399)
      at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1017)
      at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:655)
      at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:249)
      at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:566)
      at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:215)
      at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:58)
      at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:776)
      at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:897)
      at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1034)
      at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3820)
      at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3867)
      at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1502)
      at bitronix.tm.resource.jdbc.JdbcUncachedPreparedStatementHandle.executeQuery(JdbcUncachedPreparedStatementHandle.java:81)
      at sun.reflect.GeneratedMethodAccessor101.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.$Proxy179.executeQuery(Unknown Source)
      at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:82)
      ... 92 more
      </stackTrace>
      </exception>

       

      We tried also with the kie-wb-distribution-wars-6.3.1-20151013.224429-29-tomcat7.war and the same error exists under tomcat and oracle.

      Please note that other REST service call are working correctly under Tomcat/Oracle and returning results without errors , for example : http://localhost:8080/jbpm-console/rest/query/task?taskowner=A101

      If we switch to the H2 database under Tomcat (use of org.hibernate.dialect.H2Dialect instead of org.hibernate.dialect.Oracle10gDialect) the error doesn't appear.

      And if we use the wildfly installation (jbpm-6.3.0.Final-installer-full.zip) the error doesn't exists .

       

       

      It seems that the HQL query is not compatible with Oracle.

      Please could you help us to fix this problem.

      Thank you.