Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

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

navneetjain
Level 2
Level 2

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

1 Accepted Solution
navneetjain
Correct answer by
Level 2
Level 2

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);

View solution in original post

6 Replies
MC_Stuff
Level 9
Level 9

Hi Navneeth,

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

Thanks,

navneetjain
Level 2
Level 2

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

navneetjain
Level 2
Level 2

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>

Eakambaram
Level 3
Level 3

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.

navneetjain
Correct answer by
Level 2
Level 2

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);

View solution in original post