ScrService component remains unsatisfied in AEM 6.2, but was working fine with AEM 6.0 | Community
Skip to main content
Level 2
Jun 26, 2017 8:00 PM UTC
Solved

ScrService component remains unsatisfied in AEM 6.2, but was working fine with AEM 6.0

We are using scr service to get component based on name and added a feature to enable/disable them. This feature is working fine on AEM 6.0 environment. But scr service component always remains unsatisfied on AEM 6.2 (Java 1.8)

Below are the configuration that we are currently using:

POM.xml dependencies:

<dependency>

        <groupId>org.apache.felix</groupId>

        <artifactId>org.apache.felix.scr.annotations</artifactId>

        <version>1.9.12</version>

        <scope>provided</scope>

</dependency>

<dependency>

        <groupId>org.apache.felix</groupId>

        <artifactId>org.apache.felix.scr</artifactId>

        <version>1.6.0</version>

        <scope>provided</scope>

</dependency>

<plugin>

          <groupId>org.apache.felix</groupId>

          <artifactId>maven-scr-plugin</artifactId>

          <version>1.20.0</version>

</plugin>

<plugin>

          <groupId>org.apache.maven.plugins</groupId>

          <artifactId>maven-compiler-plugin</artifactId>

          <version>3.1</version>

          <configuration>

            <source>1.8</source>

            <target>1.8</target>

          </configuration>

</plugin>

Any help or suggestions appreciated.

Thanks in advance

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
navneetjainAccepted solution
Level 2
Jun 30, 2017 7:40 PM UTC

We got an alternate solution:

Using ServiceComponentRuntime Reference instead of ScrService to get the OSGi Component.

//Getting component by passing bundle object and component name

serviceComponentRuntime.getComponentDescriptionDTO(bundle, componentName);

//Enabling and disabling component

serviceComponentRuntime.enableComponent(component);

serviceComponentRuntime.disableComponent(component);

6 replies

navneetjainAuthorAccepted solution
Level 2
Jun 30, 2017 7:40 PM UTC

We got an alternate solution:

Using ServiceComponentRuntime Reference instead of ScrService to get the OSGi Component.

//Getting component by passing bundle object and component name

serviceComponentRuntime.getComponentDescriptionDTO(bundle, componentName);

//Enabling and disabling component

serviceComponentRuntime.enableComponent(component);

serviceComponentRuntime.disableComponent(component);

Translate
Level 3
Jun 27, 2017 8:22 PM UTC

Can you try searching for the artifactId in depfinder (host:port/system/console/depfinder). Is it showing the same version which you added in your pom.xml. Try removing the version and scope from your dependency entries. Some times it may solve. Is your corresponding bundle is active in host:port/system/console/bundles.

Translate
Level 2
Jun 27, 2017 3:34 PM UTC

Yes.

POM.xml:

  <dependency>

        <groupId>com.adobe.aem</groupId>

        <artifactId>uber-jar</artifactId>

        <version>6.2.0</version>

        <classifier>apis</classifier>

        <scope>provided</scope>

</dependency>

Translate
smacdonald2008
Level 10
Jun 27, 2017 3:22 PM UTC

Did you use AEM Uber 6.2 JAR?

Translate
Level 2
Jun 27, 2017 2:53 PM UTC

Hi,

PFB the Unsatisfied component:

Reference scrService["Unsatisfied","Service Name: org.apache.felix.scr.ScrService","Cardinality: 1..1","Policy: static","Policy Option: reluctant","No Services bound"]

error.log:

27.06.2017 10:43:01.711 *INFO* [127.0.0.1 [1498574581705] GET /services/test-services/configuration-components HTTP/1.1] org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Resource /services/test-services/configuration-components not found

Translate
MC_Stuff
Level 10
Jun 26, 2017 11:16 PM UTC

Hi Navneeth,

Can you attach the log files & snapshot of unsatisfied component screen?

Thanks,

Translate