This issue was reported on the forum:
An EJBQL query using an aggregate function as an argument of a constructor
expression runs into a NullPointerException in ReportQuery.buildObject at
runtime. Here is the sample query:
SELECT NEW custom.CityCount(c.city, COUNT(c)) FROM Customer c GROUP BY c.city
The forum post includes the stacktrace of the NPE.