org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/conf/spring/dataaccess/openjpa/openjpa.xml]: Invocation of init method failed; nested exception is java.lang.ClassCastException: javax.persistence.ValidationMode cannot be cast to javax.persistence.spi.ValidationMode

Spring JIRA | Simon So | 7 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    To run the attached project: mvn clean install mvn tomcat:run Exception upon initialization... Please also add 3.0.2 + openjpa 2.0.0 as part of the unit test. Apr 13, 2010 1:43:51 PM org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring FrameworkServlet 'ecomapp' Apr 13, 2010 1:59:21 PM org.apache.catalina.core.ApplicationContext log SEVERE: StandardWrapper.Throwable org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/conf/spring/dataaccess/openjpa/openjpa.xml]: Invocation of init method failed; nested exception is java.lang.ClassCastException: javax.persistence.ValidationMode cannot be cast to javax.persistence.spi.ValidationMode at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1412) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:546) at : at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) Caused by: java.lang.ClassCastException: javax.persistence.ValidationMode cannot be cast to javax.persistence.spi.ValidationMode at $Proxy0.getValidationMode(Unknown Source) at org.apache.openjpa.persistence.PersistenceUnitInfoImpl.toOpenJPAProperties(PersistenceUnitInfoImpl.java:487) at org.apache.openjpa.persistence.PersistenceProductDerivation.load(PersistenceProductDerivation.java:208) at org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:158) at org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:59) at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:225) at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:308) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1469) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1409) ... 41 more

    Spring JIRA | 7 years ago | Simon So
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/conf/spring/dataaccess/openjpa/openjpa.xml]: Invocation of init method failed; nested exception is java.lang.ClassCastException: javax.persistence.ValidationMode cannot be cast to javax.persistence.spi.ValidationMode
  2. 0

    To run the attached project: mvn clean install mvn tomcat:run Exception upon initialization... Please also add 3.0.2 + openjpa 2.0.0 as part of the unit test. Apr 13, 2010 1:43:51 PM org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring FrameworkServlet 'ecomapp' Apr 13, 2010 1:59:21 PM org.apache.catalina.core.ApplicationContext log SEVERE: StandardWrapper.Throwable org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/conf/spring/dataaccess/openjpa/openjpa.xml]: Invocation of init method failed; nested exception is java.lang.ClassCastException: javax.persistence.ValidationMode cannot be cast to javax.persistence.spi.ValidationMode at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1412) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:546) at : at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) Caused by: java.lang.ClassCastException: javax.persistence.ValidationMode cannot be cast to javax.persistence.spi.ValidationMode at $Proxy0.getValidationMode(Unknown Source) at org.apache.openjpa.persistence.PersistenceUnitInfoImpl.toOpenJPAProperties(PersistenceUnitInfoImpl.java:487) at org.apache.openjpa.persistence.PersistenceProductDerivation.load(PersistenceProductDerivation.java:208) at org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:158) at org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:59) at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:225) at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:308) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1469) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1409) ... 41 more

    Spring JIRA | 7 years ago | Simon So
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/conf/spring/dataaccess/openjpa/openjpa.xml]: Invocation of init method failed; nested exception is java.lang.ClassCastException: javax.persistence.ValidationMode cannot be cast to javax.persistence.spi.ValidationMode
  3. 0

    javax.naming.NameNotFoundException when deploying WebAppp with JBoss/Spring and NetBeans

    Stack Overflow | 5 years ago | Julian
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'BuzonAdaptivCoreDS': Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: BuzonAdaptivCoreDS not bound
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Hibernate storing maps using @MapKey annotation

    Stack Overflow | 6 years ago | Blanca Hdez
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext-dao.xml]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: Use of @OneToMany or @ManyToMany targeting an unmapped class: com.path.TaskAssignationState.usersState[java.lang.Boolean]
  6. 0

    Unable to run JUnit test created by Spring MVC scaffold - Genuitec

    genuitec.com | 1 year ago
    java.lang.IllegalStateException: Failed to load ApplicationContext

  1. Andreas Häber 2 times, last 2 weeks ago
  2. treefolk 1 times, last 3 weeks ago
  3. mauritius 2 times, last 2 months ago
  4. batwalrus76 3 times, last 2 months ago
  5. jpvee 1 times, last 2 months ago
25 more registered users
70 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.springframework.beans.factory.BeanCreationException

    Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/conf/spring/dataaccess/openjpa/openjpa.xml]: Invocation of init method failed; nested exception is java.lang.ClassCastException: javax.persistence.ValidationMode cannot be cast to javax.persistence.spi.ValidationMode

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean()
  2. Spring Beans
    DefaultListableBeanFactory.preInstantiateSingletons
    1. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1412)
    2. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    4. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
    5. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    6. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
    7. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
    8. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:546)
    8 frames