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/

Reply via email to