wood burning stoves 2.0*
The moose likes BEA/Weblogic and the fly likes Hibernate Named Query Exceptions In WebLogic. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Hibernate Named Query Exceptions In WebLogic." Watch "Hibernate Named Query Exceptions In WebLogic." New topic
Author

Hibernate Named Query Exceptions In WebLogic.

Amit kull
Ranch Hand

Joined: Jun 05, 2008
Posts: 46
Hi,
I am trying to deploy my application on WebLogic on Weblogic 10gr3. DB is Oracle 10g and Spring version is 2.5

In my GenericDAOImpl, I am injecting a session factory by refering to a bean named hibernateSessionFactory.
I have the bibernate mapping files in correct path.

I get following error:
Cannot resolve reference to bean 'hibernateSessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'saasHibernateSessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Errors in named queries: Tenant.byUserName, SLA.getSlaList

So I think it is something related to named queries. My SLA.hbm.xml contains


where SLA is the name of the class and slaCriterionName is a class variable.

This works fine in case of Tomcat and WAS. So is it some compatibility problem here? Any pointers would be helpful.

Thanks.
Marcos Maia
Ranch Hand

Joined: Jan 06, 2001
Posts: 977
Hi,

it's strange this is not working with weblogic. Maybe you're using the wrong driver.

http://e-docs.bea.com/wls/docs103/notes/new.html#wp1091177


[]s
Amit kull
Ranch Hand

Joined: Jun 05, 2008
Posts: 46
Hi,
Thanks for the response.
However, when I remove the named query from mapping file, it all works ine. So I don't think that this error is due to driver. I guess, it would be something hibernate specific.
Any further pointers would be helpful.
Thanks again.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate Named Query Exceptions In WebLogic.
 
Similar Threads
Hibernate in a DAO pattern & lazy loading
Getting HibernateException: Errors in named queries
EJB 2.1 CMP Automatic primary key issue with <unknown-primary-key-field>empId</unknown-primary-key-f
listing hibernate named queries from java
handling ContextSource & DataSource Transaction using @Transactional annotation.