Hi David,
> My guess is that the bundle providing the TransactionControl service doesn’t
> say so by having a Provide-Capability header for it. For runtime resolution
> the effectice=active requirements don’t matter but for at last subsystem
> resolution they do.
Thanks for your reply. Looks like you are right. How do I get around that?
Thanks,
Erwin
These are the headers:
karaf@root>headers 113
OSGi Transaction Control Service - Local Transactions (113)
-----------------------------------------------------------
Archiver-Version = Plexus Archiver
Bnd-LastModified = 1476716796578
Build-Jdk = 1.8.0_25
Built-By = timothyjward
Created-By = 1.8.0_25 (Oracle Corporation)
Implementation-Title = OSGi Transaction Control Service - Local Transactions
Implementation-Vendor = The Apache Software Foundation
Implementation-Vendor-Id = org.apache.aries.tx-control
Implementation-Version = 0.0.2
Manifest-Version = 1.0
Specification-Title = OSGi Transaction Control Service - Local Transactions
Specification-Vendor = The Apache Software Foundation
Specification-Version = 0.0.2
Tool = Bnd-3.2.0.201605172007
Bundle-Activator = org.apache.aries.tx.control.service.local.impl.Activator
Bundle-ManifestVersion = 2
Bundle-Name = OSGi Transaction Control Service - Local Transactions
Bundle-SymbolicName = tx-control-service-local
Bundle-Version = 0.0.2
Require-Capability =
osgi.ee;filter:=(&(osgi.ee=JavaSE)(version=1.8))
Export-Package =
org.osgi.service.transaction.control;uses:=javax.transaction.xa;api.status=aries.prerelease;version=1.0.0
Import-Package =
org.osgi.service.transaction.control;version="[1.0,2)",
javax.transaction.xa,
org.osgi.framework;version="[1.7,2)",
org.slf4j;version="[1.7,2)"
Private-Package =
org.apache.aries.tx.control.service.common.impl,
org.apache.aries.tx.control.service.local.impl
>
>> On Dec 30, 2016, at 6:08 AM, Erwin Hogeweg <[email protected]
>> <mailto:[email protected]>> wrote:
>>
>> 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 <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
>>
>