Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Problem regarding running NamedQuery() with Resin ???

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hibernate version:3

<hibernate-mapping package="">
<class name="Address" table="ADDRESS">
<id name="id" type="long" column="ID" >
<generator class="increment"/>

<property name="std_id">
<column name="STD_ID" />
<property name="city">
<column name="CITY"/>
<property name="phone">
<column name="PHONE"/>

<query name="GetAllAddress">


Code between sessionFactory.openSession() and session.close():

org.hibernate.MappingException: Named query not known: GetAllAddress
at org.hibernate.impl.AbstractSessionImpl.getNamedQuery(
at org.hibernate.impl.SessionImpl.getNamedQuery(
at _jsp._clzone._reports._erp._namedquery__jsp._jspService(/clzone/reports/erp/NamedQuery.jsp:32)
at com.caucho.jsp.JavaPage.service(
at com.caucho.jsp.Page.pageservice(
at com.caucho.server.dispatch.PageFilterChain.doFilter(
at com.caucho.server.cache.CacheFilterChain.doFilter(
at com.caucho.server.webapp.WebAppFilterChain.doFilter(
at com.caucho.server.dispatch.ServletInvocation.service(
at com.caucho.server.http.HttpRequest.handleRequest(
at com.caucho.util.ThreadPool.runTasks(


Name and version of the database you are using racle 10g

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:

I used Query as --- List addr = session2.getNamedQuery("GetAllAddress").list();
for(Iterator itr=addr.iterator();itr.hasNext()
Address a = (Address);
long ID = a.getId();
int FirstName = a.getStd_id();
String Phone = a.getPhone();
String City = a.getCity();
As you have seen above, I encountered this error,but surprisingly the above code works well with jdk1.5 and Tomcat.But when I work with jdk1.4 and Resin, then the above mensioned mapping exception occurs.
So can anyone tell,what is actually the problem as I hav to work with Resin. So what would be the solution. Is this a problem with the version or some configuration settings needed to be done.Please provide some solution as I am not able to call the stored procedures.
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic