my dog learned polymorphism*
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Hibernate Named Query Exceptions In WebLogic." Watch "Hibernate Named Query Exceptions In WebLogic." New topic

Hibernate Named Query Exceptions In WebLogic.

Amit kull
Ranch Hand

Joined: Jun 05, 2008
Posts: 46
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.

Marcos Maia
Ranch Hand

Joined: Jan 06, 2001
Posts: 977

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

Amit kull
Ranch Hand

Joined: Jun 05, 2008
Posts: 46
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.
It is sorta covered in the JavaRanch Style Guide.
subject: Hibernate Named Query Exceptions In WebLogic.
Similar Threads
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.
Hibernate in a DAO pattern & lazy loading