[
https://issues.jboss.org/browse/ISPN-4212?page=com.atlassian.jira.plugin....
]
Martin Gencur commented on ISPN-4212:
-------------------------------------
The root cause is following: When a cache is request by hotrod client and the cache is not
among configured caches, a default Infinispan configuration is used (new
ConfigurationBuilder().build()). As a result, the AnyServerEquivalence and some other
settings are not applied. The problem is that Infinispan subsystem in the server does not
set any cache configuration and rather creates every cache by calling
.definedConfiguration on the cache manager (this call ignores default cache
configuration).
We have two options here. The first one is quite easy and I already have a fix.
1) In Infinispan subsystem, pass a default configuration to constructor of
DefaultCacheManager. The default configuration is the one from infinispan-defaults.xml
(it's a local cache!) and we can easily parse it and pass to DefaultCacheManager
2) The first option is not ideal because users can not set the settings in any way
(infinispan-defaults.xml is internal file of the server). Ideally, any new cache that is
not configured in standalone.xml would be configured according to the "default"
cache in that file. It would have the same configuration as default cache. This is tricky
to implement but I'll look if it can be done.
Unable to get entries from newly started non-defined caches
-----------------------------------------------------------
Key: ISPN-4212
URL:
https://issues.jboss.org/browse/ISPN-4212
Project: Infinispan
Issue Type: Bug
Components: Remote Protocols, Server
Reporter: Jakub Markos
Assignee: Galder ZamarreƱo
If you use hotrod to put entries into a cache which is not defined in standalone.xml, it
will be started:
{code}
15:35:50,676 INFO [org.jboss.as.clustering.infinispan] (HotRodServerWorker-1)
JBAS010281: Started nonDefinedCache cache from local container
{code}
but when you try to retrieve the entry back, you'll get null.
{code}
RemoteCacheManager rcm = new RemoteCacheManager(new
ConfigurationBuilder().addServer().host("localhost").port(11222).build());
RemoteCache<String, String> cache = rcm.getCache("nonDefinedCache");
cache.put("key", "value");
cache.get("key"); // returns null
{code}
Happens in the current server snapshot.
A while back you'd get this
{code}
WARN: ISPN004005: Error received from the server:
org.infinispan.server.hotrod.CacheNotFoundException: Cache with name
'nonDefinedCache' not found amongst the configured caches
{code}
So it seems we're somewhere in the middle now (not throwing exception, but also not
working). The documentation here is also wrong
https://github.com/infinispan/infinispan/blob/master/client/hotrod-client...
.
--
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