Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JPQL - org.hibernate.QueryParameter Exception: could not locate named parameter

 
Johannes Koch
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to execute two JPQL queries in an EJB3 application deployed on a JBoss 4.2.2.GA. The code looks as follows:

While the first query works fine, the second one results in the following error:

Even more strange: When I try to switch to a numbered parameter, like this

the error message stays the same and still complains about a named parameter:

This is also not affected by whether I pass the parameter value as int (2), String ("2") or Integer (new Integer(2)).
The only difference I can notice between the two queries is that in the second one I'm using a fully qualified name for the persisted Entity because the class is defined in a different package. Maybe Hibernate gets confused by that?

Can anybody give me a hint? I'm totally out of ideas.
[ June 03, 2008: Message edited by: Johannes Koch ]
 
Johannes Koch
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Found the answer here:
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4155809#4155809
Thanks for reading.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic