• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

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

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No one has an idea or a piece of advice to find a solution?
 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Unfortunately, i've already this jar
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic