OSGi managed service factory does not create instance on container start

Solution Verified - Updated -

Issue

An application uses managed OSGi services, defined in a Blueprint XML file like this:

<cm:managed-service-factory id="testfactory" factory-pid="testfactory" interface="org.acme..FactoryTest" auto-export="all-classes">
        <cm:managed-component class="org.acme.FactoryTest" init-method="init">
            <cm:managed-properties persistent-id="" update-strategy="component-managed" update-method="update"/>
        </cm:managed-component>
</cm:managed-service-factory>

The factory is associated with configuration files in $FUSE_HOME/etc directory of the form testfactory-xxx.cfg.

In Fuse 6.2, when the application is first deployed, an instance of the service is seen to be created, as would be expected. However, no such instance is created when Fuse is started thereafter. The instance is only created when one of the configuration files supplies a changed property.

This behaviour is different to that seen in Fuse 6.0 and 6.1, where an instance of the service was created – provided the configuration file exists – at start-up. There seems to be no way in Fuse 6.2 to get the managed instances created except by explicitly updating the configuration file(s) when the container is running.

Environment

  • Red Hat JBoss Fuse
    • 6.2.0 GA

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content