Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » class not found issues migrating to 3.0.2(java.lang.NoClassDefFoundError: jakarta/persistence/spi/PersistenceProvider when creating the jpa provider)
class not found issues migrating to 3.0.2 [message #1848434] Thu, 02 December 2021 01:48 Go to next message
Phil Scadden is currently offline Phil ScaddenFriend
Messages: 12
Registered: July 2010
Junior Member
Move to JDK11 also results in going to eclipselink 3.
App is tomcat 9, Spring-JPA (not spring boot).


in the setup, I have:
    public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
        LocalContainerEntityManagerFactoryBean emfb = new LocalContainerEntityManagerFactoryBean();
        JpaVendorAdapter jva  = createJpaVendorAdapter();
        return emfb;

    protected AbstractJpaVendorAdapter createJpaVendorAdapter() {
        EclipseLinkJpaVendorAdapter eclipseLinkJpaVendorAdapter  = new EclipseLinkJpaVendorAdapter();
        return eclipseLinkJpaVendorAdapter;

It dies at new EclipseLinkJpaVendorAdaptor()
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean]: Factory method 'entityManagerFactory' threw exception; nested exception is java.lang.NoClassDefFoundError: jakarta/persistence/spi/PersistenceProvider
... 59 more
Caused by: java.lang.NoClassDefFoundError: jakarta/persistence/spi/PersistenceProvider

But if I look at the dependencies, I see jakarta/persistence/spi/PersistenceProvider
right there in the jakarta.persistance-api.jar

Dont have issue if I use hibernate latest instead, but that involves going places that Eclipselink does best.

Re: class not found issues migrating to 3.0.2 [message #1848436 is a reply to message #1848434] Thu, 02 December 2021 07:16 Go to previous message
Radek Felcman is currently offline Radek FelcmanFriend
Messages: 16
Registered: March 2021
Junior Member
Please use
as a dependency. 3.x version keeps JPA classes in jakarta.* package.
Mentioned JPA version 2.2.3 (2.x) using javax.* package.
3.x persistence-api + 3.x EclipseLink = jakarta.* package
2.x persistence-api + 2.x EclipseLink = javax.* package
Previous Topic:EclipseLink 2.7.x OneToMany relation and composite id
Next Topic:P2 Repository for Eclipselink 3.0.2
Goto Forum:

Current Time: Mon Dec 11 22:34:22 GMT 2023

Powered by FUDForum. Page generated in 0.01857 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top