• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

NPE on EM queries with no results; why?

Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?

    Bookmark Topic Watch Topic
  • New Topic