You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@deltaspike.apache.org by Charlie Mordant <cm...@gmail.com> on 2015/07/04 16:54:01 UTC

Deltaspike and classloader

Hi CDI addicts (like me ^^)!

I'm trying to use ds-data and JTA in an OSGI environment (Aries tx) (some
folks are crazy).

So I made an specific transaction strategy (using osgi service provided
usertransaction) and it works well using Pax-Jpa, DS-JPA and DS-tx
(whoowhoop!).

But it's looks like there a classloader issue when using ds-data:

Unable to find BeanManager. Please ensure that you configured the CDI
implementation of your choice properly.

at
org.apache.deltaspike.core.api.provider.BeanManagerProvider.getBeanManager(
BeanManagerProvider.java:242)

at org.apache.deltaspike.data.impl.meta.RepositoryComponent.lazyInit(
RepositoryComponent.java:82)


Also, it looks like Harald succeed to bridge them all but JTA.

​While debugging, I see the BM resolved twice (bmi.loadTimeBm), but not the
third time (exception).
I think that on of the ds module (proxy/partial bean/data/jpa) would need
an import package to my JTA implementation​ (in order to make classloader
delegation magic happen), or the inverse (my JTA strategy need an optional
import to one of the packages).

Does anyone can advise me (pointing me to some specific classes to search).

However, the OSGI-JTA bridge is totally ACL2 and you can integrate it into
DS (I would be happy to contribute).


Here are some sources if anyone is interested:

* The JTA bridge:
https://github.com/OsgiliathEnterprise/net.osgiliath.parent/tree/master/net.osgiliath.framework/net.osgiliath.helpers/net.osgiliath.helper.deltaspike.tx

* The according Karaf feature:
https://github.com/OsgiliathEnterprise/net.osgiliath.parent/tree/master/net.osgiliath.framework/net.osgiliath.features/net.osgiliath.feature.jpa

* The Integration test (marked as Ignored, just have to comment and clean
install to see the exception happen):
https://github.com/OsgiliathEnterprise/net.osgiliath.parent/tree/master/net.osgiliath.framework/net.osgiliath.features/net.osgiliath.feature.itests/net.osgiliath.feature.itest.jpa.cdi.daos

* The working DS-JPA and Transactional interceptor:
https://github.com/OsgiliathEnterprise/net.osgiliath.parent/tree/master/net.osgiliath.framework/net.osgiliath.features/net.osgiliath.feature.itests/net.osgiliath.feature.itest.jpa.pax

Best regards,

Charlie,


-- 
Charlie Mordant

Full OSGI/EE stack made with Karaf:
https://github.com/OsgiliathEnterprise/net.osgiliath.parent