Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Petclinic startup error when using OpenJPA and Tomcat 6- w/solution [SPR-6880] #11546

Closed
spring-projects-issues opened this issue Feb 20, 2010 · 1 comment
Labels
status: declined A suggestion or change that we don't feel we should currently apply

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Feb 20, 2010

Brad Armstrong opened SPR-6880 and commented

When starting up the Petclinic example on Tomcat 6.x using the OpenJPA provider this error is encountered.

ERROR [org.springframework.web.context.ContextLoader] - <Context initialization failed>
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0' defined in ServletContext resource [/WEB-INF/spring/applicationContext-jpa.xml]:
Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/spring/applicationContext-jpa.xml]: Invocation of init method failed;
nested exception is java.lang.NoClassDefFoundError: javax/transaction/Synchronization
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:671)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:401)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:261)

The issue is with the pom.xml configuration.
By default the javax.transaction dependency is configured to only be available in the test scope. But when using OpenJPA, this is actually needed at runtime.

So the dependency should be configured as:

<dependency>
<groupId>javax.transaction</groupId>
<artifactId>com.springsource.javax.transaction</artifactId>
<version>1.1.0</version>
</dependency>


Affects: 3.0 GA

Reference URL: http://forum.springsource.org/showthread.php?t=85042

Issue Links:

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented May 15, 2014

Brian Clozel commented

Spring guides and Sagan are now replacing Petclinic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined A suggestion or change that we don't feel we should currently apply
Projects
None yet
Development

No branches or pull requests

1 participant