Expand my Community achievements bar.

SOLVED

invalid bundle context error

Avatar

Level 3

Hello,

With AEM 6.0, i am getting below error message intermittently. After restart everything is working without any issues

java.lang.IllegalStateException: Invalid BundleContext.
   at org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:514)
    at org.apache.felix.framework.BundleContextImpl.getServiceReference(BundleContextImpl.java:358)
    at <custom class>.Activator.getSlingRepository(Activator.java:80)

-------------

Below is the line which gets sling repository in custom class which implements BundleActivator

slingRepository = (SlingRepository) Activator.context.getService(Activator.context.getServiceReference(SlingRepository.class.getName()));

 

Appreciated for any help on above issue

1 Accepted Solution

Avatar

Correct answer by
Level 10

do you  have (Immediate=true) for your services in the bundle ?

View solution in original post

3 Replies

Avatar

Level 10

Do you get this error when you have not deployed your custom OSGi bundle? 

Avatar

Level 3

Yeah. Bundle got deployed properly. I see the active status, but when i try to access something, gettng invalid bundle context for first time. After restart everything is works fine

Avatar

Correct answer by
Level 10

do you  have (Immediate=true) for your services in the bundle ?