Component is in satisfied state but not in active state in OSGI console | Community
Skip to main content
New Participant
September 7, 2016
Solved

Component is in satisfied state but not in active state in OSGI console

  • September 7, 2016
  • 5 replies
  • 11320 views

I a trying to connect to a Oracle DB using java code in an AEM application. For that I have configured everything in connections pool in OSGI console and I am trying to get the appropriate data soure using java code. Below are the details:

package com.pnc.main.businessddaapp.dao.datasource.impl;

 

import javax.sql.DataSource;

import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.day.commons.datasource.poolservice.DataSourceNotFoundException;
import com.day.commons.datasource.poolservice.DataSourcePool;
import com.xxx.businessddaapp.dao.datasource.BusinessDDAApplicationDataSource;

@Component(metatype = true)

@Service

public class BusinessDDAApplicationDataSourceImpl implements  BusinessDDAApplicationDataSource {

    
    protected final Logger logger = LoggerFactory.getLogger(this.getClass());
    
    private static final String DEFAULT_BUSINESSDDA_INTEGRATION_DATASOURCE = "KIDS";


    @Reference
    private DataSourcePool source;
    
    @Override
    public DataSource getDataSource() {
        
        DataSource dataSource = null;
        
        try {
            dataSource = (DataSource) source.getDataSource(DEFAULT_BUSINESSDDA_INTEGRATION_DATASOURCE);
            return dataSource;
        } catch (DataSourceNotFoundException e) {
            logger.error("Datasource not configured/not found", e);
        } catch (Exception e) {
            logger.error("Exception while getting the datasource ", e);
        }
        return null;
        
    }

    
}

 

But for some reason, when I check the OSGI console(http://localhost:4503/system/console/components) this class/component is in satisfied state and thus its not getting called while running the application. What changes do I need to make in order to make this component active ? Do I need to add any other configurations ?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

Watch the HELPX video where we step through all of the steps: 

https://youtu.be/yYo1epoZp_4

As you can see in this video - when we create the OSGi bundle using Maven and add the Database driver file - it works... 

5 replies

sdk60873563
New Participant
February 8, 2019
smacdonald2008
smacdonald2008Accepted solution
New Participant
September 9, 2016

Watch the HELPX video where we step through all of the steps: 

https://youtu.be/yYo1epoZp_4

As you can see in this video - when we create the OSGi bundle using Maven and add the Database driver file - it works... 

New Participant
September 9, 2016

Hi,

Add @ Activate and @Deactivate methods it will become active inplace of satisfied..

Hope that helps.

kautuk_sahni
Employee
September 8, 2016

Working example of DataSourcePool with MySql is :- https://helpx.adobe.com/experience-manager/using/datasourcepool.html

You could use it as a reference.

~kautuk

Kautuk Sahni
kautuk_sahni
Employee
September 8, 2016

Hi 

Satisfied is a state of a bundle where all the dependencies of that bundle is reachable or available but it doesn't depict the life cycle of a bundle.

Please have a look at this excellent community article:- 

Link:- http://blog.christianposta.com/osgi/understanding-how-osgi-bundles-get-resolved-part-i/

// Understanding how OSGI bundles get resolved

 

Old Forum post:- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.html/forum__ixok-i_want_to_knowthed.html

I hope this would help you.

 

~kautuk

Kautuk Sahni