invalid bundle context error | Community
Skip to main content
aem_dev1
New Participant
October 16, 2015
Solved

invalid bundle context error

  • October 16, 2015
  • 3 replies
  • 2635 views

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

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

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

3 replies

smacdonald2008
New Participant
October 16, 2015

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

aem_dev1
aem_dev1Author
New Participant
October 16, 2015

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

Lokesh_Shivalingaiah
Lokesh_ShivalingaiahAccepted solution
New Participant
October 16, 2015

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