AEM 6.3 Configuration bound to wrong bundle launchpad:resources/install/0/org.apache.sling.scripting.core-2.0.44.jar
Hi Community,
Want to share resolution of an issue I was facing with AEM 6.3 regarding wrong bundle binding causing components not working as expected.
Problem - Component configuration bound to launchpad:resources/install/0/org.apache.sling.scripting.core-2.0.44.jar where as per AEM 6.3 it should be unbound. Due to this wrong binding component doesn't get activated with correct OSGI config.
Cause - In our application code which is running fine on AEM 6.1, we were using
Configuration conf = sling.getService(org.osgi.service.cm.ConfigurationAdmin.class).getConfiguration(configName);
Whenever a page was loading, the above code is being executed. Above line return Configuration object which has bundle location set to some default value
launchpad:resources/install/0/org.apache.sling.scripting.core-2.0.44.jar
Fix- Set the bundle location to null in the code as follows. This will fix the problem.
Configuration conf = sling.getService(org.osgi.service.cm.ConfigurationAdmin.class).getConfiguration(configName);
if (null = conf) {
conf.setBundleLocation(null);
}
Cheers,
Deepak