karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus von Rüden (JIRA) <j...@apache.org>
Subject [jira] [Created] (KARAF-6181) ManagedServiceFactory does not work reliably anymore
Date Tue, 05 Mar 2019 13:46:00 GMT
Markus von Rüden created KARAF-6181:

             Summary: ManagedServiceFactory does not work reliably anymore 
                 Key: KARAF-6181
                 URL: https://issues.apache.org/jira/browse/KARAF-6181
             Project: Karaf
          Issue Type: Bug
    Affects Versions: 4.2.3, 4.2.2
         Environment: Mac OS X, Apache Karaf 4.2.2/4.2.3, Java 8
            Reporter: Markus von Rüden

It seems that the *ManagedServiceFactory* in combination with *service.pid* does not work
reliably anymore with Apache Karaf 4.2.3.

*The Problem*

Registering a *ManagedServiceFactory* with a provided *service.pid* does no longer invoke
the "updated(...)" method ** even when it should. 

*How to Reproduce*

I created a simple example project, where a *ManagedServiceFactory* service is exposed with

The service simply prints out if a service with the pid managed by the factory was created/updated/deleted

In order to help narrowing down the problem, here is how to reproduce it
 * Checkout the [example repository|https://github.com/mvrueden/karaf-managed-service-factory-example]
 * Build the code with {{mvn clean install}}
 * Download latest Apache Karaf 4.2.3 Distribution from [here|http://www.apache.org/dyn/closer.lua/karaf/4.2.3/apache-karaf-4.2.3.tar.gz].
 * Extract the archive
 * Start the container {{./bin/karaf}}
 * Install {{aries-blueprint}}: {{feature:install aries-blueprint}}
 * Install the bundle: {{install -s mvn:org.opennms.dummy/managed-service-factory/1.0-SNAPSHOT}}
 * Verify via {{list}}
 * Now add some configuration files, e.g.

config:edit org.opennms.dummy.services-1
config:property-set key value

If you check the logs via {{log:tail}} you can see, that only some or none are actually printed.
In my case 2 of 5 were printed. However if I do a {{config:list}} all configs are listed,
but only a few (the printed ones) have a factoryPid.

karaf@root()> config:list "(service.pid=org.opennms*)"
Pid:            org.opennms.dummy.services-3
BundleLocation: null
   a = b
   felix.fileinstall.filename = file:/Users/mvrueden/Downloads/apache-karaf-4.2.3/etc/org.opennms.dummy.services-3.cfg
   service.pid = org.opennms.dummy.services-3
Pid:            org.opennms.dummy.services-asdf
BundleLocation: null
   a = b
   bla = bla
   felix.fileinstall.filename = file:/Users/mvrueden/Downloads/apache-karaf-4.2.3/etc/org.opennms.dummy.services-asdf.cfg
   service.pid = org.opennms.dummy.services-asdf
Pid:            org.opennms.dummy.services-xyz
BundleLocation: null
   felix.fileinstall.filename = file:/Users/mvrueden/Downloads/apache-karaf-4.2.3/etc/org.opennms.dummy.services-xyz.cfg
   service.pid = org.opennms.dummy.services-xyz
Pid:            org.opennms.dummy.services.30b34eda-96f1-4bd1-9e6e-396e3af9cd84
FactoryPid:     org.opennms.dummy.services
BundleLocation: ?
   felix.fileinstall.filename = file:/Users/mvrueden/Downloads/apache-karaf-4.2.3/etc/org.opennms.dummy.services-2.cfg
   service.factoryPid = org.opennms.dummy.services
   service.pid = org.opennms.dummy.services.30b34eda-96f1-4bd1-9e6e-396e3af9cd84
Pid:            org.opennms.dummy.services.e670d214-5eba-4086-9129-f79918542f8c
FactoryPid:     org.opennms.dummy.services
BundleLocation: ?
   felix.fileinstall.filename = file:/Users/mvrueden/Downloads/apache-karaf-4.2.3/etc/org.opennms.dummy.services-1.cfg
   service.factoryPid = org.opennms.dummy.services
   service.pid = org.opennms.dummy.services.e670d214-5eba-4086-9129-f79918542f8c
   x = z

Restarting the container also did not work.
However, uninstalling the bundle and re-installing it, will work.

I was able to confirm this for 4.2.2 as well. In 4.1.5 it still works as expected.

Please let me know if there is anything I can do to help resolving this.

This message was sent by Atlassian JIRA

View raw message