tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filip Hanik <fi...@hanik.com>
Subject Re: Issue with spring when migrating from 7.0.50 to 7.0.52-53-54
Date Thu, 03 Jul 2014 15:36:23 GMT
These errors may happen when you have two libraries that both contain the
class javax.persistence.spi.PersistenceProvider
search the libraries (*.jar) in both tomcat and your WAR file, and see if
there are multiple instances of the above named class


On Thu, Jul 3, 2014 at 9:28 AM, Xavier Outhier <xouthier@yahoo.fr> wrote:

> Hi,
>
> we have an application that is running under Tomcat. We are trying to
> upgrade to latest version 7.0.54 from 7.0.39.
> As 7.0.54 lead to some errors, we tried to find out which version broke
> the application. The result is that the issue appears with 7.0.52 and is
> not present until 7.0.50.
>
> The exception that we can see is:
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name
> 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0'
> defined in file [xyz]: Initialization of bean failed; nested exception is
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name 'entityManagerFactory' defined in file [xyz]: Invocation of
> init method failed; nested exception is
> java.lang.IncompatibleClassChangeError: Class
> org.eclipse.persistence.jpa.PersistenceProvider does not implement the
> requested interface javax.persistence.spi.PersistenceProvider
>     at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
>     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:194)
>     at
> org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:710)
>     at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:410)
>     at
> org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
>     at
> org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
>     at
> org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
>     at xyz(xyz1.java:41)
>     at xyz (xyz2.java:94)
>     at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
>     at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>     at java.lang.Thread.run(Unknown Source)
> Caused by: org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'entityManagerFactory' defined in file [xyz]:
> Invocation of init method failed; nested exception is
> java.lang.IncompatibleClassChangeError: Class
> org.eclipse.persistence.jpa.PersistenceProvider does not implement the
> requested interface javax.persistence.spi.PersistenceProvider
>     at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
>     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:194)
>     at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:398)
>     at
> org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:275)
>     at
> org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.detectPersistenceExceptionTranslators(PersistenceExceptionTranslationInterceptor.java:139)
>     at
> org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.<init>(PersistenceExceptionTranslationInterceptor.java:79)
>     at
> org.springframework.dao.annotation.PersistenceExceptionTranslationAdvisor.<init>(PersistenceExceptionTranslationAdvisor.java:70)
>     at
> org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor.setBeanFactory(PersistenceExceptionTranslationPostProcessor.java:99)
>     at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeAwareMethods(AbstractAutowireCapableBeanFactory.java:1439)
>     at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1408)
>     at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
>     ... 15 more
> Caused by: java.lang.IncompatibleClassChangeError: Class
> org.eclipse.persistence.jpa.PersistenceProvider does not implement the
> requested interface javax.persistence.spi.PersistenceProvider
>     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:1477)
>     at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
>     ... 30 more
>
> and the bean entityManagerFactory is defined like this:
>
>     <bean id="entityManagerFactory"
> class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
>         <property name="persistenceUnitName" value="xyz" />
>         <property name="dataSource" ref="dataSource" />
>         <property name="jpaDialect">
>             <bean
> class="org.springframework.orm.jpa.vendor.EclipseLinkJpaDialect"/>
>         </property>
>         <property name="jpaVendorAdapter" ref="jpaVendorAdapter"/>
>         <property name="jpaProperties">
>             <props>
>                 <prop key="eclipselink.ddl-generation">none</prop>
>                 <prop
> key="eclipselink.ddl-generation.output-mode">database</prop>
>                 <prop
> key="eclipselink.create-ddl-jdbc-file-name">xyz.sql</prop>
>                 <prop
> key="eclipselink.application-location">c:\temp\</prop>
>                 <prop key="eclipselink.profiler">NoProfiler</prop>
>                 <prop key="eclipselink.logging.level">OFF</prop>
>                 <prop key="eclipselink.jdbc.batch-writing">JDBC</prop>
>                 <prop key="eclipselink.cache.shared.default">true</prop>
>                 <prop key="eclipselink.logging.logger">xyz</prop>
>                 <prop key="javax.persistence.query.timeout">300</prop>
>             </props>
>         </property>
>     </bean>
>
>
> Any clue on this?
>
> Thanks,
>
> Xavier.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message