Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-13213

Nullpointer on the event bus after stopping a camel route.

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • 13.3.0
    • 13.4.4, 14.3.0
    • None
    • None
    • Flagged
    • Pulsar
    • Pulsar 234 - ContentSearch Fin

    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:

      1. Create a project from the archetype.
      2. Include Apache camel using camel-events-support on the site application.
      3. Setup 2 camel routes that listen to different hippoevents.
      4. Test that they work as expected.
      5. Stop one of the routes using its MBean from the jconsole.
      6. 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

          Activity

            People

              eperez Eduardo Perez (Inactive)
              eperez Eduardo Perez (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: