Re: Issue with spring when migrating from 7.0.50 to 7.0.52-53-54
Hi Filip, thanks for the tip. It was effectively a duplicated jar in the war and in the common lib of tomcat: it was jpa.jar. :) What I do not understand is how the same jar can cause an issue, especially when it was working fine with previous version of Tomcat. There must be something that has been changed between 7.0.50 and 7.0.52. %| Thanks, Xavier. On Thursday, July 3, 2014 5:36 PM, Filip Hanik fi...@hanik.com wrote: 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 xouth...@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
Re: Issue with spring when migrating from 7.0.50 to 7.0.52-53-54
Thank you Konstantin for pointing this out. This was not visible in the Release Notes nor on the migration page Apache Tomcat - Migration Guide - Tomcat 7.0.x (see at the end for migration from 7.0.x to 7.0.y). Anyway I'm still confused that the same library loaded twice could cause such an issue. Thanks, Xavier. Apache Tomcat - Migration Guide - Tomcat 7.0.x Select a configuration file, old version and new version from the boxes below and then click View differences to see the differences. The differences will be shown in a new tab/window. View on tomcat.apache.org Preview by Yahoo On Tuesday, July 8, 2014 10:09 AM, Konstantin Kolinko knst.koli...@gmail.com wrote: 2014-07-08 11:27 GMT+04:00 Xavier Outhier xouth...@yahoo.fr: Hi Filip, thanks for the tip. It was effectively a duplicated jar in the war and in the common lib of tomcat: it was jpa.jar. :) What I do not understand is how the same jar can cause an issue, especially when it was working fine with previous version of Tomcat. There must be something that has been changed between 7.0.50 and 7.0.52. %| There was a change in 7.0.52. Explained here: https://issues.apache.org/bugzilla/show_bug.cgi?id=55943#c13 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Issue with spring when migrating from 7.0.50 to 7.0.52-53-54
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