Uploaded image for project: 'AeroGear'
  1. AeroGear
  2. AEROGEAR-6309

JPAPushApplicationDao.countInstallationsByType() does not work on Postgres

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Done
    • Critical
    • None
    • None
    • None

    Description

      Trying our PostgreSQL instructions with a recent master.

      After creating a PushApplication I clicked on the "variant" link, but that generates an error on the server:

      Caused by: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
      	at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1387) [hibernate-entitymanager-4.2.12.Final-redhat-1.jar:4.2.12.Final-redhat-1]
      	at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1310) [hibernate-entitymanager-4.2.12.Final-redhat-1.jar:4.2.12.Final-redhat-1]
      	at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:277) [hibernate-entitymanager-4.2.12.Final-redhat-1.jar:4.2.12.Final-redhat-1]
      	at org.jboss.aerogear.unifiedpush.jpa.dao.impl.JPAPushApplicationDao.countInstallationsByType(JPAPushApplicationDao.java:108) [unifiedpush-model-jpa-1.0.0.Beta2-SNAPSHOT.jar:1.0.0.Beta2-SNAPSHOT]
      	at org.jboss.aerogear.unifiedpush.service.impl.PushApplicationServiceImpl.countInstallationsByType(PushApplicationServiceImpl.java:59) [unifiedpush-service-1.0.0.Beta2-SNAPSHOT.jar:1.0.0.Beta2-SNAPSHOT]
      	at org.jboss.aerogear.unifiedpush.rest.registry.applications.PushApplicationEndpoint.countInstallations(PushApplicationEndpoint.java:177) [unifiedpush-jaxrs-1.0.0.Beta2-SNAPSHOT.jar:1.0.0.Beta2-SNAPSHOT]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_65]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_65]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_65]
      	at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_65]
      	at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52) [jboss-as-ee-7.4.0.Final-redhat-11.jar:7.4.0.Final-redhat-11]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
      	at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
      	at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63) [jboss-as-ee-7.4.0.Final-redhat-11.jar:7.4.0.Final-redhat-11]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
      	at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:374) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
      	at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:86) [jboss-as-weld-7.4.0.Final-redhat-11.jar:7.4.0.Final-redhat-11]
      	at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:97) [jboss-as-weld-7.4.0.Final-redhat-11.jar:7.4.0.Final-redhat-11]
      	at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63) [jboss-as-ee-7.4.0.Final-redhat-11.jar:7.4.0.Final-redhat-11]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
      	at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
      	at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63) [jboss-as-ee-7.4.0.Final-redhat-11.jar:7.4.0.Final-redhat-11]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
      	at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43) [jboss-as-ejb3-7.4.0.Final-redhat-11.jar:7.4.0.Final-redhat-11]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
      	at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47) [jboss-as-jpa-7.4.0.Final-redhat-11.jar:7.4.0.Final-redhat-11]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
      	at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:73) [jboss-as-weld-7.4.0.Final-redhat-11.jar:7.4.0.Final-redhat-11]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
      	at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
      	at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
      	at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53) [jboss-as-ee-7.4.0.Final-redhat-11.jar:7.4.0.Final-redhat-11]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
      	at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51) [jboss-as-ejb3-7.4.0.Final-redhat-11.jar:7.4.0.Final-redhat-11]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
      	at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:272) [jboss-as-ejb3-7.4.0.Final-redhat-11.jar:7.4.0.Final-redhat-11]
      	... 55 more
      Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
      	at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:123) [hibernate-core-4.2.12.Final-redhat-1.jar:4.2.12.Final-redhat-1]
      	at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) [hibernate-core-4.2.12.Final-redhat-1.jar:4.2.12.Final-redhat-1]
      	at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:124) [hibernate-core-4.2.12.Final-redhat-1.jar:4.2.12.Final-redhat-1]
      	at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109) [hibernate-core-4.2.12.Final-redhat-1.jar:4.2.12.Final-redhat-1]
      	at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:88) [hibernate-core-4.2.12.Final-redhat-1.jar:4.2.12.Final-redhat-1]
      	at org.hibernate.loader.Loader.getResultSet(Loader.java:2062) [hibernate-core-4.2.12.Final-redhat-1.jar:4.2.12.Final-redhat-1]
      	at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1859) [hibernate-core-4.2.12.Final-redhat-1.jar:4.2.12.Final-redhat-1]
      	at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1838) [hibernate-core-4.2.12.Final-redhat-1.jar:4.2.12.Final-redhat-1]
      	at org.hibernate.loader.Loader.doQuery(Loader.java:906) [hibernate-core-4.2.12.Final-redhat-1.jar:4.2.12.Final-redhat-1]
      	at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:348) [hibernate-core-4.2.12.Final-redhat-1.jar:4.2.12.Final-redhat-1]
      	at org.hibernate.loader.Loader.doList(Loader.java:2550) [hibernate-core-4.2.12.Final-redhat-1.jar:4.2.12.Final-redhat-1]
      	at org.hibernate.loader.Loader.doList(Loader.java:2536) [hibernate-core-4.2.12.Final-redhat-1.jar:4.2.12.Final-redhat-1]
      	at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2366) [hibernate-core-4.2.12.Final-redhat-1.jar:4.2.12.Final-redhat-1]
      	at org.hibernate.loader.Loader.list(Loader.java:2361) [hibernate-core-4.2.12.Final-redhat-1.jar:4.2.12.Final-redhat-1]
      	at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:495) [hibernate-core-4.2.12.Final-redhat-1.jar:4.2.12.Final-redhat-1]
      	at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:357) [hibernate-core-4.2.12.Final-redhat-1.jar:4.2.12.Final-redhat-1]
      	at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:198) [hibernate-core-4.2.12.Final-redhat-1.jar:4.2.12.Final-redhat-1]
      	at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1194) [hibernate-core-4.2.12.Final-redhat-1.jar:4.2.12.Final-redhat-1]
      	at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101) [hibernate-core-4.2.12.Final-redhat-1.jar:4.2.12.Final-redhat-1]
      	at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:268) [hibernate-entitymanager-4.2.12.Final-redhat-1.jar:4.2.12.Final-redhat-1]
      	... 89 more
      Caused by: org.postgresql.util.PSQLException: ERROR: column "variant1_.type" must appear in the GROUP BY clause or be used in an aggregate function
        Position: 8
      	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157)
      	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886)
      	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
      	at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:559)
      	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:417)
      	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:302)
      	at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:462)
      	at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:79) [hibernate-core-4.2.12.Final-redhat-1.jar:4.2.12.Final-redhat-1]
      	... 104 more
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            mwessend@redhat.com Matthias Wessendorf
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: