-->
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.  [ 1 post ] 
Author Message
 Post subject: Problem regarding running NamedQuery() with Resin ???
PostPosted: Fri Aug 17, 2007 2:41 am 
Newbie

Joined: Mon Aug 13, 2007 6:38 am
Posts: 16
Hibernate version:3

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

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



</class>
<query name="GetAllAddress">
<![CDATA[from com.cl.pojo.Address]]>
</query>

</hibernate-mapping>:

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

org.hibernate.MappingException: Named query not known: GetAllAddress
at org.hibernate.impl.AbstractSessionImpl.getNamedQuery(AbstractSessionImpl.java:70)
at org.hibernate.impl.SessionImpl.getNamedQuery(SessionImpl.java:1224)
at _jsp._clzone._reports._erp._namedquery__jsp._jspService(/clzone/reports/erp/NamedQuery.jsp:32)
at com.caucho.jsp.JavaPage.service(JavaPage.java:75)
at com.caucho.jsp.Page.pageservice(Page.java:571)
at com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:155)
at com.caucho.server.cache.CacheFilterChain.doFilter(CacheFilterChain.java:177)
at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:177)
at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:221)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:263)
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:331)
at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:464)
at com.caucho.util.ThreadPool.run(ThreadPool.java:408)
at java.lang.Thread.run(Thread.java:534)

:

Name and version of the database you are using:Oracle 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)itr.next();
long ID = a.getId();
int FirstName = a.getStd_id();
String Phone = a.getPhone();
String City = a.getCity();
}

As u hav 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.
Regards,
Abhishek


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

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.