Hi,
I am having problems getting a feature working with the TransactionControl
Service under Karaf. The error msg suggests that the service is missing or not
active, but I am at a loss of why.
This is the error:
[caused by: Unable to resolve
com.my.persistence.repositories/1.0.0.SNAPSHOT_20161227-1454: missing
requirement [com.my.persistence.repositories/1.0.0.SNAPSHOT_20161227-1454]
osgi.service;
filter:="(objectClass=org.osgi.service.transaction.control.TransactionControl)";
effective:=active]]
I have a DSF:
[org.osgi.service.jdbc.DataSourceFactory]
-----------------------------------------
osgi.jdbc.driver.class = com.mysql.jdbc.Driver
osgi.jdbc.driver.name = mysql
service.id = 255
service.bundleid = 162
service.scope = singleton
Provided by :
OPS4J Pax JDBC MySQL Driver Adapter (162)
Used by:
OSGi Transaction Control JPA Resource Provider - Local Transactions (114)
I have a TransactionControl service:
[org.osgi.service.transaction.control.TransactionControl]
---------------------------------------------------------
service.vendor = Apache Aries
service.description = The Apache Aries Transaction Control Service for Local
Transactions
osgi.local.enabled = true
service.id = 206
service.bundleid = 113
service.scope = singleton
Provided by :
OSGi Transaction Control Service - Local Transactions (113)
TransactionControl bundles appear to be running correctly:
OSGi Transaction Control Service - Local Transactions (113) provides:
---------------------------------------------------------------------
[org.osgi.service.transaction.control.TransactionControl]
OSGi Transaction Control JPA Resource Provider - Local Transactions (114) uses:
-------------------------------------------------------------------------------
[javax.persistence.spi.PersistenceProvider]
[org.osgi.service.jpa.EntityManagerFactoryBuilder]
[org.osgi.service.jdbc.DataSourceFactory]
OSGi Transaction Control JPA Resource Provider - Local Transactions (114)
provides:
-----------------------------------------------------------------------------------
osgi.local.enabled = true
objectClass =
[org.osgi.service.transaction.control.jpa.JPAEntityManagerProviderFactory]
service.id = 207
service.bundleid = 114
service.scope = bundle
----
service.pid = org.apache.aries.tx.control.jpa.local
objectClass = [org.osgi.service.cm.ManagedServiceFactory]
service.id = 209
service.bundleid = 114
service.scope = singleton
----
service.pid =
org.apache.aries.tx.control.jpa.local.adaeed20-19cf-4dff-9276-0afc20052ecc
user = db_user
url = jdbc:mysql://localhost:3306/my_db
service.factoryPid = org.apache.aries.tx.control.jpa.local
osgi.unit.name = my.pu
osgi.jdbc.driver.class = com.mysql.jdbc.Driver
felix.fileinstall.filename =
file:<…>/apache-karaf-4.0.7/etc/org.apache.aries.tx.control.jpa.local-.cfg
databaseName = my_db
objectClass =
[org.osgi.service.transaction.control.jpa.JPAEntityManagerProvider]
service.id = 256
service.bundleid = 114
service.scope = singleton
FWIW, transactionControl resolves just fine in a ‘stand-alone’ equinox
framework:
g! bundle 89
com.my.persistence.repositories_1.0.0.SNAPSHOT_20161227-1454 [89]
...
Services in use:
...
{org.osgi.service.transaction.control.TransactionControl}={service.vendor=Apache
Aries, service.description=The Apache Aries Transaction Control Service for
Local Transactions, osgi.local.enabled=true, service.id=70,
service.bundleid=51, service.scope=singleton}
Does anyone have a suggestion as of what I am missing?
Thanks and a Happy new Year,
Erwin