Archive for April, 2015

unsatisfied AEM components because of duplicate package names

Ben Zahler

Today, I had an issue, where some of my AEM components just would not start. They had “unsatisfied” service references, but the referenced services were up and running.

After a lot of searching and thanks to this blog post, I finally found out that the actual problem was that the referenced services’s package name was identical to a package name in my component’s bundle.

So what happened?

Let’s say my Interface was set up like this:

  • bundle name: codeflair-blog-api
  • Interface name:

Package* was exported and therefore the interface was made available by the bundle.

My implementing class was set up in a different bundle, let’s say codeflair-core-impl. In this bundle there was another (completely unrelated component) which implemented interface in bundle codeflair-core-api.

codeflair-core-api also exported*, and because the bundle also had a dependency on codeflair-blog-api, all classes from package in codeflair-blog-api were copied to bundle codeflair-core-api and also made available in that bundle. Now our is availabe in two different bundles, so an adapter factory will not recognize that  actually implements from codeflair-blog-api.

So the bottom line is: choose a good package struckter und really make sure a package is neever user in two different bundles!