Hide Forgot
project_key: EDG I was trying out sample client code with infinispan-4.2.1.CR1 {code}package org.example; import org.infinispan.Cache; import org.infinispan.client.hotrod.RemoteCacheManager; public class Sample { public static void main(String[] args) throws Exception { RemoteCacheManager cacheManager = new RemoteCacheManager("localhost:11222"); cacheManager.start(); Cache<String, Object> cache = cacheManager.getCache("namedCache2"); cache.put("key", "value"); Object value = cache.get("key"); cacheManager.stop(); System.out.println(value); } }{code} and accidentaly requested namedCache2 which didn't exist in cache configuration the operation cacheManager.getCache("namedCache2") returns something (not null) and exception is thrown when I try to perform put: {code}Feb 9, 2011 5:52:48 PM org.infinispan.client.hotrod.impl.operations.HotRodOperation checkForErrorsInResponseStatus WARNING: Error status received from the server: for message id 2 Exception in thread "main" org.infinispan.client.hotrod.exceptions.HotRodClientException: id [2] code [133] at org.infinispan.client.hotrod.impl.operations.HotRodOperation.checkForErrorsInResponseStatus(HotRodOperation.java:129) at org.infinispan.client.hotrod.impl.operations.HotRodOperation.readHeaderAndValidate(HotRodOperation.java:98) at org.infinispan.client.hotrod.impl.operations.AbstractKeyValueOperation.sendPutOperation(AbstractKeyValueOperation.java:48) at org.infinispan.client.hotrod.impl.operations.PutOperation.executeOperation(PutOperation.java:27) at org.infinispan.client.hotrod.impl.operations.RetryOnFailureOperation.execute(RetryOnFailureOperation.java:38) at org.infinispan.client.hotrod.impl.RemoteCacheImpl.put(RemoteCacheImpl.java:166) at org.infinispan.CacheSupport.put(CacheSupport.java:28) at org.example.Sample.main(Sample.java:14) {code} it doesn't work in neither standalone hotrod server (./startServer.sh -r hotrod -c '..../infinispan.xml') nor EDG I guess the proper behaviour should be that RemoteCacheManager returns null when asked for nonexistent named cache...
Link: Added: This issue depends ISPN-944
For 4.2.x, it cannot return null cos it'd break API. I'll make the exception more user friendly for this branch. For 5.x, we plan to remove this limitation.