ScrService component remains unsatisfied in AEM 6.2, but was working fine with AEM 6.0 | Adobe Higher Education
Skip to main content
Level 2
June 26, 2017
Répondu

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

Ce sujet a été fermé aux réponses.
Meilleure réponse par navneetjain

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 commentaires

MC_Stuff
Level 10
June 26, 2017

Hi Navneeth,

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

Thanks,

Level 2
June 27, 2017

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

smacdonald2008
Level 10
June 27, 2017

Did you use AEM Uber 6.2 JAR?

Level 2
June 27, 2017

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>

Level 3
June 27, 2017

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.

navneetjainAuteurRéponse
Level 2
June 30, 2017

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