Details
Description
I got this exception while using Apache camel through this integration: https://bloomreach-forge.github.io/camel-events-support/index.html
[INFO] [talledLocalContainer] 26-Mar-2020 11:00:00.805 SEVERE [pool-4-thread-1] com.google.common.eventbus.EventBus$LoggingHandler.handleException Exception thrown by subscriber method handleEvent(org.onehippo.cms7.event.HippoEvent) on subscriber org.onehippo.forge.camel.component.hippo.HippoEventConsumer$HippoLocalEventListener@5bf21866 when dispatching event: org.onehippo.repository.events.HippoWorkflowEvent@733ea09b [INFO] [talledLocalContainer] java.lang.NullPointerException [INFO] [talledLocalContainer] at org.onehippo.cms7.services.eventbus.GuavaEventBusListenerProxy.handleEvent(GuavaEventBusListenerProxy.java:53) [INFO] [talledLocalContainer] at org.onehippo.forge.camel.component.hippo.HippoEventConsumer$HippoLocalEventListener.handleEvent(Unknown Source) [INFO] [talledLocalContainer] at sun.reflect.GeneratedMethodAccessor375.invoke(Unknown Source) [INFO] [talledLocalContainer] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [INFO] [talledLocalContainer] at java.lang.reflect.Method.invoke(Method.java:498) [INFO] [talledLocalContainer] at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:87) [INFO] [talledLocalContainer] at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:144) [INFO] [talledLocalContainer] at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:72) [INFO] [talledLocalContainer] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [INFO] [talledLocalContainer] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [INFO] [talledLocalContainer] at java.lang.Thread.run(Thread.java:748)
I think the problem is not caused by the Camel integration, however, as I reproduced the issue using it I'll need it on the reproduction steps:
- Create a project from the archetype.
- Include Apache camel using camel-events-support on the site application.
- Setup 2 camel routes that listen to different hippoevents.
- Test that they work as expected.
- Stop one of the routes using its MBean from the jconsole.
- Check that the other route doesn't work anymore and that you get the previous exception.
I created this repository to make it easier to reproduce: https://github.com/epegar/Bloomreach-Apache-Camel-Integration
If using this repository, the first 3 steps can be skipped.
On that project, there are 2 routes, one logs an event on the log when a document is published and the other route, logs a message as well, in this case when a document is unpublished.
I think the problem is caused due to the GuavaEventBusListenerProxy not implementing any special clone action for the Methods array, so once the route is removed, its GuavaEventBusListenerProxy is destroyed and the shared array is nullified.
Thank you.
Attachments
Issue Links
- causes
-
CMS-13688 GuavaHippoEventBusTest fails occasionally
- Closed