Core AEM bundles restart when custom bundle is deployed | Community
Skip to main content
Level 3
April 10, 2019

Core AEM bundles restart when custom bundle is deployed

  • April 10, 2019
  • 5 replies
  • 12932 views

We're having trouble where our project, during deployment, causes a restart of all the core AEM bundles on every deploy. We're not certain when this bug was introduced or how to solve it.

There appears to be some documentation of an error like this, but I don't feel we meet this criteria - Custom bundle install causes core AEM bundles to restart

None of our custom bundles are exporting core libraries. Is there another potential cause? Or something similar to the above?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

5 replies

smacdonald2008
Level 10
April 15, 2019

That document sounds applicable to your use case. Have you tried going through the steps to resolve?

Level 3
April 15, 2019

I did go through the steps to resolve it in that document. Neither of the custom bundles we deploy exports core libraries. This is what bundle-plugin configuration looks like.

<plugin>
  <groupId>org.apache.felix</groupId>
  <artifactId>maven-bundle-plugin</artifactId>
  <extensions>true</extensions>
  <configuration>
  <instructions>
  <Bundle-SymbolicName>com.ourdomain.od-ourproject</Bundle-SymbolicName>
  <Export-Package>
  com.ourdomain.ourproject.*,

  com.ourdomain.importer.*,

  com.ourdomain.searchpromote.*,

  com.ourdomain.form.*,

  com.ourdomain.mediasite.*

   </Export-Package>
  <Import-Package>
   <!-- all other dependencies should be marked optional -->
   *;resolution:=optional

   </Import-Package>
  <Sling-Model-Packages>
  com.ourdomain.ourproject.models.components,

  com.ourdomain.ourproject.models.templates,

  com.ourdomain.ourproject.models.gigya,

  com.ourdomain.form.components,

  com.ourdomain.form.templates,

  com.ourdomain.mediasite.models.components

   </Sling-Model-Packages>
  <Embed-Dependency>signpost-core,signpost-commonshttp4,core.wcm.components.core</Embed-Dependency>
  </instructions>
  </configuration>
</plugin>

Under "Importing Bundles" the one situation we have is that we have a customization of Brightcove Connector that is being imported. So the customized Brightcove Connector shows up as being imported by com.ourdomain.od-ourproject. Is that our problem and what would the resolution be? I assumed that document wasn't related since we don't export any core libraries.     

Gaurav-Behl
Level 10
April 15, 2019

Could you share the logs and MANIFEST.MF of your bundle as mentioned by Jörg?

Are you dispatching any kind of events from your code or have bundle-activators performing any task(s)?

Brightcove (com.coresecure.brightcove.cq5.brightcove-services) shouldn't be a problem, it doesn't export any core services.

Not sure if this is tied to ReferencePolicy.DYNAMIC

https://osgi.org/javadoc/r5/enterprise/org/osgi/service/component/annotations/ReferencePolicy.html

joerghoh
Adobe Employee
Adobe Employee
April 15, 2019

are the bundles restarting (visible in /system/console/bundles) or just services? Bundles are only restarted if the package imports changes, while bundles might stop/start because of missing and re-appearing dependent services.

That document should help. In case it does not you might want to post the log and the MANIFEST.MF of your bundle here.

Jörg

Level 3
May 21, 2019

Nothing has worked so far. We're still stuck here.     

akhoury
Adobe Employee
Adobe Employee
May 21, 2019

prestonModOp​ the only way your custom bundle would cause the out of the box bundles to restart is if you are exporting a java package that is the same as one of the out of the box bundles.

1. Go to the /system/console/bundles UI

2. Click on each of your custom bundles and see the "Importing Bundles" list

3. If any out of the box bundles are listed as importing your bundle

4. Click on the link to the out of the box bundle in that list

5. Look at the "Imported Packages" list on the out of the box bundle and find your bundle listed there - it will tell you which java package your bundle is exporting that it shouldn't be

6. Repeat this process for all of your custom bundles and remove all exports that overlap with out of the box bundles

Level 3
May 24, 2019

Right. And this isn't what's happening with our setup. The only bundle importing either of the custom bundles is that one of them imports the other. No out of the box bundles import either custom bundle.

Adobe Employee
September 13, 2019

Has this issue been resolved?  we're having a similar issue where our instances are reloading bundles in an infinite loop.  any suggestions or direction on what would cause an infinite loop of bundles to reload?

joerghoh
Adobe Employee
Adobe Employee
September 13, 2019

Well, that is not necessarily a product issue in the first place, but you can also get there with project bundles and services built in a certain way. Depends pretty much on the special case, it's hard to make generic statements.