Found the answer in case its useful:-
The return type was set to local:
<ejb-ql>select distinct object(t) from Transaction as t where t.year = ?1 </ejb-ql>
However, even though I had created local and localhome interface classes, I had forgotten to set them up in the ejb-jar.xml for the
transaction ejb, ie -
so obvoiusly the local interfaces were not bound, causing the nullpointer problem during selection!