*INFO* [Apache Sling Resource Resolver Finalizer Thread] org.apache.sling.resourceresolver.impl.CommonResourceResolverFactoryImpl Unclosed ResourceResolver was created here: java.lang.Exception: Opening Stacktrace at org.apache.sling.resourceresolver.impl.CommonResourceResolverFactoryImpl$ResolverReference.<init>(CommonResourceResolverFactoryImpl.java:538) [org.apache.sling.resourceresolver:1.7.8] at org.apache.sling.resourceresolver.impl.CommonResourceResolverFactoryImpl.register(CommonResourceResolverFactoryImpl.java:228) [org.apache.sling.resourceresolver:1.7.8] at org.apache.sling.resourceresolver.impl.ResourceResolverImpl.<init>(ResourceResolverImpl.java:110) [org.apache.sling.resourceresolver:1.7.8] at org.apache.sling.resourceresolver.impl.ResourceResolverImpl.<init>(ResourceResolverImpl.java:103) [org.apache.sling.resourceresolver:1.7.8] at org.apache.sling.resourceresolver.impl.CommonResourceResolverFactoryImpl.getResourceResolverInternal(CommonResourceResolverFactoryImpl.java:273) [org.apache.sling.resourceresolver:1.7.8] at org.apache.sling.resourceresolver.impl.ResourceResolverFactoryImpl.getServiceResourceResolver(ResourceResolverFactoryImpl.java:89) [org.apache.sling.resourceresolver:1.7.8] at com.day.cq.personalization.impl.omnisearch.ActivitiesOmnisearchHandler.getResourceResolver(ActivitiesOmnisearchHandler.java:84) [com.day.cq.cq-personalization:5.13.24] at com.day.cq.personalization.impl.omnisearch.ActivitiesOmnisearchHandler.deactivate(ActivitiesOmnisearchHandler.java:129) [com.day.cq.cq-personalization:5.13.24] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.apache.felix.scr.impl.inject.methods.BaseMethod.invokeMethod(BaseMethod.java:244) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.inject.methods.BaseMethod.access$500(BaseMethod.java:41) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.inject.methods.BaseMethod$Resolved.invoke(BaseMethod.java:685) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.inject.methods.BaseMethod.invoke(BaseMethod.java:529) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.inject.methods.ActivateMethod.invoke(ActivateMethod.java:318) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.inject.methods.ActivateMethod.invoke(ActivateMethod.java:308) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.manager.SingleComponentManager.disposeImplementationObject(SingleComponentManager.java:421) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.manager.SingleComponentManager.deleteComponent(SingleComponentManager.java:165) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.manager.SingleComponentManager.ungetService(SingleComponentManager.java:1041) [org.apache.felix.scr:2.1.26] at org.apache.felix.framework.ServiceRegistrationImpl.ungetFactoryUnchecked(ServiceRegistrationImpl.java:393) at org.apache.felix.framework.ServiceRegistrationImpl.ungetService(ServiceRegistrationImpl.java:288) at org.apache.felix.framework.ServiceRegistry.ungetService(ServiceRegistry.java:517) at org.apache.felix.framework.ServiceRegistry.ungetServices(ServiceRegistry.java:202) at org.apache.felix.framework.ServiceRegistry.unregisterService(ServiceRegistry.java:183) at org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:146) at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.unregister(AbstractComponentManager.java:952) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.unregister(AbstractComponentManager.java:915) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:140) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.manager.AbstractComponentManager.unregisterService(AbstractComponentManager.java:994) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.manager.AbstractComponentManager.doDeactivate(AbstractComponentManager.java:844) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.manager.AbstractComponentManager.deactivateInternal(AbstractComponentManager.java:825) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.manager.DependencyManager.deactivateComponentManager(DependencyManager.java:2580) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.manager.DependencyManager.access$400(DependencyManager.java:59) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.manager.DependencyManager$SingleStaticCustomizer.removedService(DependencyManager.java:1353) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.manager.DependencyManager$SingleStaticCustomizer.removedService(DependencyManager.java:1222) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:1226) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:1121) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.untrack(ServiceTracker.java:981) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1160) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComponentActivator.java:114) [org.apache.felix.scr:2.1.26] at org.apache.felix.framework.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:990) at org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:838) at org.apache.felix.framework.EventDispatcher.fireServiceEvent(EventDispatcher.java:545) at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4863) at org.apache.felix.framework.Felix.access$000(Felix.java:111) at org.apache.felix.framework.Felix$1.serviceChanged(Felix.java:440) at org.apache.felix.framework.ServiceRegistry.unregisterService(ServiceRegistry.java:170) at org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:146) at org.apache.sling.resourceresolver.impl.ResourceResolverFactoryActivator.unregisterFactory(ResourceResolverFactoryActivator.java:494) [org.apache.sling.resourceresolver:1.7.8] at org.apache.sling.resourceresolver.impl.ResourceResolverFactoryActivator.unregisterFactory(ResourceResolverFactoryActivator.java:485) [org.apache.sling.resourceresolver:1.7.8] at org.apache.sling.resourceresolver.impl.ResourceResolverFactoryActivator.access$200(ResourceResolverFactoryActivator.java:68) [org.apache.sling.resourceresolver:1.7.8] at org.apache.sling.resourceresolver.impl.ResourceResolverFactoryActivator$1.providerRemoved(ResourceResolverFactoryActivator.java:425) [org.apache.sling.resourceresolver:1.7.8] at org.apache.sling.resourceresolver.impl.providers.ResourceProviderTracker.unregister(ResourceProviderTracker.java:290) [org.apache.sling.resourceresolver:1.7.8] at org.apache.sling.resourceresolver.impl.providers.ResourceProviderTracker.access$100(ResourceProviderTracker.java:59) [org.apache.sling.resourceresolver:1.7.8] at org.apache.sling.resourceresolver.impl.providers.ResourceProviderTracker$1.removedService(ResourceProviderTracker.java:116) [org.apache.sling.resourceresolver:1.7.8] at org.apache.sling.resourceresolver.impl.providers.ResourceProviderTracker$1.removedService(ResourceProviderTracker.java:106) [org.apache.sling.resourceresolver:1.7.8] at org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:970) at org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:872) at org.osgi.util.tracker.AbstractTracked.untrack(AbstractTracked.java:341) at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:912) at org.apache.felix.framework.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:990) at org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:838) at org.apache.felix.framework.EventDispatcher.fireServiceEvent(EventDispatcher.java:545) at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4863) at org.apache.felix.framework.Felix.access$000(Felix.java:111) at org.apache.felix.framework.Felix$1.serviceChanged(Felix.java:440) at org.apache.felix.framework.ServiceRegistry.unregisterService(ServiceRegistry.java:170) at org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:146) at org.apache.sling.resourceresolver.impl.legacy.LegacyResourceProviderWhiteboard.unbindResourceProviderFactory(LegacyResourceProviderWhiteboard.java:163) [org.apache.sling.resourceresolver:1.7.8] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.apache.felix.scr.impl.inject.methods.BaseMethod.invokeMethod(BaseMethod.java:244) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.inject.methods.BaseMethod.access$500(BaseMethod.java:41) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.inject.methods.BaseMethod$Resolved.invoke(BaseMethod.java:685) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.inject.methods.BaseMethod.invoke(BaseMethod.java:529) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.inject.methods.BindMethod.invoke(BindMethod.java:42) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.manager.DependencyManager.invokeUnbindMethod(DependencyManager.java:2209) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.manager.SingleComponentManager.invokeUnbindMethod(SingleComponentManager.java:466) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.removedService(DependencyManager.java:395) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.removedService(DependencyManager.java:301) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:1226) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:1121) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.untrack(ServiceTracker.java:981) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1160) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComponentActivator.java:114) [org.apache.felix.scr:2.1.26] at org.apache.felix.framework.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:990) at org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:838) at org.apache.felix.framework.EventDispatcher.fireServiceEvent(EventDispatcher.java:545) at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4863) at org.apache.felix.framework.Felix.access$000(Felix.java:111) at org.apache.felix.framework.Felix$1.serviceChanged(Felix.java:440) at org.apache.felix.framework.ServiceRegistry.unregisterService(ServiceRegistry.java:170) at org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:146) at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.unregister(AbstractComponentManager.java:952) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.unregister(AbstractComponentManager.java:915) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:140) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.manager.AbstractComponentManager.unregisterService(AbstractComponentManager.java:994) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.manager.AbstractComponentManager.doDeactivate(AbstractComponentManager.java:844) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.manager.AbstractComponentManager.deactivateInternal(AbstractComponentManager.java:825) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.manager.AbstractComponentManager.dispose(AbstractComponentManager.java:589) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.disposeComponents(ConfigurableComponentHolder.java:718) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.BundleComponentActivator.dispose(BundleComponentActivator.java:487) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.Activator.disposeComponents(Activator.java:613) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.Activator.access$300(Activator.java:70) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.Activator$ScrExtension.destroy(Activator.java:451) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.AbstractExtender$1.run(AbstractExtender.java:216) [org.apache.felix.scr:2.1.26] at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at org.apache.felix.scr.impl.AbstractExtender.destroyExtension(AbstractExtender.java:238) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.AbstractExtender.bundleChanged(AbstractExtender.java:132) [org.apache.felix.scr:2.1.26] at org.apache.felix.scr.impl.Activator.bundleChanged(Activator.java:217) [org.apache.felix.scr:2.1.26] at org.apache.felix.framework.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:915) at org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:834) at org.apache.felix.framework.EventDispatcher.fireBundleEvent(EventDispatcher.java:516) at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4847) at org.apache.felix.framework.Felix.stopBundle(Felix.java:2812) at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1584) at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308) at java.base/java.lang.Thread.run(Thread.java:834)
Exception: Opening Stacktrace
How to check JSON object or JS object is empty?
Refused to load the script
Content-security-policy deny the script from third-party system, but few third-party application and system needs to be allow so that we can use their libraries in our web application. In this case since the content security policy blocked all script hence our application is unable to load any library from cdn.tiny.cloud host. Lets see the error ans solution in detail.
Error
Refused to load the script 'https://cdn.tiny.cloud/1/rashidjorvee/tinymce/6/tinymce.min.js' because it violates the following Content Security Policy directive: "script-src blob: data: 'unsafe-inline' 'unsafe-eval' 'self' rashidjorvee.com adobeaemcloud.com". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.
Solution
Using dispatcher config we can solve this by adding content-security-policy and allow that domain.
<IfModule mod_headers.c>
Header add X-Vhost "publish"
Header always set X-XSS-Protection "1; mode=block"
Header always set content-security-policy "script-src blob: data: 'unsafe-inline' 'unsafe-eval' 'self' *.tiny.cloud *.adobeaemcloud.com
</IfModule>