[infinispan-issues] [JBoss JIRA] (ISPN-5286) JSR-107 Support for clustered caches in HotRod implementation

Ion Savin (JIRA) issues at jboss.org
Wed Mar 11 12:11:19 EDT 2015


    [ https://issues.jboss.org/browse/ISPN-5286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13049031#comment-13049031 ] 

Ion Savin edited comment on ISPN-5286 at 3/11/15 12:10 PM:
-----------------------------------------------------------

You can currently use remote jcache in two ways:
1) with the caches preconfigured on the server (including clustered caches)
2) with the caches created through the JCache API but these caches will be local caches and will be created only on the node to which the remote cache is configured to connect (you shouldn't usually use this mode, it's available so that TCK tests can be executed without preconfiguring the caches on the server side but other that that you should use #1).

For #1 don't add org.wildfly:wildfly-controller as a dependency to your project and JCache will not attempt to create the cache on the server (you still need to use cm.createCache() otherwise cm.getCache() will return null).


was (Author: isavin):
You can currently use remote jcache in two ways:
1) with the caches preconfigured on the server (including clustered caches)
2) with the caches created through the JCache API but these caches will be local caches and will be created only on the node to which the remote cache is configured to connect (you shouldn't usually use this mode, it's available so that TCK tests can be executed without preconfiguring the caches on the server side but other that that you should use #1).

For #1 don't add org.wildfly:wildfly-controller as a dependency to your project and JCache will not attempt to create the cache on the server (you still need to use cm.createCache() just cm.getCache() will return null otherwise).

>  JSR-107 Support for clustered caches in HotRod implementation
> --------------------------------------------------------------
>
>                 Key: ISPN-5286
>                 URL: https://issues.jboss.org/browse/ISPN-5286
>             Project: Infinispan
>          Issue Type: Bug
>          Components: JCache
>            Reporter: Matej Čimbora
>
> Current implementation supports only using local caches - usage of different cache types leads to the following exceptions (when using cache which is included in configuration file): 
> Client:
> {code}
> javax.cache.CacheException: ISPN021027: Failed to add local cache 'default' on the server
> 	at org.infinispan.jcache.remote.ServerManager$3.run(ServerManager.java:118)
> 	at org.infinispan.jcache.remote.ServerManager.withManagementClient(ServerManager.java:171)
> 	at org.infinispan.jcache.remote.ServerManager.addCache(ServerManager.java:104)
> 	at org.infinispan.jcache.remote.JCacheManager.create(JCacheManager.java:65)
> 	at org.infinispan.jcache.AbstractJCacheManager.createCache(AbstractJCacheManager.java:94)
> 	at org.infinispan.server.test.jcache.JCacheRemoteIT.testCachingConfiguration(JCacheRemoteIT.java:78)
> {code}
> Server:
> {code}
> 10:47:29,896 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 2) JBAS014612: Operation ("add") failed - address: ([
>     ("subsystem" => "infinispan"),
>     ("cache-container" => "clustered"),
>     ("local-cache" => "default")
> ]): org.jboss.msc.service.DuplicateServiceException: Service jboss.infinispan.clustered.default.config is already registered
> 	at org.jboss.msc.service.ServiceRegistrationImpl.setInstance(ServiceRegistrationImpl.java:158)
> {code}
> Furthermore, when using multiple nodes in the cluster and the cache is not amongst configured caches, it is created as 'local' only on one node (this relates to fact org.infinispan.jcache.remote.ServerManager is configured to use one specific management interface - which is btw hardcoded and cannot be changed). Exception can occur when trying to write into cache.
>   
> Client
> {code}
> javax.cache.CacheException: ISPN021022: Cache named 'custom' was not found.
> 	at org.infinispan.jcache.remote.JCacheManager.create(JCacheManager.java:75)
> 	at org.infinispan.jcache.AbstractJCacheManager.createCache(AbstractJCacheManager.java:94)
> 	at org.infinispan.server.test.jcache.JCacheRemoteIT.testCachingConfiguration(JCacheRemoteIT.java:78)
> {code}
> Server
> {code}
> 10:59:01,034 ERROR [org.infinispan.server.hotrod.HotRodDecoder] (HotRodServerWorker-1) ISPN005003: Exception reported: org.infinispan.server.hotrod.CacheNotFoundException: Cache with name 'custom' not found amongst the configured caches
> 	at org.infinispan.server.hotrod.HotRodDecoder.getCache(HotRodDecoder.scala:102) 
> {code}
> For full logs pease see linked BZ.



--
This message was sent by Atlassian JIRA
(v6.3.11#6341)



More information about the infinispan-issues mailing list