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

getting NoSuchMethodError [SPR-12034] #16650

Closed
spring-projects-issues opened this issue Jul 26, 2014 · 1 comment
Closed

getting NoSuchMethodError [SPR-12034] #16650

spring-projects-issues opened this issue Jul 26, 2014 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: invalid An issue that we don't feel is valid

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jul 26, 2014

Shoeb Siddiqui opened SPR-12034 and commented

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [net/ibs/config/database.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getSharedCacheMode()Ljavax/persistence/SharedCacheMode;

pom.xml
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<version>1.0.0.Final</version>
</dependency>
xml
<bean class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" id="entityManagerFactory">
<property name="persistenceUnitName" value="persistenceUnit"/>
<property name="dataSource" ref="dataSource"/>
</bean>


Affects: 4.0.6

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jul 26, 2014

Juergen Hoeller commented

This looks like you have a JPA 1.0 API jar on the classpath too, getting picked up before your explicitly declared JPA 2.0 API jar. That JPA 1.0 jar probably comes in transitively through your persistence provider, e.g. an old Hibernate version... Note that you have to use Hibernate 3.6 or higher as of Spring 4.0.

Juergen

@spring-projects-issues spring-projects-issues added type: bug A general bug status: invalid An issue that we don't feel is valid in: core Issues in core modules (aop, beans, core, context, expression) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues removed the type: bug A general bug label Jan 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

2 participants