Announcement Announcement Module
Collapse
No announcement yet.
(netbeans) Error creating bean with name 'entityManagerFactory' Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • (netbeans) Error creating bean with name 'entityManagerFactory'

    hi,

    here is my problem : I have got this error, while launching a spring project :

    Error creating bean with name 'entityManagerFactory' defined in class path resource [spring-config-dao.xml]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: java.lang.NoSuchMethodException: org.hibernate.validator.ClassValidator.<init>(java .lang.Class, java.util.ResourceBundle, org.hibernate.validator.MessageInterpolator, java.util.Map, org.hibernate.annotations.common.reflection.Reflec tionManager)
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'entityManagerFactory' defined in class path resource [spring-config-dao.xml]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: java.lang.NoSuchMethodException: org.hibernate.validator.ClassValidator.<init>(java .lang.Class, java.util.ResourceBundle, org.hibernate.validator.MessageInterpolator, java.util.Map, org.hibernate.annotations.common.reflection.Reflec tionManager)
    Caused by: org.hibernate.AnnotationException: java.lang.NoSuchMethodException: org.hibernate.validator.ClassValidator.<init>(java .lang.Class, java.util.ResourceBundle, org.hibernate.validator.MessageInterpolator, java.util.Map, org.hibernate.annotations.common.reflection.Reflec tionManager)
    here is the configuration file :

    Code:
    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:tx="http://www.springframework.org/schema/tx"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
        http://www.springframework.org/schema/tx
        http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
    
        <bean id="employeDao" class="dao.EmployeDao"></bean>
        <bean id="cotisationDao" class="dao.CotisationDao"></bean>
        <bean id="indemniteDao" class="dao.IndemniteDao"></bean>
    
        <bean id="entityManagerFactory"
        class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
            <property name="dataSource" ref="dataSource"></property>
            <property name="jpaVendorAdapter">
                <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
                    <property name="showSql" value="true"></property>
                    <property name="databasePlatform"
                    value="org.hibernate.dialect.MySQL5InnoDBDialect"></property>
                    <property name="generateDdl" value="true"></property>
    
    
                </bean>
    
            </property>
        <property name="loadTimeWeaver">
            <bean class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver">
    
            </bean>
    
        </property>
        </bean>
    
        <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
            <property name="driverClassName" value="com.mysql.jdbc.Driver">
            </property>
            <property name="url" value="jdbc:mysql://localhost:3306/jbossdb">
            </property>
            <property name="username" value="root"></property>
            <property name="password" value="password"></property>
    
        </bean>
        
        <tx:annotation-driven transaction-manager="txManager"></tx:annotation-driven>
        
        <bean id="txManager" 
        class="org.springframework.orm.jpa.JpaTransactionManager">
            <property name="entityManagerFactory" 
                ref="entityManagerFactory">
                    
                </property>
            
        </bean>
        
        <bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor"/>
        
        <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>
        
    
    
    </beans>
    I hace read somewhere that the line where the error is has the purpose of configuring the JPA access, and relies on a JAR dispended by spring.
    which file is concerned?


    olivier.

  • #2
    Judging from your stacktrace you are using wrong hibernate jars or jars that hibernate needs.

    Comment

    Working...
    X