Hi Tim,

If you talk about just JPA, using the right import package should work.

However, if you use Aries JPA, it could be tricky as the EntityManager
service can use a different version than yours.

Are you just using JPA API or also the JPA feature ?

Regards
JB

On 26/12/2019 15:42, tvogel wrote:
> I am successfully running multiple bundles, that provide classes with the
> same name but different versions.
> 
> However when I try to do this with classes that provide JPA managed classes,
> I am getting class cast exceptions (java.lang.ClassCastException:
> some.package.ManagedClass cannot be cast to some.package.ManagedClass).
> 
> My changes to run multiple versions of JPA managed classes so far are:
> 1) update the version of the jar that provides these classes (3.2.1 ->
> 4.0.0)
> 2) ensure it uses the 4.0.0 version of supporting jars by using
> Import-Package in pom
> 3) change the persistence.xml to have a different persistence-unit name
> (pu_mysource3 -> pu_mysource4). 
>  This file has <exclude-unlisted-classes>true</exclude-unlisted-classes>
> 
> Any suggestions on additional configuration changes necessary to run
> multiple versions of JPA classes?
> 
> Thanks,
> Timothy
> 
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> 

-- 
Jean-Baptiste Onofré
jbono...@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Reply via email to