users@glassfish.java.net

Query getResultList throwing exception

From: <glassfish_at_javadesktop.org>
Date: Mon, 10 Mar 2008 22:14:29 PST

The following is throwing an exception as a call to getResultList. This used to work with an older version of GlassFish and libraries. I just started working with GF again and updated to the latest.

I encounter this with both TopLink and Hibernate as the JPA Provider. I even attempted to to change all nullable=false columns to true just trying to track things down.

@NamedQuery
      (
         name = "user.findUserByUserName",
         query = " select u from User u where u.userName = :userName "
      )

Query q = em.createNamedQuery( "user.findUserByUserName" );
q.setParameter( "userName", userName );
List<User> existing = q.getResultList();

Exception thrown from bean; nested exception is: java.lang.IllegalArgumentException: null source
java.lang.IllegalArgumentException: null source

userName is not null
[Message sent by forum member 'samdoyle' (samdoyle)]

http://forums.java.net/jive/thread.jspa?messageID=263285