Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
fabian verbeek
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
fabian verbeek
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks but i don't find the necessary lib i need :-s

Do you know which one contain this class?
 
fabian verbeek
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No one has an idea or a piece of advice to find a solution?
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
fabian verbeek
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unfortunately, i've already this jar
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic