datasources does not seem to be injected eargerly when invoked from a customer MBean

Solution Unverified - Updated -

Issue

  • There is an attachment, mbean.zip where a custom MBean operation is used to make a call to the DataSource which is exposed as a Service in blueprint context.
    Since the datasource is exposed as a service, the present understanding we have that the datasources are always loaded eagerly. Datasources are always loaded eagerly by blueprint configuration. All s are just instantiated by blueprint extender.

  • In the attachment, we are using the Local MySQL database, and the database are pre-created.
    The service is called with a custom JMX operation and Jolokia, Below are the results we see, when invoking with Jolokia or JMX, using the below URL or from the Hawtio console,

curl -u admin:admin http://localhost:8181/hawtio/jolokia/exec/com.redhat:name=DBService/loadData

  • Fuse 6.2.1,
13:11:16,660 | ERROR | qtp463177716-77  | container                        | 271 - org.apache.aries.jpa.container - 1.0.2 | The DataSource osgi:service/jdbc/TestDataSource required by bundle template-bundle/1.0.0.SNAPSHOT could not be found.

javax.naming.NoInitialContextException: Unable to find the InitialContextFactory org.eclipse.jetty.jndi.InitialContextFactory.

    at org.apache.aries.jndi.ContextHelper.getInitialContext(ContextHelper.java:150)

    at org.apache.aries.jndi.OSGiInitialContextFactoryBuilder.getInitialContext(OSGiInitialContextFactoryBuilder.java:5

  • Fuse 6.3 R5:
    Works without issues.

Since we are seeing this issue in Fuse 6.2.1, this makes the user believe that the datasources are not loaded eagerly.
Why are we seeing differences in the results for this ? Is this a bug ? The user cannot migrate to Fuse 6.3 and therefore, they need to check the issue on Fuse 6.2.1 itself.

Environment

  • Red Hat JBoss Fuse
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In