aspose file tools*
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
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate Configuration Loading Problem