You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Willem Jiang (JIRA)" <ji...@apache.org> on 2013/03/01 13:47:13 UTC

[jira] [Resolved] (CAMEL-6101) Cache endpoint lazy initialization is not thread safe

     [ https://issues.apache.org/jira/browse/CAMEL-6101?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Jiang resolved CAMEL-6101.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 2.9.5
                   2.11.0
                   2.10.4

This issue should be resolved with CAMEL-5950.
                
> Cache endpoint lazy initialization is not thread safe
> -----------------------------------------------------
>
>                 Key: CAMEL-6101
>                 URL: https://issues.apache.org/jira/browse/CAMEL-6101
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-cache
>    Affects Versions: 2.10.3
>            Reporter: Alexandre Gattiker
>            Assignee: Willem Jiang
>             Fix For: 2.10.4, 2.11.0, 2.9.5
>
>
> Similar to CAMEL-5950, but only occurs at lazy cache initialization.
> {code}
> 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]
> {code}
> Workaround:
> {code}
> 		for (Endpoint endpoint : context.getEndpoints()) {
> 			if (endpoint instanceof CacheEndpoint) {
> 				CacheEndpoint ce = (CacheEndpoint) endpoint;
> 				ce.initializeCache();
> 			}
> 		}
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira