Announcement Announcement Module
Collapse
No announcement yet.
spring + hibernate Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • spring + hibernate

    I am trying to execute the example from this website: http://www.dzone.com/tutorials/java/...gration-1.html with postgresql database. but it doesn't work. This is errors:

    .................................................. .
    23.06.2012 16:51:29 org.springframework.web.servlet.FrameworkServlet initServletBean
    SEVERE: Context initialization failed
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'mySessionFactory' defined in ServletContext resource [/WEB-INF/dispatcher-servlet.xml]: Invocation of init method failed; nested exception is org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [org.hibernate.cfg.AnnotationConfiguration]: Constructor threw exception; nested exception is java.lang.ClassCastException: org.hibernate.annotations.common.reflection.java.J avaReflectionManager cannot be cast to org.hibernate.annotations.common.reflection.Metada taProviderInjector
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1337)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory$1.run(AbstractAutowireC apableBeanFactory.java:412)
    at java.security.AccessController.doPrivileged(Native Method)
    ...............................

    there are libraries in springhib\WebContent\WEB-INF\lib
    Attachment

    i am looking this topic
    http://www.coderanch.com/t/505963/Sp...nnect-database
    but there are only typo mistake
    Attached Files

  • #2
    Hello

    Next time use the code tags

    Could you post the dispatcher-servlet.xml content? I want to see mostly the mySessionFactory bean definition

    Code:
    Constructor threw exception; nested exception is java.lang.ClassCastException: 
    org.hibernate.annotations.common.reflection.java.J avaReflectionManager cannot be cast to 
    org.hibernate.annotations.common.reflection.MetadataProviderInjector
    I think it would be due a conflicts of version among the Hibernate dependencies

    Comment

    Working...
    X