Hi,

The XA support that you are trying to use was added in 
https://github.com/apache/aries/commit/6d1943b4d7c019968610256353abd36b34c54285 
and so isn’t part of the (rather elderly) 0.0.3 release that you are using. If 
you want working XA transactions with EclipseLink 2.6.0 then you will need to 
upgrade to 1.0.0, which is the reference implementation of the Transaction 
Control specification.

Note that this feature addition predates the move of Aries Transaction Control 
to its own Git repository - the current repository is visible at 
https://github.com/apache/aries-tx-control/ now. 

Tim

Best Regards,

Tim

Sent from my iPhone

> On 10 Feb 2019, at 11:42, cobusstroebel <co...@scss.co.za> wrote:
> 
> Hi Tim
> 
> Thanks for all your help.
> I changed my code to use the JPAEntityManagerProvider that is created when I
> drop in my configuration as explained by the "Creating a resource using a
> factory configuration" part here:
> http://aries.apache.org/modules/tx-control/xaJPA.html
> 
> [org.osgi.service.transaction.control.jpa.JPAEntityManagerProvider]
> -------------------------------------------------------------------
> databaseName = myexample
> felix.fileinstall.filename =
> file:/C:/Karaf/apache-karaf-4.0.3/etc/org.apache.aries.tx.control.jpa.xa-example.cfg
> osgi.jdbc.driver.class = com.mysql.jdbc.Driver
> osgi.unit.name = ExamplePU
> service.bundleid = 172
> service.factoryPid = org.apache.aries.tx.control.jpa.xa
> service.id = 205
> service.pid =
> org.apache.aries.tx.control.jpa.xa.de89ead7-a6c3-449a-8ccc-2c511368e0b4
> service.scope = singleton
> url = jdbc:mysql://localhost:3306/myexample
> user = whatever
> Provided by :
> OSGi Transaction Control JPA Resource Provider - XA Transactions (172)
> Used by:
> myexample OSGi Bundle (179)
> 
> However when I try to obtain an entity manager I now get this error:
> 
> Internal Exception: Exception [EclipseLink-28006] (Eclipse Persistence
> Services - 2.6.0.v20150309-bf26070):
> org.eclipse.persistence.exceptions.EntityManagerSetupException
> Exception Description: ClassNotFound:
> [org.apache.aries.tx.control.jpa.xa.plugin.eclipse.impl.EclipseTxControlPlatform]
> specified in [eclipselink.target-server] property.
> Internal Exception: java.lang.ClassNotFoundException:
> org.apache.aries.tx.control.jpa.xa.plugin.eclipse.impl.EclipseTxControlPlatform
> not found by org.eclipse.persistence.jpa [160]
>        at
> org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.createPredeployFailedPersistenceException(EntityManagerSetupImpl.java:2023)
>        at
> org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:2014)
>        at
> org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactoryImpl(PersistenceProvider.java:334)
>        at
> org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactory(PersistenceProvider.java:305)
>        at
> org.apache.aries.jpa.eclipselink.adapter.EclipseLinkProviderService$1.createContainerEntityManagerFactory(EclipseLinkProviderService.java:69)
>        at
> org.apache.aries.jpa.container.impl.AriesEntityManagerFactoryBuilder.createEntityManagerFactory(AriesEntityManagerFactoryBuilder.java:55)
>        at
> org.apache.aries.tx.control.jpa.xa.impl.JPAEntityManagerProviderFactoryImpl.internalBuilderCreate(JPAEntityManagerProviderFactoryImpl.java:88)[172:tx-control-provider-jpa-xa:0.0.3]
>        at
> org.apache.aries.tx.control.jpa.xa.impl.JPAEntityManagerProviderFactoryImpl.lambda$getProviderFor$1(JPAEntityManagerProviderFactoryImpl.java:69)[172:tx-control-provider-jpa-xa:0.0.3]
>        at
> org.apache.aries.tx.control.service.common.impl.AbstractTransactionControlImpl$TransactionBuilderImpl.doWork(AbstractTransactionControlImpl.java:161)[173:tx-control-service-xa:0.0.3]
>        ... 21 more
> 
> I can see the class is inside the tx-control-provider-jpa-xa bundle but it
> is not exported. Is there another bundle I can import to expose that class?
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Reply via email to