A bit from memory so can miss a few details but think adding openjpa with jakarta classifier as a dependency of the plugin does the trick.
Romain Manni-Bucau @rmannibucau <https://twitter.com/rmannibucau> | Blog <https://rmannibucau.metawerx.net/> | Old Blog <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> | LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book <https://www.packtpub.com/application-development/java-ee-8-high-performance> Le mer. 28 déc. 2022 à 10:40, Francesco Chicchiriccò <ilgro...@apache.org> a écrit : > Thank you. > > FTR this is my current setup: > > root pom.xml: > > <dependency> > <groupId>org.apache.openjpa</groupId> > <artifactId>openjpa</artifactId> > <version>${openjpa.version}</version> > <classifier>jakarta</classifier> > <exclusions> > <exclusion> > <groupId>org.apache.xbean</groupId> > <artifactId>xbean-asm9-shaded</artifactId> > </exclusion> > <exclusion> > <groupId>org.apache.commons</groupId> > <artifactId>commons-pool2</artifactId> > </exclusion> > <exclusion> > <groupId>org.apache.geronimo.specs</groupId> > <artifactId>geronimo-jpa_2.2_spec</artifactId> > </exclusion> > <exclusion> > <groupId>org.apache.geronimo.specs</groupId> > <artifactId>geronimo-jta_1.1_spec</artifactId> > </exclusion> > <exclusion> > <groupId>org.apache.geronimo.specs</groupId> > <artifactId>geronimo-jms_1.1_spec</artifactId> > </exclusion> > </exclusions> > </dependency> > > core/persistence-jpa/pom.xml: > > <dependency> > <groupId>jakarta.persistence</groupId> > <artifactId>jakarta.persistence-api</artifactId> > </dependency> > <dependency> > <groupId>jakarta.transaction</groupId> > <artifactId>jakarta.transaction-api</artifactId> > </dependency> > <dependency> > <groupId>org.apache.openjpa</groupId> > <artifactId>openjpa</artifactId> > <classifier>jakarta</classifier> > </dependency> > > I am having issues now with entity enhancement. > > I see log messages like as > > [BuilderThread 0] openjpa.Tool - Enhancer running on type "class > org.apache.syncope.core.persistence.jpa.entity.group.JPAGPlainAttr". > > but afterwards: > > [BuilderThread 0] openjpa.Tool - No metadata was found for 134 classes; > they have been enhanced as persistence-aware. If you intended for any of > these classes to be persistence-capable, then this means that OpenJPA could > not find any metadata for those classes. > > I guess this is because of the namespace mismatch between > openjpa-maven-plugin and the openjpa dependency as declared above. > > Regards. > > On 28/12/22 08:52, Romain Manni-Bucau wrote: > > Use > > > https://repo.maven.apache.org/maven2/org/apache/openjpa/openjpa/3.2.2/openjpa-3.2.2-jakarta.jar > > and exclude transitive deps. > > > > Le mer. 28 déc. 2022 à 08:45, Francesco Chicchiriccò < > ilgro...@apache.org> > > a écrit : > > > >> On 27/12/22 17:14, Romain Manni-Bucau wrote: > >>> Yes, think you should either move to openjpa-all shade or generate the > >>> class with asm at build time (guess switching the main dep is easier). > >> Unfortunately just switching to openjpa-all does not change the errors I > >> am reporting below. > >> > >> When I look inside > >> > >> > >> > https://repo1.maven.org/maven2/org/apache/openjpa/openjpa-all/3.2.2/openjpa-all-3.2.2.jar > >> > >> what should I be able to see exactly? e.g. what would be the effect of > the > >> relocation settings in > >> > >> https://github.com/apache/openjpa/blob/master/openjpa/pom.xml#L100 > >> > >> ? > >> > >> In case this option is not viable: would you be able to suggest how to > >> proceed with asm-based alternative you are mentioning above? > >> TIA. > >> > >> Regards. > >> > >>> Le mar. 27 déc. 2022 à 17:06, Maxim Solodovnik <solomax...@gmail.com> > a > >>> écrit : > >>> > >>>> Sorry fir top-posting > >>>> > >>>> Maybe we shall release Jakarta version? > >>>> As 4.x for ex? > >>>> > >>>> from mobile (sorry for typos ;) > >>>> > >>>> > >>>> On Tue, Dec 27, 2022, 23:01 Francesco Chicchiriccò < > ilgro...@apache.org > >>>> wrote: > >>>> > >>>>> On 27/12/22 16:50, Romain Manni-Bucau wrote: > >>>>>> Hi, > >>>>>> > >>>>>> Well I guess the jakarta shade should handle jakarta properly else > >> user > >>>>> can > >>>>>> use what he wants and finally worse case you can still integrate the > >>>>>> mapping in spring glue code (not sure you have something particular > in > >>>>> mind > >>>>>> so shouting in the wind ;)). > >>>>> For instance, I would like to keep these classes [1] working, but > when > >> I > >>>>> attempt to build it, I am receiving the following errors: > >>>>> > >>>>> [ERROR] > >>>>> > >> > /home/ilgrosso/work/syncope/fork/core/persistence-jpa/src/main/java/org/springframework/orm/jpa/vendor/OpenJpaDialect.java:[56,55] > >>>>> cannot access javax.persistence.EntityTransaction > >>>>> [ERROR] class file for javax.persistence.EntityTransaction not > found > >>>>> [ERROR] > >>>>> > >> > /home/ilgrosso/work/syncope/fork/core/persistence-jpa/src/main/java/org/springframework/orm/jpa/vendor/OpenJpaDialect.java:[89,34] > >>>>> no suitable method found for cast(jakarta.persistence.EntityManager) > >>>>> [ERROR] method > >>>>> > >> > org.apache.openjpa.persistence.OpenJPAPersistence.cast(javax.persistence.EntityManagerFactory) > >>>>> is not applicable > >>>>> [ERROR] (argument mismatch; jakarta.persistence.EntityManager > >>>> cannot > >>>>> be converted to javax.persistence.EntityManagerFactory) > >>>>> [ERROR] method > >>>>> > >> > org.apache.openjpa.persistence.OpenJPAPersistence.cast(javax.persistence.EntityManager) > >>>>> is not applicable > >>>>> [ERROR] (argument mismatch; jakarta.persistence.EntityManager > >>>> cannot > >>>>> be converted to javax.persistence.EntityManager) > >>>>> [ERROR] method > >>>>> > >> > org.apache.openjpa.persistence.OpenJPAPersistence.cast(javax.persistence.Query) > >>>>> is not applicable > >>>>> [ERROR] (argument mismatch; jakarta.persistence.EntityManager > >>>> cannot > >>>>> be converted to javax.persistence.Query) > >>>>> [ERROR] > >>>>> > >> > /home/ilgrosso/work/syncope/fork/core/persistence-jpa/src/main/java/org/springframework/orm/jpa/vendor/OpenJpaVendorAdapter.java:[46,61] > >>>>> cannot access javax.persistence.spi.PersistenceProvider > >>>>> [ERROR] class file for javax.persistence.spi.PersistenceProvider > not > >>>>> found > >>>>> [ERROR] > >>>>> > >> > /home/ilgrosso/work/syncope/fork/core/persistence-jpa/src/main/java/org/springframework/orm/jpa/vendor/OpenJpaVendorAdapter.java:[122,46] > >>>>> incompatible types: > >>>>> > >> > java.lang.Class<org.apache.openjpa.persistence.OpenJPAEntityManagerFactorySPI> > >>>>> cannot be converted to java.lang.Class<? extends > >>>>> jakarta.persistence.EntityManagerFactory> > >>>>> [ERROR] > >>>>> > >> > /home/ilgrosso/work/syncope/fork/core/persistence-jpa/src/main/java/org/springframework/orm/jpa/vendor/OpenJpaVendorAdapter.java:[127,39] > >>>>> incompatible types: > >>>>> > java.lang.Class<org.apache.openjpa.persistence.OpenJPAEntityManagerSPI> > >>>>> cannot be converted to java.lang.Class<? extends > >>>>> jakarta.persistence.EntityManager> > >>>>> > >>>>> Given Maxim's and yours answer about openjpa-all, I believe I'll need > >> to > >>>>> either depend on that or shade OpenJPA artifacts right on Syncope > poms: > >>>>> correct? > >>>>> > >>>>> Regards. > >>>>> > >>>>> [1] > >>>>> > >> > https://github.com/apache/syncope/blob/master/core/persistence-jpa/src/main/java/org/springframework/orm/jpa/vendor > >>>>>> Le mar. 27 déc. 2022 à 16:21, Francesco Chicchiriccò < > >>>>> ilgro...@apache.org> > >>>>>> a écrit : > >>>>>> > >>>>>>> Hi all, > >>>>>>> so let's suppone one has the weird idea of adding OpenJPA to a > Spring > >>>>> Boot > >>>>>>> 3 project. > >>>>>>> > >>>>>>> Do we already an idea about how to handle the javax.persistence.* > Vs > >>>>>>> jakarta.persistence.* conflicts? > >>>>>>> > >>>>>>> Thanks in advance. > >>>>>>> Regards. > > -- > Francesco Chicchiriccò > > Tirasa - Open Source Excellence > http://www.tirasa.net/ > > Member at The Apache Software Foundation > Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail > http://home.apache.org/~ilgrosso/ > >