aspose file tools*
The moose likes Spring and the fly likes Failed to import bean definitions from relative location [hibernate-context.xml] Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Failed to import bean definitions from relative location [hibernate-context.xml]" Watch "Failed to import bean definitions from relative location [hibernate-context.xml]" New topic
Author

Failed to import bean definitions from relative location [hibernate-context.xml]

fabian verbeek
Ranch Hand

Joined: Oct 20, 2012
Posts: 52
hi,

i'm back with a new issue in my learning of spring.
I'm trying to use hibernate and i don't find any solution.

here is my trace:


my creationUser-context.xml


and my hibernate-context.xml


for information, i've this jar:
commons-logging-1.1.1.jar
jstl-1-2.2.jar
log4j-1.2.17.jar

hibernate-core-4.1.7
hibernate-validator-4.1.0
hibernate-jpa-2.0-api-1.0.1.Final.jar

spring-orm-3.1.2
spring-asm-3.1.2
spring-beans-3.1.2
spring-context-3.1.2
spring-core-3.1.2
spring-expression-3.1.2
spring-tx-3.1.2
spring-web-3.1.2
spring-webmvc-3.1.2
org.springframework.aop-3.1.2.RELEASE
org.springframework.jms-3.1.2.RELEASE.jar
org.springframework.transaction-3.1.2.RELEASE.jar

thanks a lot for your help
fabian verbeek
Ranch Hand

Joined: Oct 20, 2012
Posts: 52
Hi,

I added some jars and modify my hibernate-context.xml
c3p0-0.9.1.2.jar
javax.transaction_1.1.0.jar
hibernate-commons-annotations-4.0.1.Final.jar
dom4j-1.6.1.jar

here is my hibernate-context.xml


What must contain my property p:packagesToScan in my bean sessionFactory?

here is my log:


thanks for your help
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

For exceptions, always go to the bottom and work your way up to find your root cause, That will always tell you what is wrong. In your stack tract

Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.springframework
.orm.hibernate4.LocalSessionFactoryBuilder

So you are missing that class in your classpath.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
fabian verbeek
Ranch Hand

Joined: Oct 20, 2012
Posts: 52
Thanks but i don't find the necessary lib i need :-s

Do you know which one contain this class?
fabian verbeek
Ranch Hand

Joined: Oct 20, 2012
Posts: 52
No one has an idea or a piece of advice to find a solution?
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1632
    
    7

you need spring-orm

http://mvnrepository.com/artifact/org.springframework/spring-orm/3.1.2.RELEASE


Adjust the version to whatever version of Spring you are using.


[How To Ask Questions][Read before you PM me]
fabian verbeek
Ranch Hand

Joined: Oct 20, 2012
Posts: 52
Unfortunately, i've already this jar
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Failed to import bean definitions from relative location [hibernate-context.xml]
 
Similar Threads
struts+spring+hibernate
Error in adding Spring security
Unable to locate Spring NamespaceHandler for XML schema namespace
org.springframework.web.context.ContextLoader - Context initialization failed