-->
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.  [ 5 posts ] 
Author Message
 Post subject: Errors in named queries
PostPosted: Thu Sep 11, 2008 4:03 pm 
Newbie

Joined: Thu Sep 11, 2008 3:35 pm
Posts: 8
Hi I am using Hibernate 3.2.5 for the first time with Spring 2.5 / Srping Web Flow 2.0.

My direct table / views reading is working fine. When it comes to call a stored proc, I am getting the issue.

I am getting the following exception, when trying to deploy to Weblogic 9.2 Server.

Appreciate help.

Thanks

Code:
<Sep 11, 2008 3:32:52 PM EDT> <Error> <Deployer> <BEA-149265> <Failure occured in the execution of deployment request with ID '1221161524123' for task '2'. Error is: 'weblogic.application.ModuleException: '
weblogic.application.ModuleException:
   at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:891)
   at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:333)
   at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
   at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
   at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
   Truncated. see log file for complete stacktrace
org.hibernate.HibernateException: Errors in named queries: menuSummaryReportData_sp
   at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:365)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
   at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:814)
   at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:732)
   at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
   Truncated. see log file for complete stacktrace
>



My Service class:
Code:

logger.debug("Hibernate Session Object is available");
         List<MenuSummaryReportData> menuSummaryReportList = sessionObj
               .getNamedQuery("menuSummaryReport_sp").setParameter(
                     "asset_id", mt_asset_id).setParameter("start_date",
                     startDateTime)
               .setParameter("end_date", endDateTime).list();
         logger.debug("size of list: " + menuSummaryReportList.size());
         sessionObj.close();



My Hibernate mapping file ( Reports.hbm.xml)

Code:

<sql-query name="menuSummaryReportData_sp" callable="true">
      <return alias="menuSummaryReportData"
         class="MenuSummaryReportData">
         <return-property name="actionDate" column="ACTION_DATE">
         </return-property>
         <return-property name="action" column="ACTION"></return-property>
         <return-property name="locations" column="LOCATIONS"></return-property>
         <return-property name="sibOrder" column="SIB_ORDER"></return-property>
         <return-property name="position" column="POSITION"></return-property>
         <return-property name="fullPath" column="FULL_PATH"></return-property>
      </return>
      {?=call
      MENU_REPORTS.menu_summary_report(:mt_asset_id,:start_date,:end_date)}
   </sql-query>



Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 11, 2008 4:08 pm 
Newbie

Joined: Thu Sep 11, 2008 3:35 pm
Posts: 8
Hi All

Herewith I am attaching the updated code in my service class:

Code:

if (sessionObj != null) {
         logger.debug("Hibernate Session Object is available");
         List<MenuSummaryReportData> menuSummaryReportList = sessionObj
               .getNamedQuery("menuSummaryReportData_sp").setParameter(
                     "p_mt_asset_id", mtAssetId).setParameter("p_start_date",
                     startDateTime)
               .setParameter("p_end_date", endDateTime).list();
         logger.debug("size of list: " + menuSummaryReportList.size());
         sessionObj.close();
      }


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 12, 2008 2:52 pm 
Newbie

Joined: Thu Sep 11, 2008 3:35 pm
Posts: 8
Hi

I am new to Hibernate and struggling to get a solution for using the Stored proc.

can some one look into my code and help me?

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 12, 2008 6:42 pm 
Newbie

Joined: Thu Sep 11, 2008 3:35 pm
Posts: 8
After doing some more research, I have a feeling that I am doing some thing wrong the way I am writing the syntax for in <sql-query> tag.

Code:

{?=call
      MENU_REPORTS.menu_summary_report(:mt_asset_id,:start_date,:end_date)}


I am passing three parameters and the procedure returns a Orclae Cursor.

Appreciate help.

I know this forum is being watched by Hibernate Gurus'. Appreciate if some Guru corrects me.

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 15, 2008 6:27 pm 
Newbie

Joined: Thu Sep 11, 2008 3:35 pm
Posts: 8
I have fixed the issue.

Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.