[JBoss JIRA] (ISPN-3153) REST endpoint does not return Last-modified header for GET operation if the entry was stored via HotRod or Embedded cache
by Martin Gencur (JIRA)
[ https://issues.jboss.org/browse/ISPN-3153?page=com.atlassian.jira.plugin.... ]
Martin Gencur commented on ISPN-3153:
-------------------------------------
Hmm, the ImmortalCacheEntry returns -1 when getCreated() is called. OTOH, MortalCacheEntry returns cacheValue.created; I don't know whether it has some other consequences but to me it seems that the "creation" should not be affected whether we use ImmortalCacheEntry or MortalCacheEntry. WDYT? Changing this to cacheValue.created for the ImmortalCacheEntry fixes this particular issue (referred to as "another observation" in the issues' description).
> REST endpoint does not return Last-modified header for GET operation if the entry was stored via HotRod or Embedded cache
> -------------------------------------------------------------------------------------------------------------------------
>
> Key: ISPN-3153
> URL: https://issues.jboss.org/browse/ISPN-3153
> Project: Infinispan
> Issue Type: Bug
> Components: Server
> Affects Versions: 5.3.0.Beta2
> Reporter: Martin Gencur
> Assignee: Galder Zamarreño
> Fix For: 5.3.0.Final
>
>
> When an entry is stored via HotRod an embedded cache, and later retrieved via REST,the Last-modified header looks like this:
> Last Modified: null
> Another observation is that when the entry is stored via REST and retrieved via REST again, the Last-modified header is:
> Last-Modified: Thu, 01 Jan 1970 00:00:00 GMT
> This is obviously wrong and this was working correctly with JDG-server which contained ISPN 5.2. OTOH, when I set "timeToLiveSeconds" header on the request, the Last-modified is properly set (not to 1970).
--
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
12 years, 5 months
[JBoss JIRA] (ISPN-3152) Configuration update
by Marta Sedlakova (JIRA)
[ https://issues.jboss.org/browse/ISPN-3152?page=com.atlassian.jira.plugin.... ]
Marta Sedlakova commented on ISPN-3152:
---------------------------------------
Is there any workaround for this issue?
> Configuration update
> --------------------
>
> Key: ISPN-3152
> URL: https://issues.jboss.org/browse/ISPN-3152
> Project: Infinispan
> Issue Type: Bug
> Components: Configuration
> Affects Versions: 5.2.1.Final
> Reporter: Marta Sedlakova
> Assignee: Tristan Tarrant
> Fix For: 5.3.0.Final
>
>
> Hello,
>
> I am upgrading infinispan configuration and I have following problem:
> In old configuration, we use:
> Configuration config;
> JdbmCacheStoreConfig storeConfig = new JdbmCacheStoreConfig();
> storeConfig.setLocation(location);
> storeConfig.setCacheLoaderClassName("org.infinispan.loaders.jdbm.JdbmCacheStore");
> storeConfig.setFetchPersistentState(true);
> storeConfig.setIgnoreModifications(false);
> storeConfig.setPurgeOnStartup(false);
> config = lc.addCacheLoader(storeConfig).build();
>
> manager = new DefaultCacheManager(new GlobalConfiguration(), config);
> Configuration c = manager.getDefaultConfiguration();
> c.setEvictionMaxEntries(maxEntries);
> c.setExpirationLifespan(lifespan);
> manager.defineConfiguration(name, c);
> And this works fine. Now I am updating to new configuration:
> ConfigurationBuilder configuration = new ConfigurationBuilder();
> configuration.invocationBatching().enable();
> JdbmCacheStoreConfigurationBuilder builder = new JdbmCacheStoreConfigurationBuilder(configuration.loaders());
> builder.location(location).fetchPersistentState(true);
> configuration.loaders().addStore(builder);
> manager = new DefaultCacheManager(new GlobalConfigurationBuilder().build(), configuration.build());
>
> And I want to change some properties from previous default configuration for named cache:
>
> ConfigurationBuilder builder = new ConfigurationBuilder();
> builder.read(manager.getDefaultCacheConfiguration());
> builder.eviction().maxEntries(maxEntries));
> builder.expiration().lifespan(lifespan);
> manager.defineConfiguration(name, builder.build());
> Cache<String, Object> cache = manager.getCache(name);
> cache.start();
>
> But I got following exception:
>
> org.infinispan.CacheException: Unable to invoke method public void org.infinispan.loaders.CacheLoaderManagerImpl.start() on object of type CacheLoaderManagerImpl
> at org.infinispan.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:205)
> at org.infinispan.factories.AbstractComponentRegistry$PrioritizedMethod.invoke(AbstractComponentRegistry.java:883)
> at org.infinispan.factories.AbstractComponentRegistry.invokeStartMethods(AbstractComponentRegistry.java:654)
> at org.infinispan.factories.AbstractComponentRegistry.internalStart(AbstractComponentRegistry.java:643)
> at org.infinispan.factories.AbstractComponentRegistry.start(AbstractComponentRegistry.java:546)
> at org.infinispan.factories.ComponentRegistry.start(ComponentRegistry.java:199)
> at org.infinispan.CacheImpl.start(CacheImpl.java:559)
> at org.infinispan.manager.DefaultCacheManager.wireAndStartCache(DefaultCacheManager.java:686)
> at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:649)
> at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:545)
> at eu.ysoft.cache.ifspn.replicator.IfspnReplicationBuffer.start(IfspnReplicationBuffer.java:117)
> at eu.ysoft.cache.replicator.ReplicatorImpl.start(ReplicatorImpl.java:373)
> at eu.ysoft.cache.replicator.ReplicatorImpl.start(ReplicatorImpl.java:233)
> at eu.ysoft.cache.ifspn.replicator.helpers.IfspnReplicationClient.start(IfspnReplicationClient.java:46)
> at eu.ysoft.cache.ifspn.replicator.functional.IfspnTestSimpleReplications.init(IfspnTestSimpleReplications.java:54)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
> at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:525)
> at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:202)
> at org.testng.internal.Invoker.invokeMethod(Invoker.java:613)
> at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:842)
> at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1166)
> at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
> at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
> at org.testng.TestRunner.runWorkers(TestRunner.java:1178)
> at org.testng.TestRunner.privateRun(TestRunner.java:757)
> at org.testng.TestRunner.run(TestRunner.java:608)
> at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
> at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
> at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
> at org.testng.SuiteRunner.run(SuiteRunner.java:240)
> at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
> at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
> at org.testng.TestNG.runSuitesSequentially(TestNG.java:1158)
> at org.testng.TestNG.runSuitesLocally(TestNG.java:1083)
> at org.testng.TestNG.run(TestNG.java:999)
> at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
> at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:203)
> at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:174)
> at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:111)
> Caused by: org.infinispan.CacheException: Unable to start cache loaders
> at org.infinispan.loaders.CacheLoaderManagerImpl.start(CacheLoaderManagerImpl.java:160)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.infinispan.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:203)
> ... 42 more
> Caused by: java.lang.Exception: Invalid cache loader configuration!! Only ONE cache loader may have fetchPersistentState set to true. Cache will not start!
> at org.infinispan.loaders.CacheLoaderManagerImpl.createCacheLoader(CacheLoaderManagerImpl.java:324)
> at org.infinispan.loaders.CacheLoaderManagerImpl.start(CacheLoaderManagerImpl.java:146)
> ... 47 more
>
>
> I need some help how to solve this issue, when we were using the old deprecated configuration, this configuration scenarion works.
> Thanks
> Marta
--
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
12 years, 5 months
[JBoss JIRA] (ISPN-3154) REST endpoint does not return correct Expiry header for GET opeartion when the key is stored via HotRod or embedded cache
by Martin Gencur (JIRA)
[ https://issues.jboss.org/browse/ISPN-3154?page=com.atlassian.jira.plugin.... ]
Martin Gencur edited comment on ISPN-3154 at 5/30/13 7:47 AM:
--------------------------------------------------------------
And it also fixes https://issues.jboss.org/browse/ISPN-3153 partially. It does not fix the issue with incorrect date (1970) when the entry is stored via REST.
was (Author: mgencur):
And it also fixes https://issues.jboss.org/browse/ISPN-3153 :)
> REST endpoint does not return correct Expiry header for GET opeartion when the key is stored via HotRod or embedded cache
> -------------------------------------------------------------------------------------------------------------------------
>
> Key: ISPN-3154
> URL: https://issues.jboss.org/browse/ISPN-3154
> Project: Infinispan
> Issue Type: Bug
> Components: Server
> Affects Versions: 5.3.0.Beta2
> Reporter: Martin Gencur
> Assignee: Galder Zamarreño
> Fix For: 5.3.0.Final
>
>
> The expiry header is not sent back at all if the entry was stored via HotRod or Embedded cache. It is sent back correctly only if the entry was stored via REST with timToLiveSeconds set.
> The following test fails if added to EmbeddedRestHotRodTest class:
> {code:java}
> public void testHotRodEmbeddedPutRestGetExpiry() throws Exception {
> final String key = "8";
> final String key2 = "9";
> // 1. Put with HotRod
> assertEquals(null, cacheFactory.getHotRodCache().put(key, "v1", 5, TimeUnit.SECONDS));
> // 2. Put with Embedded
> assertEquals(null, cacheFactory.getEmbeddedCache().put(key2, "v2", 5, TimeUnit.SECONDS));
> // 3. Get with REST key
> HttpMethod get1 = new GetMethod(cacheFactory.getRestUrl() + "/" + key);
> cacheFactory.getRestClient().executeMethod(get1);
> assertEquals(HttpServletResponse.SC_OK, get1.getStatusCode());
> assertNotNull(get1.getResponseHeader("Expires"));
> //^^^fails here - returns null
> // 4. Get with REST key2
> HttpMethod get2 = new GetMethod(cacheFactory.getRestUrl() + "/" + key2);
> cacheFactory.getRestClient().executeMethod(get2);
> assertEquals(HttpServletResponse.SC_OK, get2.getStatusCode());
> assertNotNull(get2.getResponseHeader("Expires"));
> //^^^fails here - returns null
> }
> {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
12 years, 5 months
[JBoss JIRA] (ISPN-3149) Unexpected reporting of no live owners
by Mircea Markus (JIRA)
[ https://issues.jboss.org/browse/ISPN-3149?page=com.atlassian.jira.plugin.... ]
Mircea Markus commented on ISPN-3149:
-------------------------------------
[~mlinhard]can you please add some context to bug's description? E.g. what does the test do and if it's only a reporting/log issue or the data is actually lost. This helps assessing the severity of the bug and also help other people that run in the same issue.
> Unexpected reporting of no live owners
> --------------------------------------
>
> Key: ISPN-3149
> URL: https://issues.jboss.org/browse/ISPN-3149
> Project: Infinispan
> Issue Type: Bug
> Components: State transfer
> Affects Versions: 5.3.0.Beta2
> Reporter: Michal Linhard
> Assignee: Mircea Markus
>
> Running a four node test with infinispan-server 5.3.0-SNAPSHOT
> produces following errors:
> {code}
> 08:46:22,962 TRACE [org.infinispan.statetransfer.StateTransferManagerImpl] (MSC service thread 1-3) Starting StateTransferManager of cache testCache on node node01/default
> 08:46:22,969 TRACE [org.infinispan.statetransfer.StateTransferManagerImpl] (MSC service thread 1-3) Installing new cache topology CacheTopology{id=0, currentCH=DefaultConsistentHash{numSegments=40, numOwners=2, members=[node01/default]}, pendingCH=null} on cache testCache
> 08:46:22,972 TRACE [org.infinispan.statetransfer.StateConsumerImpl] (MSC service thread 1-3) Received new topology for cache testCache, isRebalance = false, isMember = true, topology = CacheTopology{id=0, currentCH=DefaultConsistentHash{numSegments=40, numOwners=2, members=[node01/default]}, pendingCH=null}
> 08:46:22,972 TRACE [org.infinispan.statetransfer.StateTransferLockImpl] (MSC service thread 1-3) Signalling topology 0 is installed
> 08:46:22,973 TRACE [org.infinispan.statetransfer.StateConsumerImpl] (MSC service thread 1-3) On cache testCache we have: added segments: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 16, 19, 18, 21, 20, 23, 22, 25, 24, 27, 26, 29, 28, 31, 30, 34, 35, 32, 33, 38, 39, 36, 37]
> 08:46:22,974 DEBUG [org.infinispan.statetransfer.StateConsumerImpl] (MSC service thread 1-3) Adding inbound state transfer for segments [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 16, 19, 18, 21, 20, 23, 22, 25, 24, 27, 26, 29, 28, 31, 30, 34, 35, 32, 33, 38, 39, 36, 37] of cache testCache
> 08:46:22,974 ERROR [org.infinispan.statetransfer.StateConsumerImpl] (MSC service thread 1-3) ISPN000208: No live owners found for segment 0 of cache testCache. Current owners are: [node01/default]. Faulty owners: []
> 08:46:22,975 ERROR [org.infinispan.statetransfer.StateConsumerImpl] (MSC service thread 1-3) ISPN000208: No live owners found for segment 1 of cache testCache. Current owners are: [node01/default]. Faulty owners: []
> 08:46:22,976 ERROR [org.infinispan.statetransfer.StateConsumerImpl] (MSC service thread 1-3) ISPN000208: No live owners found for segment 2 of cache testCache. Current owners are: [node01/default]. Faulty owners: []
> 08:46:22,976 ERROR [org.infinispan.statetransfer.StateConsumerImpl] (MSC service thread 1-3) ISPN000208: No live owners found for segment 3 of cache testCache. Current owners are: [node01/default]. Faulty owners: []
> 08:46:22,977 ERROR [org.infinispan.statetransfer.StateConsumerImpl] (MSC service thread 1-3) ISPN000208: No live owners found for segment 4 of cache testCache. Current owners are: [node01/default]. Faulty owners: []
> 08:46:22,977 ERROR [org.infinispan.statetransfer.StateConsumerImpl] (MSC service thread 1-3) ISPN000208: No live owners found for segment 5 of cache testCache. Current owners are:
> {code}
> all logs:
> https://jenkins.mw.lab.eng.bos.redhat.com/hudson/user/mlinhard@REDHAT.COM...
> configs:
> https://jenkins.mw.lab.eng.bos.redhat.com/hudson/user/mlinhard@REDHAT.COM...
> infinispan-server build info:
> https://jenkins.mw.lab.eng.bos.redhat.com/hudson/user/mlinhard@REDHAT.COM...
--
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
12 years, 5 months
[JBoss JIRA] (ISPN-3154) REST endpoint does not return correct Expiry header for GET opeartion when the key is stored via HotRod or embedded cache
by Martin Gencur (JIRA)
[ https://issues.jboss.org/browse/ISPN-3154?page=com.atlassian.jira.plugin.... ]
Martin Gencur commented on ISPN-3154:
-------------------------------------
And it also fixes https://issues.jboss.org/browse/ISPN-3153 :)
> REST endpoint does not return correct Expiry header for GET opeartion when the key is stored via HotRod or embedded cache
> -------------------------------------------------------------------------------------------------------------------------
>
> Key: ISPN-3154
> URL: https://issues.jboss.org/browse/ISPN-3154
> Project: Infinispan
> Issue Type: Bug
> Components: Server
> Affects Versions: 5.3.0.Beta2
> Reporter: Martin Gencur
> Assignee: Galder Zamarreño
> Fix For: 5.3.0.Final
>
>
> The expiry header is not sent back at all if the entry was stored via HotRod or Embedded cache. It is sent back correctly only if the entry was stored via REST with timToLiveSeconds set.
> The following test fails if added to EmbeddedRestHotRodTest class:
> {code:java}
> public void testHotRodEmbeddedPutRestGetExpiry() throws Exception {
> final String key = "8";
> final String key2 = "9";
> // 1. Put with HotRod
> assertEquals(null, cacheFactory.getHotRodCache().put(key, "v1", 5, TimeUnit.SECONDS));
> // 2. Put with Embedded
> assertEquals(null, cacheFactory.getEmbeddedCache().put(key2, "v2", 5, TimeUnit.SECONDS));
> // 3. Get with REST key
> HttpMethod get1 = new GetMethod(cacheFactory.getRestUrl() + "/" + key);
> cacheFactory.getRestClient().executeMethod(get1);
> assertEquals(HttpServletResponse.SC_OK, get1.getStatusCode());
> assertNotNull(get1.getResponseHeader("Expires"));
> //^^^fails here - returns null
> // 4. Get with REST key2
> HttpMethod get2 = new GetMethod(cacheFactory.getRestUrl() + "/" + key2);
> cacheFactory.getRestClient().executeMethod(get2);
> assertEquals(HttpServletResponse.SC_OK, get2.getStatusCode());
> assertNotNull(get2.getResponseHeader("Expires"));
> //^^^fails here - returns null
> }
> {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
12 years, 5 months
[JBoss JIRA] (ISPN-3153) REST endpoint does not return Last-modified header for GET operation if the entry was stored via HotRod or Embedded cache
by Martin Gencur (JIRA)
[ https://issues.jboss.org/browse/ISPN-3153?page=com.atlassian.jira.plugin.... ]
Martin Gencur updated ISPN-3153:
--------------------------------
Summary: REST endpoint does not return Last-modified header for GET operation if the entry was stored via HotRod or Embedded cache (was: REST endpoint returns incorrect Last-modified header if the entry was stored via HotRod or Embedded cache)
> REST endpoint does not return Last-modified header for GET operation if the entry was stored via HotRod or Embedded cache
> -------------------------------------------------------------------------------------------------------------------------
>
> Key: ISPN-3153
> URL: https://issues.jboss.org/browse/ISPN-3153
> Project: Infinispan
> Issue Type: Bug
> Components: Server
> Affects Versions: 5.3.0.Beta2
> Reporter: Martin Gencur
> Assignee: Galder Zamarreño
> Fix For: 5.3.0.Final
>
>
> When an entry is stored via HotRod an embedded cache, and later retrieved via REST,the Last-modified header looks like this:
> Last Modified: null
> Another observation is that when the entry is stored via REST and retrieved via REST again, the Last-modified header is:
> Last-Modified: Thu, 01 Jan 1970 00:00:00 GMT
> This is obviously wrong and this was working correctly with JDG-server which contained ISPN 5.2. OTOH, when I set "timeToLiveSeconds" header on the request, the Last-modified is properly set (not to 1970).
--
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
12 years, 5 months
[JBoss JIRA] (ISPN-3154) REST endpoint does not return correct Expiry header when the key is stored via HotRod or embedded cache
by Martin Gencur (JIRA)
[ https://issues.jboss.org/browse/ISPN-3154?page=com.atlassian.jira.plugin.... ]
Martin Gencur commented on ISPN-3154:
-------------------------------------
This problem only appears when using Get requests and String values, it works correctly for Head requests.
Changing this line (https://github.com/infinispan/infinispan/blob/master/server/rest/src/main...) to the following fixes the problem for me:
{code}
case s: String => {
Response.ok(s, "text/plain")
.lastModified(lastMod)
.expires(expires)
.build
}
{code}
> REST endpoint does not return correct Expiry header when the key is stored via HotRod or embedded cache
> -------------------------------------------------------------------------------------------------------
>
> Key: ISPN-3154
> URL: https://issues.jboss.org/browse/ISPN-3154
> Project: Infinispan
> Issue Type: Bug
> Components: Server
> Affects Versions: 5.3.0.Beta2
> Reporter: Martin Gencur
> Assignee: Galder Zamarreño
> Fix For: 5.3.0.Final
>
>
> The expiry header is not sent back at all if the entry was stored via HotRod or Embedded cache. It is sent back correctly only if the entry was stored via REST with timToLiveSeconds set.
> The following test fails if added to EmbeddedRestHotRodTest class:
> {code:java}
> public void testHotRodEmbeddedPutRestGetExpiry() throws Exception {
> final String key = "8";
> final String key2 = "9";
> // 1. Put with HotRod
> assertEquals(null, cacheFactory.getHotRodCache().put(key, "v1", 5, TimeUnit.SECONDS));
> // 2. Put with Embedded
> assertEquals(null, cacheFactory.getEmbeddedCache().put(key2, "v2", 5, TimeUnit.SECONDS));
> // 3. Get with REST key
> HttpMethod get1 = new GetMethod(cacheFactory.getRestUrl() + "/" + key);
> cacheFactory.getRestClient().executeMethod(get1);
> assertEquals(HttpServletResponse.SC_OK, get1.getStatusCode());
> assertNotNull(get1.getResponseHeader("Expires"));
> //^^^fails here - returns null
> // 4. Get with REST key2
> HttpMethod get2 = new GetMethod(cacheFactory.getRestUrl() + "/" + key2);
> cacheFactory.getRestClient().executeMethod(get2);
> assertEquals(HttpServletResponse.SC_OK, get2.getStatusCode());
> assertNotNull(get2.getResponseHeader("Expires"));
> //^^^fails here - returns null
> }
> {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
12 years, 5 months
[JBoss JIRA] (ISPN-3154) REST endpoint does not return correct Expiry header for GET opeartion when the key is stored via HotRod or embedded cache
by Martin Gencur (JIRA)
[ https://issues.jboss.org/browse/ISPN-3154?page=com.atlassian.jira.plugin.... ]
Martin Gencur updated ISPN-3154:
--------------------------------
Summary: REST endpoint does not return correct Expiry header for GET opeartion when the key is stored via HotRod or embedded cache (was: REST endpoint does not return correct Expiry header when the key is stored via HotRod or embedded cache)
> REST endpoint does not return correct Expiry header for GET opeartion when the key is stored via HotRod or embedded cache
> -------------------------------------------------------------------------------------------------------------------------
>
> Key: ISPN-3154
> URL: https://issues.jboss.org/browse/ISPN-3154
> Project: Infinispan
> Issue Type: Bug
> Components: Server
> Affects Versions: 5.3.0.Beta2
> Reporter: Martin Gencur
> Assignee: Galder Zamarreño
> Fix For: 5.3.0.Final
>
>
> The expiry header is not sent back at all if the entry was stored via HotRod or Embedded cache. It is sent back correctly only if the entry was stored via REST with timToLiveSeconds set.
> The following test fails if added to EmbeddedRestHotRodTest class:
> {code:java}
> public void testHotRodEmbeddedPutRestGetExpiry() throws Exception {
> final String key = "8";
> final String key2 = "9";
> // 1. Put with HotRod
> assertEquals(null, cacheFactory.getHotRodCache().put(key, "v1", 5, TimeUnit.SECONDS));
> // 2. Put with Embedded
> assertEquals(null, cacheFactory.getEmbeddedCache().put(key2, "v2", 5, TimeUnit.SECONDS));
> // 3. Get with REST key
> HttpMethod get1 = new GetMethod(cacheFactory.getRestUrl() + "/" + key);
> cacheFactory.getRestClient().executeMethod(get1);
> assertEquals(HttpServletResponse.SC_OK, get1.getStatusCode());
> assertNotNull(get1.getResponseHeader("Expires"));
> //^^^fails here - returns null
> // 4. Get with REST key2
> HttpMethod get2 = new GetMethod(cacheFactory.getRestUrl() + "/" + key2);
> cacheFactory.getRestClient().executeMethod(get2);
> assertEquals(HttpServletResponse.SC_OK, get2.getStatusCode());
> assertNotNull(get2.getResponseHeader("Expires"));
> //^^^fails here - returns null
> }
> {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
12 years, 5 months
[JBoss JIRA] (ISPN-3152) Configuration update
by Mircea Markus (JIRA)
[ https://issues.jboss.org/browse/ISPN-3152?page=com.atlassian.jira.plugin.... ]
Mircea Markus commented on ISPN-3152:
-------------------------------------
indeed looks like a bug, thanks for reporting.
> Configuration update
> --------------------
>
> Key: ISPN-3152
> URL: https://issues.jboss.org/browse/ISPN-3152
> Project: Infinispan
> Issue Type: Bug
> Components: Configuration
> Affects Versions: 5.2.1.Final
> Reporter: Marta Sedlakova
> Assignee: Tristan Tarrant
> Fix For: 5.3.0.Final
>
>
> Hello,
>
> I am upgrading infinispan configuration and I have following problem:
> In old configuration, we use:
> Configuration config;
> JdbmCacheStoreConfig storeConfig = new JdbmCacheStoreConfig();
> storeConfig.setLocation(location);
> storeConfig.setCacheLoaderClassName("org.infinispan.loaders.jdbm.JdbmCacheStore");
> storeConfig.setFetchPersistentState(true);
> storeConfig.setIgnoreModifications(false);
> storeConfig.setPurgeOnStartup(false);
> config = lc.addCacheLoader(storeConfig).build();
>
> manager = new DefaultCacheManager(new GlobalConfiguration(), config);
> Configuration c = manager.getDefaultConfiguration();
> c.setEvictionMaxEntries(maxEntries);
> c.setExpirationLifespan(lifespan);
> manager.defineConfiguration(name, c);
> And this works fine. Now I am updating to new configuration:
> ConfigurationBuilder configuration = new ConfigurationBuilder();
> configuration.invocationBatching().enable();
> JdbmCacheStoreConfigurationBuilder builder = new JdbmCacheStoreConfigurationBuilder(configuration.loaders());
> builder.location(location).fetchPersistentState(true);
> configuration.loaders().addStore(builder);
> manager = new DefaultCacheManager(new GlobalConfigurationBuilder().build(), configuration.build());
>
> And I want to change some properties from previous default configuration for named cache:
>
> ConfigurationBuilder builder = new ConfigurationBuilder();
> builder.read(manager.getDefaultCacheConfiguration());
> builder.eviction().maxEntries(maxEntries));
> builder.expiration().lifespan(lifespan);
> manager.defineConfiguration(name, builder.build());
> Cache<String, Object> cache = manager.getCache(name);
> cache.start();
>
> But I got following exception:
>
> org.infinispan.CacheException: Unable to invoke method public void org.infinispan.loaders.CacheLoaderManagerImpl.start() on object of type CacheLoaderManagerImpl
> at org.infinispan.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:205)
> at org.infinispan.factories.AbstractComponentRegistry$PrioritizedMethod.invoke(AbstractComponentRegistry.java:883)
> at org.infinispan.factories.AbstractComponentRegistry.invokeStartMethods(AbstractComponentRegistry.java:654)
> at org.infinispan.factories.AbstractComponentRegistry.internalStart(AbstractComponentRegistry.java:643)
> at org.infinispan.factories.AbstractComponentRegistry.start(AbstractComponentRegistry.java:546)
> at org.infinispan.factories.ComponentRegistry.start(ComponentRegistry.java:199)
> at org.infinispan.CacheImpl.start(CacheImpl.java:559)
> at org.infinispan.manager.DefaultCacheManager.wireAndStartCache(DefaultCacheManager.java:686)
> at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:649)
> at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:545)
> at eu.ysoft.cache.ifspn.replicator.IfspnReplicationBuffer.start(IfspnReplicationBuffer.java:117)
> at eu.ysoft.cache.replicator.ReplicatorImpl.start(ReplicatorImpl.java:373)
> at eu.ysoft.cache.replicator.ReplicatorImpl.start(ReplicatorImpl.java:233)
> at eu.ysoft.cache.ifspn.replicator.helpers.IfspnReplicationClient.start(IfspnReplicationClient.java:46)
> at eu.ysoft.cache.ifspn.replicator.functional.IfspnTestSimpleReplications.init(IfspnTestSimpleReplications.java:54)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
> at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:525)
> at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:202)
> at org.testng.internal.Invoker.invokeMethod(Invoker.java:613)
> at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:842)
> at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1166)
> at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
> at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
> at org.testng.TestRunner.runWorkers(TestRunner.java:1178)
> at org.testng.TestRunner.privateRun(TestRunner.java:757)
> at org.testng.TestRunner.run(TestRunner.java:608)
> at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
> at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
> at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
> at org.testng.SuiteRunner.run(SuiteRunner.java:240)
> at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
> at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
> at org.testng.TestNG.runSuitesSequentially(TestNG.java:1158)
> at org.testng.TestNG.runSuitesLocally(TestNG.java:1083)
> at org.testng.TestNG.run(TestNG.java:999)
> at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
> at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:203)
> at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:174)
> at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:111)
> Caused by: org.infinispan.CacheException: Unable to start cache loaders
> at org.infinispan.loaders.CacheLoaderManagerImpl.start(CacheLoaderManagerImpl.java:160)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.infinispan.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:203)
> ... 42 more
> Caused by: java.lang.Exception: Invalid cache loader configuration!! Only ONE cache loader may have fetchPersistentState set to true. Cache will not start!
> at org.infinispan.loaders.CacheLoaderManagerImpl.createCacheLoader(CacheLoaderManagerImpl.java:324)
> at org.infinispan.loaders.CacheLoaderManagerImpl.start(CacheLoaderManagerImpl.java:146)
> ... 47 more
>
>
> I need some help how to solve this issue, when we were using the old deprecated configuration, this configuration scenarion works.
> Thanks
> Marta
--
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
12 years, 5 months
[JBoss JIRA] (ISPN-3152) Configuration update
by Mircea Markus (JIRA)
[ https://issues.jboss.org/browse/ISPN-3152?page=com.atlassian.jira.plugin.... ]
Mircea Markus updated ISPN-3152:
--------------------------------
Assignee: Tristan Tarrant (was: Mircea Markus)
> Configuration update
> --------------------
>
> Key: ISPN-3152
> URL: https://issues.jboss.org/browse/ISPN-3152
> Project: Infinispan
> Issue Type: Bug
> Components: Configuration
> Affects Versions: 5.2.1.Final
> Reporter: Marta Sedlakova
> Assignee: Tristan Tarrant
>
> Hello,
>
> I am upgrading infinispan configuration and I have following problem:
> In old configuration, we use:
> Configuration config;
> JdbmCacheStoreConfig storeConfig = new JdbmCacheStoreConfig();
> storeConfig.setLocation(location);
> storeConfig.setCacheLoaderClassName("org.infinispan.loaders.jdbm.JdbmCacheStore");
> storeConfig.setFetchPersistentState(true);
> storeConfig.setIgnoreModifications(false);
> storeConfig.setPurgeOnStartup(false);
> config = lc.addCacheLoader(storeConfig).build();
>
> manager = new DefaultCacheManager(new GlobalConfiguration(), config);
> Configuration c = manager.getDefaultConfiguration();
> c.setEvictionMaxEntries(maxEntries);
> c.setExpirationLifespan(lifespan);
> manager.defineConfiguration(name, c);
> And this works fine. Now I am updating to new configuration:
> ConfigurationBuilder configuration = new ConfigurationBuilder();
> configuration.invocationBatching().enable();
> JdbmCacheStoreConfigurationBuilder builder = new JdbmCacheStoreConfigurationBuilder(configuration.loaders());
> builder.location(location).fetchPersistentState(true);
> configuration.loaders().addStore(builder);
> manager = new DefaultCacheManager(new GlobalConfigurationBuilder().build(), configuration.build());
>
> And I want to change some properties from previous default configuration for named cache:
>
> ConfigurationBuilder builder = new ConfigurationBuilder();
> builder.read(manager.getDefaultCacheConfiguration());
> builder.eviction().maxEntries(maxEntries));
> builder.expiration().lifespan(lifespan);
> manager.defineConfiguration(name, builder.build());
> Cache<String, Object> cache = manager.getCache(name);
> cache.start();
>
> But I got following exception:
>
> org.infinispan.CacheException: Unable to invoke method public void org.infinispan.loaders.CacheLoaderManagerImpl.start() on object of type CacheLoaderManagerImpl
> at org.infinispan.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:205)
> at org.infinispan.factories.AbstractComponentRegistry$PrioritizedMethod.invoke(AbstractComponentRegistry.java:883)
> at org.infinispan.factories.AbstractComponentRegistry.invokeStartMethods(AbstractComponentRegistry.java:654)
> at org.infinispan.factories.AbstractComponentRegistry.internalStart(AbstractComponentRegistry.java:643)
> at org.infinispan.factories.AbstractComponentRegistry.start(AbstractComponentRegistry.java:546)
> at org.infinispan.factories.ComponentRegistry.start(ComponentRegistry.java:199)
> at org.infinispan.CacheImpl.start(CacheImpl.java:559)
> at org.infinispan.manager.DefaultCacheManager.wireAndStartCache(DefaultCacheManager.java:686)
> at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:649)
> at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:545)
> at eu.ysoft.cache.ifspn.replicator.IfspnReplicationBuffer.start(IfspnReplicationBuffer.java:117)
> at eu.ysoft.cache.replicator.ReplicatorImpl.start(ReplicatorImpl.java:373)
> at eu.ysoft.cache.replicator.ReplicatorImpl.start(ReplicatorImpl.java:233)
> at eu.ysoft.cache.ifspn.replicator.helpers.IfspnReplicationClient.start(IfspnReplicationClient.java:46)
> at eu.ysoft.cache.ifspn.replicator.functional.IfspnTestSimpleReplications.init(IfspnTestSimpleReplications.java:54)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
> at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:525)
> at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:202)
> at org.testng.internal.Invoker.invokeMethod(Invoker.java:613)
> at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:842)
> at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1166)
> at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
> at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
> at org.testng.TestRunner.runWorkers(TestRunner.java:1178)
> at org.testng.TestRunner.privateRun(TestRunner.java:757)
> at org.testng.TestRunner.run(TestRunner.java:608)
> at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
> at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
> at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
> at org.testng.SuiteRunner.run(SuiteRunner.java:240)
> at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
> at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
> at org.testng.TestNG.runSuitesSequentially(TestNG.java:1158)
> at org.testng.TestNG.runSuitesLocally(TestNG.java:1083)
> at org.testng.TestNG.run(TestNG.java:999)
> at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
> at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:203)
> at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:174)
> at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:111)
> Caused by: org.infinispan.CacheException: Unable to start cache loaders
> at org.infinispan.loaders.CacheLoaderManagerImpl.start(CacheLoaderManagerImpl.java:160)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.infinispan.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:203)
> ... 42 more
> Caused by: java.lang.Exception: Invalid cache loader configuration!! Only ONE cache loader may have fetchPersistentState set to true. Cache will not start!
> at org.infinispan.loaders.CacheLoaderManagerImpl.createCacheLoader(CacheLoaderManagerImpl.java:324)
> at org.infinispan.loaders.CacheLoaderManagerImpl.start(CacheLoaderManagerImpl.java:146)
> ... 47 more
>
>
> I need some help how to solve this issue, when we were using the old deprecated configuration, this configuration scenarion works.
> Thanks
> Marta
--
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
12 years, 5 months