Richard Guy
Richard Guy

Reputation: 470

Changes to OSGi bundle not active until AEM restarted

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.

Upvotes: 2

Views: 2027

Answers (2)

Santanu Baruah
Santanu Baruah

Reputation: 1

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

Upvotes: 0

snaem
snaem

Reputation: 85

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

Upvotes: 0

Related Questions