コミュニティアチーブメントバーを展開する。

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

この会話は、活動がないためロックされています。新しい投稿を作成してください。

解決済み

org.apache.felix.scr dependency in AEM 6.2 / 6.3

Avatar

Level 5

I noticed that org.apache.felix.scr is exported by one of the bundles in AEM
6.0 but not in AEM 6.3. There seems to be a bundle by name of org.apache.felix.scr in 6.3 also but it doesn't export the same package.

Is this expected? Or this is a bug with my copy of 6.3?

Should the org.apache.felix.scr jar be installed as an external dependency in 6.3 if it's being used by any custom bundle?

1 受け入れられたソリューション

Avatar

正解者
Community Advisor

Hi,

Apologies re-looked at your question, have a look at:ServiceComponentRuntime (http://javadox.com/org.osgi/osgi.cmpn/6.0.0/org/osgi/service/component/runtime/ServiceComponentRunti... )

It can do following things:

final Collection<ComponentDescriptionDTO> descs = scrService.getComponentDescriptionDTOs(bundle);

for(final ComponentDescriptionDTO d : descs)

{

   if ( !scrService.isComponentEnabled(d))

  {

  disabled.add(d);

  }

   else
   {

   final Collection<ComponentConfigurationDTO> configs = scrService.getComponentConfigurationDTOs(d);

   if ( configs.isEmpty() )

  {

  disabled.add(d);

  }

   else
   {

  configurations.addAll(configs);

  }

  }

}

org/apache/felix/webconsole/plugins/ds/internal/InfoProvider.java:89

Regards,

Peter

元の投稿で解決策を見る

7 返信

Avatar

Level 5

Hello..any help on this?

Avatar

Community Advisor

Hey Jake,

Happy New Year!

For 6.3 you should be moving to the OSGi Service annotations.

Official OSGi Declarative Services Annotations in AEM - Adobe Experience Manager | AEM/CQ | Apache S...

SCR is still there, but it's merely used for bundles that are not yet migrated to the OSGi annotations for your own code OSGi annotations should be the way forward.

Thanks,

Peter

Avatar

Level 5

Thanks Peter.

I wasn't talking about the annotations but classes like org.apache.felix.scr.ScrService and org.apache.felix.scr.Component which do not appear to be present in 6.2 and 6.3 in the org.apache.felix.scr bundle.

Any way around this?

I'm using these classes to get the state of a Component (active / inactive).

Avatar

正解者
Community Advisor

Hi,

Apologies re-looked at your question, have a look at:ServiceComponentRuntime (http://javadox.com/org.osgi/osgi.cmpn/6.0.0/org/osgi/service/component/runtime/ServiceComponentRunti... )

It can do following things:

final Collection<ComponentDescriptionDTO> descs = scrService.getComponentDescriptionDTOs(bundle);

for(final ComponentDescriptionDTO d : descs)

{

   if ( !scrService.isComponentEnabled(d))

  {

  disabled.add(d);

  }

   else
   {

   final Collection<ComponentConfigurationDTO> configs = scrService.getComponentConfigurationDTOs(d);

   if ( configs.isEmpty() )

  {

  disabled.add(d);

  }

   else
   {

  configurations.addAll(configs);

  }

  }

}

org/apache/felix/webconsole/plugins/ds/internal/InfoProvider.java:89

Regards,

Peter

Avatar

Community Advisor

Avatar

Level 10

Thank you for posting a detail response Peter!

Avatar

Level 5

This is really great. Thanks a lot.