This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Hibernate Configuration Loading Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate Configuration Loading Problem" Watch "Hibernate Configuration Loading Problem" New topic
Author

Hibernate Configuration Loading Problem

ali honarmand
Ranch Hand

Joined: Oct 12, 2009
Posts: 32

Hi All,

In my first program integrating Hibernate and Spring I have encountered the following exception:


I have put hibernate configuration in a bean tag in beans.xml as follows:



Here is the Course Entity:


And the code that uses it:


Thanks


A. Honarmand
Sumit Bisht
Ranch Hand

Joined: Jul 02, 2008
Posts: 329

" Could not instantiate bean class [org.hibernate.cfg.Configuration]"
I'd guess your classpath does not have jar files for hibernate.
ali honarmand
Ranch Hand

Joined: Oct 12, 2009
Posts: 32

Sumit Bisht wrote:" Could not instantiate bean class [org.hibernate.cfg.Configuration]"
I'd guess your classpath does not have jar files for hibernate.


Hi Sumit,
Thanks for your answer,
I'm not sure you are right. because I have added the cfg package to libraries beside my project.
It works well while I use hibernate alone or spring alone. forexample setter injection and/or constructor injection work well.
and I have also Implemented CRUD using hibernate and sure it works well.
But when it comes to integration the problem shows itself.
I'm still working on it.
thanks anyway
Sumit Bisht
Ranch Hand

Joined: Jul 02, 2008
Posts: 329

It could be the problem with the versions of frameworks/tools that you are using. If you can give the full stack trace, the missing dependency would become clearer.
p.s. : Found a similar problem http://forum.springsource.org/showthread.php?60258-standalone-spring-app-exception-loading-context-from-xml-file
 
jQuery in Action, 2nd edition
 
subject: Hibernate Configuration Loading Problem
 
Similar Threads
IllegalStateException: No value for key [...orm.jpa.LocalEntityManagerFactoryBean]
Error creating bean with name 'mySessionFactory' defined in class path:Error setting property values
Initial SessionFactory creation failed. java.lang.AbstractMethodErro
Hibernate annotations one to many relationship with composite primary key
Hibernate "Exception in thread "main" java.lang.ExceptionInInitializerError" problem....