Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-7174

CacheManager should only be shutdown when last endpoint is stopped

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Cannot Reproduce
    • 2.8.5
    • 2.18.0
    • camel-cache, karaf
    • None
    • ServiceMix 4.4.2

    • Unknown

    Description

      When multiple bundles contain routes with a "cache:" endpoint, if one bundle is stopped, the cache from the other bundle stops working as well.

      Solution : in method doStop of class org.apache.camel.component.cache.CacheManagerFactory, remove the call to cacheManager.shutdown().

      If really useful, a more elaborate reference counting mechanism could be used to stop the CacheManager when the last endpoint is being stopped

      Caused by: java.lang.IllegalStateException: The CacheManager has been shut down. It can no longer be used.
      	at net.sf.ehcache.CacheManager.checkStatus(CacheManager.java:1158)
      	at net.sf.ehcache.CacheManager.cacheExists(CacheManager.java:1048)
      	at org.apache.camel.component.cache.CacheEndpoint.initializeCache(CacheEndpoint.java:104)
      	at org.apache.camel.component.cache.CacheProducer.process(CacheProducer.java:56)
      

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            davsclaus Claus Ibsen
            metatech metatech
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment