AEM ENGINEERING / 002

Why Is My OSGi Component Unsatisfied?

Diagnose unsatisfied OSGi components in AEM with a runnable Felix example: inspect reference filters, reproduce a mismatch, fix it and verify recovery.

SHARE
LinkedIn X Facebook Threads

Topic map

From descriptor to activation

Diagnosing unsatisfied OSGi components in AEM

  1. 01Bundle
  2. 02Descriptor
  3. 03Config
  4. 04References
  5. 05Activation

SYSTEM OVERVIEW

SYSTEM / FLOW

A component depends on contracts, not just installed code.

Conceptual dependency paths for a DS component. Satisfaction and activation are separate: a delayed component can be satisfied before it is activated.

CONFIGURATION REQUIREMENTConfigurationpolicyMatching PID /factory PIDUsable propertiesSERVICE REQUIREMENTProvider bundleRegisteredinterfaceTarget +cardinalityCOMBINED PATHSatisfiedcomponentActivation whenrequiredService available

Configuration requirement

  1. Configuration policy
  2. Matching PID / factory PID
  3. Usable properties

Service requirement

  1. Provider bundle
  2. Registered interface
  3. Target + cardinality

Combined path

  1. Satisfied component
  2. Activation when required
  3. Service available

THIS ARTICLE EXPLORES

  1. Separate bundle resolution from DS satisfaction.
  2. Follow a missing mandatory reference to its provider.
  3. Use the runnable example before changing production configuration.

01 / INTRODUCTION

Introduction

An unsatisfied OSGi component is usually not the problem itself — it is a symptom of a missing dependency, invalid configuration, unresolved bundle state, or an incorrect service contract. The runtime is telling you, precisely, that a precondition for activation is not met.

AEM is a graph of bundles, components, services and configurations wired together by the Service Component Runtime. Troubleshooting becomes straightforward once you read that graph instead of guessing: an UNSATISFIED component has a declared requirement the container cannot currently fulfil, and the diagnosis is to find which requirement and why.

This article is a procedure, not OSGi theory. The goal is to take a component stuck in UNSATISFIED and walk it back to the exact missing reference, filter, configuration or bundle wiring that is holding it there.

02 / RUN THE EXAMPLE

Run a failing reference and watch it recover

Start with a concrete demonstration: an immediate ContentEnrichment component requires a MetadataProvider with the service property provider=aem. A provider registered as provider=legacy exists, but it cannot satisfy that reference. The downloadable project reproduces this with real Apache Felix SCR, corrects the property and verifies the recovery.

REPRODUCIBLE LAB / SOURCE + EVIDENCE

A mandatory reference, from mismatch to recovery

A standalone Apache Felix integration test. Inspect the Java contract, reproduce the failed reference, correct its service property and verify dependency-loss behavior.

Recorded validation:

ENVIRONMENT / RECORDED VERSIONS

Java
Oracle JDK 17.0.12; Java 11 bytecode target
Build
Maven 3.8.6
Runtime
Felix Framework 7.0.5 / SCR 2.2.12
Test / API
JUnit 4.13.2 / DS API and annotations 1.5.1
OS
macOS

SETUP / REQUIREMENTS

  • JDK 17 and Maven 3.8.6 or newer; only the recorded versions were verified.
  • Download and extract the ZIP, then open a terminal in osgi-unsatisfied.
  • Access to Maven Central on the first run; a corporate proxy may need approved Maven settings.
  • No Adobe SDK, AEM instance, credentials or external API required.

RUN

mvn -s settings.xml verify

VALIDATES

  • Missing provider leaves the component UNSATISFIED_REFERENCE.
  • An existing provider with a mismatched target property does not satisfy the reference.
  • Correcting provider=aem activates the component and permits a real service invocation.
  • Removing the mandatory provider withdraws the consumer service.

DOES NOT VALIDATE

  • Compatibility with any AEM release or production traffic.
  • Configuration Admin, required PIDs or run-mode configuration.
  • Sling, JCR, Dispatcher or content packages.
  • Execution on Java 11: only JDK 17 was tested.

CAPTURED OUTPUT / EXCERPT

CHECK 1: bundle ACTIVE; component UNSATISFIED_REFERENCE; no provider
CHECK 2: provider=legacy exists; target=(provider=aem); still UNSATISFIED_REFERENCE
CHECK 3: provider=aem; component ACTIVE; service returns Metadata from demo
CHECK 4: provider removed; component UNSATISFIED_REFERENCE; consumer service withdrawn
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
BUILD SUCCESS

SOURCE NOTES / VALIDATION BOUNDARY

The excerpt preserves the previously recorded run; other Maven messages are omitted. CHECK lines are emitted after test assertions, not copied from an AEM console.

Inspect src/test/java/com/mohammedboudoun/lab/osgi/ReferenceRecoveryIT.java in the ZIP. Failsafe runs after packaging and DS descriptor generation, so use verify rather than test.

The ZIP contains seven source/documentation files, including pinned dependencies and the README. Framework storage and build outputs stay under target; Maven also uses its normal dependency cache.

This educational harness is not an AEM deployment package. Do not install its framework or SCR dependencies into AEM.

03 / TESTED ENVIRONMENT

What was actually tested

Validated on 8 October 2026 with Oracle JDK 17.0.12, Maven 3.8.6, Apache Felix Framework 7.0.5 and Felix SCR 2.2.12 on macOS. The POM pins DS API/annotations 1.5.1 and JUnit 4.13.2. It targets Java 11 bytecode, but this walkthrough was executed on JDK 17 only.

The result establishes service-filter matching, immediate activation and withdrawal after a mandatory dependency disappears. It does not establish compatibility with a particular AEM release, test run-mode configuration, or exercise Sling, JCR, Dispatcher or production traffic. Do not install the harness's framework or SCR dependencies into AEM.

04 / CONSUMER CONTRACT

Read the contract before changing the runtime

The consumer declares a 1..1 static reference named metadataProvider. The target narrows the acceptable service registrations to provider=aem. These are three separate checks: the interface must be registered, its properties must match, and the required cardinality must be met. Immediate activation makes the state transition easy to observe in this example.

The complete class and interfaces are in the download. The excerpt below is the relevant contract; the method returns a value from the bound provider so the test verifies useful behavior after activation, not merely a green status.

04 — Read the contract before changing the runtime

java
@Component(name = "lab.content.enrichment",
    service = ContentEnrichment.class, immediate = true)
public class ContentEnrichmentComponent implements ContentEnrichment {
    @Reference(name = "metadataProvider", target = "(provider=aem)",
        cardinality = ReferenceCardinality.MANDATORY,
        policy = ReferencePolicy.STATIC)
    private MetadataProvider metadataProvider;

    public String describe() {
        return "Metadata from " + metadataProvider.source();
    }
}

05 / OBSERVE FIX VALIDATE

Observe the mismatch, fix the property, validate withdrawal

ReferenceRecoveryIT starts a real framework, installs SCR and the generated bundle, and checks the component's runtime DTO. Initially no provider exists. It then registers a test provider with provider=legacy: an interface-only registry lookup finds it, but a lookup with (provider=aem) finds no match. The DTO names metadataProvider as the unsatisfied reference. This is the evidence that separates a missing service from a filter mismatch.

The test calls registration.setProperties with provider=aem. SCR activates the component and the test invokes its service, expecting Metadata from demo. Finally it unregisters the provider and verifies both UNSATISFIED_REFERENCE and withdrawal of the consumer service. A repair is incomplete if the dependency-loss path remains untested.

The CHECK lines captured in the reproducible lab above are emitted by the test after assertions pass. They are not fabricated AEM console output. Polling is bounded to ten seconds per awaited transition; the framework always stops in a finally block.

06 / INSPECT GENERATED DESCRIPTOR

Inspect what SCR actually reads

Inspect the generated manifest and DS descriptor rather than stopping at the Java annotation. The Service-Component header must name the descriptor; the XML must contain the expected implementation, interface, reference name and target. This is particularly useful when refactoring build plugins or moving away from legacy SCR annotations.

As a negative experiment, change the consumer target to (provider=other). The reference-contract assertion should fail because the expected target has changed; the test never registers a provider=other service. Restore the original target afterwards. Making the reference optional would hide the unmet contract rather than fix it.

06 — Inspect what SCR actually reads

sh
unzip -p target/osgi-unsatisfied-1.0.0.jar META-INF/MANIFEST.MF
unzip -p target/osgi-unsatisfied-1.0.0.jar OSGI-INF/lab.content.enrichment.xml

07 / APPLY DIAGNOSIS IN AEM

Apply the observation to an AEM investigation

On an authorized local AEM development instance, inspect the component and its declared references, then compare the provider's registered properties with the reference target. Also check for a configuration override such as metadataProvider.target: the effective target can differ from the source annotation. Use the supported diagnostic tools available for your deployment; do not assume production or Cloud Service exposes the same writable consoles as a local instance.

Correct the intended provider property or the consumer's reviewed selection rule in source-controlled configuration or code. Do not broaden the filter simply to make any provider bind. Recheck activation, an actual service call and dependency-loss behavior. For required PID problems, follow the configuration checks later in this article; the downloadable test deliberately isolates reference matching from Configuration Admin.

08 / WHAT UNSATISFIED MEANS

What does UNSATISFIED actually mean?

Two lifecycles are easy to conflate. A bundle moves through INSTALLED → RESOLVED → ACTIVE, governed by the OSGi framework and package wiring. A component moves through UNSATISFIED → SATISFIED → ACTIVE, governed by the Service Component Runtime (SCR / Declarative Services). They are related but not the same thing.

A bundle can be ACTIVE while one of its components is still UNSATISFIED. The bundle resolved its imports and started, but a component inside it declares a mandatory reference or requires configuration that is not currently available — so SCR refuses to activate it, and it registers no service.

If the bundle is ACTIVE, start with component requirements, then investigate upstream providers and package identity if needed. INSTALLED can indicate unresolved imports. RESOLVED means imports resolved, but the bundle is not currently active; check start state, activation policy and lifecycle errors rather than assuming broken wiring.

  • Bundle state: INSTALLED → RESOLVED → ACTIVE (framework / package wiring)
  • Component state: UNSATISFIED → SATISFIED → ACTIVE (SCR / DS)
  • Service registration: a delayed component can register its service while SATISFIED and activate when that service is requested
  • Service reference: a declared dependency on another service
  • Configuration: a component may require a configuration PID before it can satisfy
Read the state before changing code
ObservationWhat it does not proveNext evidence
Bundle resolvedIts DS components are satisfied.Component state and descriptor.
Configuration presentPID, policy and properties match.Effective configuration and required policy.
Service registeredTarget filter and cardinality match.Service properties and consumer reference.
Satisfied componentActivation has already occurred.Activation policy and actual service request.

09 / WHICH REFERENCE MISSING

First check: which reference is missing?

Open the component in the Components console. For each component it lists the declared references: the service interface, cardinality, policy, any target filter, and whether that reference is currently bound. The unsatisfied reference is named explicitly — read it before doing anything else.

That single line tells you the shape of the problem. If the expected interface has no matching service at all, you are chasing a missing or upstream-unsatisfied provider. If a service of that interface exists but the reference is still unbound, compare the target filter and effective properties first, then investigate package identity and service availability. If the reference is mandatory and static, the component cannot activate until it is bound.

Diagnose the specific reference, not the component in general. 'The component is unsatisfied' is the question; 'the mandatory reference to MetadataProvider with target (provider=aem) is unbound' is the answer you are looking for.

Trace one missing edge

Follow the provider recursively; avoid changing optionality to suppress a symptom.

  1. 01Consumer reference
  2. 02Interface + target filter
  3. 03Provider registration
  4. 04Provider dependencies
  5. 05Activation evidence

10 / COMMON CAUSES

Common causes

Most unsatisfied components reduce to a small set of recurring causes. Work through them against the specific reference the console named.

  • The referenced service is genuinely not registered — often because its own component is unsatisfied upstream
  • The reference points at the wrong interface (implementation class instead of the API)
  • A target filter that matches no registered service
  • Configuration PID mismatch between the component and the config that was deployed
  • A mandatory configuration is missing (configuration policy REQUIRE with no config)
  • Unresolved Import-Package, so the bundle never reaches ACTIVE
  • Classloader / duplicate API versions exporting the same package twice
  • A circular chain of mandatory references that can never all satisfy at once
  • An exception thrown in @Activate is an activation failure; inspect the runtime state and logs rather than treating every non-active component as a missing reference
  • Incomplete SCR → Declarative Services annotation migration

11 / AEM SPECIFIC FAILURE MODES

AEM-specific failure modes

Several causes show up specifically in AEM, and especially around platform work such as a modular OSGi service architecture or an upgrade. The runtime is standard OSGi, but the context adds its own traps.

  • Custom services referencing AEM APIs that were deprecated or removed in a newer version
  • DS annotation migration: legacy org.apache.felix.scr.annotations not fully moved to org.osgi.service.component.annotations
  • Run-mode-specific configuration present on one instance but missing on another (author vs publish, or a prod run mode)
  • Deployment / package install ordering leaving a dependency temporarily absent
  • A third-party bundle that is not compatible with the target AEM version
  • Java version mismatch between the build toolchain and the AEM runtime

12 / DIAGNOSTIC FLOW

Diagnostic flow

A consistent order turns guesswork into a short walk down the dependency graph. Start at the component and stop at the first step that fails.

12 — Diagnostic flow

text
Component UNSATISFIED
        |
Check required references      -> which reference is unbound?
        |
Is that service registered?    -> no  -> fix the provider (often unsatisfied upstream)
        |  yes
Check target filter            -> does the filter match a real service?
        |
Check configuration            -> is the required PID present and valid?
        |
Check bundle imports           -> are all Import-Package wired? (bundle ACTIVE?)
        |
Check activation logs          -> did @Activate throw?
        |
Validate dependency chain      -> are transitive references satisfied?

A reproducible diagnosis

  • Name the component and failing reference.
  • Compare generated descriptor with the source annotations.
  • Inspect effective configuration and registered service properties.
  • Reproduce the mismatch, then verify the expected state after correction.

13 / CONFIGURATION EXAMPLE

Configuration example

Configuration can keep a component inactive even when every service reference is available. A component whose configuration policy is REQUIRE will not satisfy until a configuration for its PID exists; a PID mismatch between the component and the deployed configuration produces exactly the same symptom.

ConfigurationPolicy.REQUIRE requires a matching Configuration Admin configuration; it does not validate every application property. Validate endpoint and other business requirements explicitly during activation. A missing PID and an activation exception are different diagnoses. Run-mode selection belongs to the configuration folder, not an arbitrary ~prod suffix in a singleton PID filename.

13 — Configuration example

java
@Component(configurationPolicy = ConfigurationPolicy.REQUIRE)
@Designate(ocd = ContentEnrichmentServiceImpl.Config.class)
public class ContentEnrichmentServiceImpl implements ContentEnrichmentService {

    @ObjectClassDefinition(name = "Content Enrichment Service")
    public @interface Config {
        @AttributeDefinition(name = "API endpoint")
        String endpoint();          // validate explicitly at activation
        @AttributeDefinition(name = "Timeout (ms)")
        int timeout() default 5000; // typed default
    }
}

// Deployed, run-mode scoped configuration (OSGi config, JSON form):
// config.author/com.example.core.ContentEnrichmentServiceImpl.cfg.json
// {
//   "endpoint": "https://api.internal/enrich",
//   "timeout": 8000
// }

14 / LOGS AND CONSOLE CHECKS

Logs & console checks

The web console and the logs answer different questions, and you usually need both. The exact UI layout varies between AEM versions, but the underlying consoles and concepts are stable.

Read the component first, then widen out: the Components console names the unsatisfied reference; the Bundles console reveals a bundle stuck below ACTIVE or an unresolved Import-Package; the Services console confirms whether the expected interface is actually registered and with which properties. When a component flickers in and out of ACTIVE, the error log holds the activation stack trace that explains why.

  • Components: /system/console/components — component state and the unsatisfied reference
  • Bundles: /system/console/bundles — RESOLVED-not-ACTIVE and unresolved imports
  • Services: /system/console/services — is the interface registered, with what properties
  • error.log — activation exceptions and stack traces from @Activate
  • Confirm the service properties actually match the reference target filter

15 / AFTER AN UPGRADE

Why this appears after an AEM upgrade

Components that worked for years can turn UNSATISFIED immediately after an upgrade, because the surface they depend on moved. This is a dependency-graph change, not a regression in your logic, and it is a routine part of an AEM 6.5 LTS modernization or a version migration.

The usual culprits are services that were removed or relocated, deprecated APIs that no longer resolve, bundle wiring that changed so an Import-Package now points nowhere, a Java version change in the runtime, dependency versions that shifted underneath you, and incomplete SCR → OSGi Declarative Services annotation migration. Each of these breaks a specific edge in the graph; find the edge and the fix is local.

16 / ANTI PATTERNS

Anti-patterns

Most time lost on unsatisfied components is lost to reactions that hide the cause instead of finding it.

  • Retrying deployments or restarting instances without first identifying the missing reference
  • Making every reference OPTIONAL so the component activates with null collaborators
  • Broad or absent target filters that bind the wrong service and move the failure downstream
  • Relying on activation order instead of declaring real dependencies
  • Swallowing activation exceptions, so a failing @Activate looks like a mysterious unsatisfied state

17 / DEBUGGING CHECKLIST

Debugging checklist

A compact pass that resolves most cases, in order:

  • Is the bundle ACTIVE, or only RESOLVED / INSTALLED?
  • Which specific reference does the Components console report as unsatisfied?
  • Is a service of that interface registered at all?
  • Does the target filter match the registered service's properties?
  • Is the required configuration PID present, correctly named, and valid?
  • Are all Import-Package statements resolved?
  • Did @Activate throw — is there a stack trace in error.log?
  • Are the transitive references of that service themselves satisfied?

18 / MY PERSPECTIVE

My perspective

Treat OSGi activation as a dependency graph problem, not a restart problem. An unsatisfied component is a precise statement about a missing edge in that graph, and the console will name it if you ask. Restart-and-hope discards that information and resets you to zero.

In practice — and it is the same discipline behind durable production troubleshooting — I read the component, name the unsatisfied reference, confirm whether the provider exists, then check filter, configuration, imports and activation logs in that order. The cause is almost always one specific, nameable thing, and naming it is most of the fix.

Design to make this easy for the next engineer: declare real dependencies, keep target filters specific, require the configuration you actually need, and never swallow activation exceptions. A component that fails loudly and precisely is a component that is quick to repair.

19 / CONCLUSION

Conclusion

Unsatisfied is a diagnosis, not a dead end. Separate bundle state from component state, read the specific reference the runtime is waiting on, and walk the dependency chain from there through filters, configuration, bundle wiring and activation logs.

Done systematically, the state that looks opaque becomes a short, repeatable investigation — and the same method holds whether the trigger is a new service, a missing configuration or an AEM upgrade that moved the ground beneath a component.

REFERENCE DESK

Sources & further verification

Product behavior should be checked against the target AEM and search-engine release. The design choices in this note are proposed assessment criteria, not vendor guarantees.

SHARE THIS NOTE

Found this useful? Share it with someone working on AEM, platform engineering or search.

SHARE
LinkedIn X Facebook Threads

CONTINUE THE THREAD

Related engineering notes

Related engineering work