NPE while running the following cached NamedNativeQuery with an scalar result: {code} @NamedNativeQuery(name = Member.COUNT_MEMBER_QUERY, query = "SELECT COUNT(*) AS mCount from MemberHibernate4Demo", cacheable = true, readOnly = true, resultSetMapping = "Member.countQuery.Mapping") @SqlResultSetMapping(name = "Member.countQuery.Mapping", columns = { @ColumnResult(name = "mCount") }) {code} He get the following NullPointerException: {code} 11:16:59,929 INFO [org.jboss.as.quickstart.hibernate4.controller.MemberController] (http-/127.0.0.1:8080-1) namedQuery = SQLQueryImpl(SELECT COUNT(*) AS mCount from MemberHibernate4Demo) 11:16:59,939 INFO [stdout] (http-/127.0.0.1:8080-1) Hibernate: SELECT COUNT(*) AS mCount from MemberHibernate4Demo 11:16:59,949 SEVERE [org.jboss.as.quickstart.hibernate4.controller.MemberController] (http-/127.0.0.1:8080-1) FIXME: Error while executing namedQuery! : java.lang.NullPointerException at org.hibernate.cache.internal.StandardQueryCache.put(StandardQueryCache.java:111) [hibernate-core-4.2.0.SP1-redhat-1.jar:4.2.0.SP1-redhat-1] at org.hibernate.loader.Loader.putResultInQueryCache(Loader.java:2482) [hibernate-core-4.2.0.SP1-redhat-1.jar:4.2.0.SP1-redhat-1] at org.hibernate.loader.Loader.listUsingQueryCache(Loader.java:2363) [hibernate-core-4.2.0.SP1-redhat-1.jar:4.2.0.SP1-redhat-1] at org.hibernate.loader.Loader.list(Loader.java:2324) [hibernate-core-4.2.0.SP1-redhat-1.jar:4.2.0.SP1-redhat-1] at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:338) [hibernate-core-4.2.0.SP1-redhat-1.jar:4.2.0.SP1-redhat-1] at org.hibernate.internal.SessionImpl.listCustomQuery(SessionImpl.java:1827) [hibernate-core-4.2.0.SP1-redhat-1.jar:4.2.0.SP1-redhat-1] at org.hibernate.internal.AbstractSessionImpl.list(AbstractSessionImpl.java:231) [hibernate-core-4.2.0.SP1-redhat-1.jar:4.2.0.SP1-redhat-1] at org.hibernate.internal.SQLQueryImpl.list(SQLQueryImpl.java:157) [hibernate-core-4.2.0.SP1-redhat-1.jar:4.2.0.SP1-redhat-1] at org.hibernate.internal.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:905) [hibernate-core-4.2.0.SP1-redhat-1.jar:4.2.0.SP1-redhat-1] at org.jboss.as.quickstart.hibernate4.controller.MemberController.executeQuerySingleResult(MemberController.java:91) [classes:] {code} The issue does not occur if we disable the caching. Same as [1] [1] https://hibernate.atlassian.net/browse/HHH-3051
Corrected upstream. On hold for EAP 6.3.0 component upgrade
Fixed by upgrade -> ON_QA
Verified in EAP 6.3.0.ER1, hibernate 4.2.11.Final-redhat-1
Brett, can you please supply a draft release note that adheres to the preformatted points in the Doc Text field above? I'm having trouble understanding the issue and its fix for the EAP 6.3.0 release notes document.
I can't seem to get my changes to the Doc Text field to stick after a save of this ticket so I'm posting them here. The elements required for an adequate release note are: Cause: Consequence: Fix: Result:
Done!
Thanks Brett. That's exactly what I needed. Reformatted the doc text and marked for inclusion in the 6.3.0 release notes documentation.
*** Bug 1087627 has been marked as a duplicate of this bug. ***
Changed <programlisting> tags in Doc Text to ticks (`) to fix Bug 1096865