2
votes

I have a sling Servlet (and various other components) running inside an OSGi bundle inside AEM / Apache Felix.

eg:

@SlingServlet(
        label = "XXXX - SSO Post Servlet",
        metatype = true,
        methods = {"POST"},
        name = "XXXX.core.components.SlingPostServlet",
        paths = {"/services/SSOPost"}
)
public class SlingPostServlet extends SlingAllMethodsServlet {
  //etc

My components work as expected, maven is able to build, bundle and deploy the entire project fine.

My issue is that updates to my components are not activated until I restart the entire AEM instance. I have tried refreshing OSGi packages, restarting the bundle, and as many likely UI actions to achieve this effect as I can think of, but no luck.

Any ideas? I'm hoping its a simple config issue/ button I am not aware of.

Thanks.

2
do you see nodes under this path /system/sling/installer/jcr/pauseInstallation when you install the updated package ?Sharath Madappa
@SharathMadappa no, there are no nodes at all under that path before or after install.Richard Guy
after building the updated code, open the configurations for JcrInstaller and save it (the goal is get the activate method of JcrInstaller to fire). Does this have the same effect as restarting the instance w.r.t update of components ?Sharath Madappa
How are you deploying your bundle to the instance? Via Maven plugins or manually? Also do your components have any OSGI properties associated to it? Usually the properties are bound to a specific version of jar and may need to be unbind via configuration manager to actually reflect the changes.Ameesh Trikha
We beed more information, what version of AEM? Can you replicate this behavior in a new clean project? Can you replicate this in a new clean instance? You have to start a process of elimination to narrow the issue down.Ahmed Musallam

2 Answers

0
votes

The bundle is started but the event might not be active. It should get activated when the service is actually used. We can use the @Component(immediate=true) annotation to activate the component when the bundle gets started

0
votes

Try deleting the old jar first, and then deploy the new jar. This works for me most of the times, but not always.