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

Cache endpoint lazy initialization is not thread safe

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.10.3
    • 2.9.5, 2.10.4, 2.11.0
    • camel-cache
    • None
    • Unknown

    Description

      Similar to CAMEL-5950, but only occurs at lazy cache initialization.

      net.sf.ehcache.ObjectExistsException: Cache sampleCache already exists
          at net.sf.ehcache.CacheManager.addCacheNoCheck(CacheManager.java:1294) ~[org.apache.servicemix.bundles.ehcache-2.5.2_1.jar:na]
          at net.sf.ehcache.CacheManager.addCache(CacheManager.java:1184) ~[org.apache.servicemix.bundles.ehcache-2.5.2_1.jar:na]
          at org.apache.camel.component.cache.CacheEndpoint.initializeCache(CacheEndpoint.java:137) ~[camel-cache-2.10.3.jar:2.10.3]
      

      Workaround:

      		for (Endpoint endpoint : context.getEndpoints()) {
      			if (endpoint instanceof CacheEndpoint) {
      				CacheEndpoint ce = (CacheEndpoint) endpoint;
      				ce.initializeCache();
      			}
      		}
      

      Attachments

        Activity

          People

            njiang Willem Jiang
            agattiker Alexandre Gattiker
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: