• Post Reply Bookmark Topic Watch Topic
  • New Topic

NPE on EM queries with no results; why?  RSS feed

Chris Simons
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I'm experiencing an issue running our Seam application after migrating it from JBoss 4.2.2. to WebLogic 11g (10.3.1); the issue deals with entityManager.createQuery wherein no results are returned. Under JBoss, no NPE would be thrown, even if the query returned no results. Under WebLogic (same versions of Hibernate, Seam, JSF, etc.), an NPE is thrown - meaning I have to catch it to avoid this error.


Under JBoss AS and Hibernate/JPA, this query would return no results but this would be handled gracefully.

Now, under WebLogic (but ignore this fact, really, because it could happen under GlassFish or other JEE AS), I get a NullPointerException, such as:

If I catch the NPE, the application resumes normally. But why the difference? Since the returned value of this query is displayed using JSF EL, could that be the culprit?

Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!