Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Custom Eventlistener failed to activate

Avatar

Level 2

Following is error

Path : http://localhost:4502/system/console/components/4324

Error:

java.lang.NullPointerException at xxxxxx.core.listeners.SearchPageTagListener.activate(SearchPageTagListener.java:42) 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:242) at org.apache.felix.scr.impl.inject.methods.BaseMethod.access$500(BaseMethod.java:41) at org.apache.felix.scr.impl.inject.methods.BaseMethod$Resolved.invoke(BaseMethod.java:678) at org.apache.felix.scr.impl.inject.methods.BaseMethod.invoke(BaseMethod.java:524) at org.apache.felix.scr.impl.inject.methods.ActivateMethod.invoke(ActivateMethod.java:318) at org.apache.felix.scr.impl.inject.methods.ActivateMethod.invoke(ActivateMethod.java:308) at org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:342) at org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:115) at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:984) at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:957) at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:757) at org.apache.felix.scr.impl.manager.DependencyManager$SingleStaticCustomizer.addedService(DependencyManager.java:1091) at org.apache.felix.scr.impl.manager.DependencyManager$SingleStaticCustomizer.addedService(DependencyManager.java:1043) at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1216) at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1137) at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.trackAdding(ServiceTracker.java:944) at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.track(ServiceTracker.java:880) at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1168) at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComponentActivator.java:125) 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:4833) at org.apache.felix.framework.Felix.registerService(Felix.java:3804) at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:328) at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:907) at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:893) at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:128) at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:960) at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:733) at org.apache.felix.scr.impl.manager.AbstractComponentManager.enableInternal(AbstractComponentManager.java:667) at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:433) at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.enableComponents(ConfigurableComponentHolder.java:666) at org.apache.felix.scr.impl.BundleComponentActivator.initialEnable(BundleComponentActivator.java:353) at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:553) at org.apache.felix.scr.impl.Activator.access$200(Activator.java:69) at org.apache.felix.scr.impl.Activator$ScrExtension.start(Activator.java:424) at org.apache.felix.scr.impl.AbstractExtender.createExtension(AbstractExtender.java:196) at org.apache.felix.scr.impl.AbstractExtender.modifiedBundle(AbstractExtender.java:169) at org.apache.felix.scr.impl.AbstractExtender.modifiedBundle(AbstractExtender.java:49) at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:488) at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:420) at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232) at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:450) 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:4817) at org.apache.felix.framework.Felix.startBundle(Felix.java:2336) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998) at org.apache.felix.webconsole.internal.core.BaseUpdateInstallHelper.run(BaseUpdateInstallHelper.java:198) at java.base/java.lang.Thread.run(Thread.java:836)

1 Reply

Avatar

Level 4

Hi @sangrampatil111 ,

I hope you are writing a Custom Event Listener with the help of the Observation Manager and also Referencing classes NativeMethodAccessorImpl and DelegatingMethodAccessorImpl.

Please check the service which you are referencing must be active.

You can also check the below article for Custom Event Listener Implementation :

If the issue still persists please elaborate or share the snippet code.

Hope this could help you !!!

Regards

Shiv

 

 

Avatar

Level 2

Thanks @Shiv_Prakash_Patel ,

 

I tried everything you mentioned. But it seems dependency issue.

I am getting following error in OSGI console.

HTTP ERROR 404 Not Found

URI: /system/console/components/4267
STATUS: 404
MESSAGE: Not Found
SERVLET: org.apache.felix.http.base.internal.dispatch.DispatcherServlet-c17cee53