-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Errors in named quries
PostPosted: Wed Jun 25, 2008 6:57 am 
Newbie

Joined: Wed Jun 25, 2008 6:43 am
Posts: 2
org.hibernate.HibernateException: Errors in named queries: selectAllEmployees_SP
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:339)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176)
at com.tcs.util.EmployeeUtils.getSession(EmployeeUtils.java:25)
at com.tcs.action.EmpAction.execute(EmpAction.java:28)
at org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:110)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 25, 2008 10:29 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Looks like an error in your NamedQuery.

Quote:
Errors in named queries

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
 Post subject: Errors in named queries
PostPosted: Thu Jul 10, 2008 2:17 pm 
Newbie

Joined: Tue Apr 25, 2006 1:17 pm
Posts: 19
It's probably due to the fact that between 3.1 and 3.2, some of the query parsing and recognition changed.

See Query language changes at: http://www.hibernate.org/250.html#A25

Justin


Top
 Profile  
 
 Post subject: Error in named queries
PostPosted: Thu Jul 10, 2008 2:33 pm 
Newbie

Joined: Tue Apr 25, 2006 1:17 pm
Posts: 19
Also, I received the same error when I had my HQL as:

Code:
<query name="myFinderQuery"><![CDATA[
        from
            Person p
        inner join
            p.cars cars
        where
            p.id = :personId and
            cars.owners.id = :personId
    ]]></query>


Changing the above query to be the following fixed the problem:

Code:
<query name="myFinderQuery"><![CDATA[
        from
            Person p
        inner join
            p.cars cars
        inner join
            cars.owners owners
        where
            p.id = :personId and
            owners.id = :personId
    ]]></query>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.