[infinispan-issues] [JBoss JIRA] (ISPN-6411) Marshalled value is returned while executing javascript and returning value from cache over HotRod client

Galder Zamarreño (JIRA) issues at jboss.org
Fri Apr 15 11:04:00 EDT 2016


     [ https://issues.jboss.org/browse/ISPN-6411?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Galder Zamarreño updated ISPN-6411:
-----------------------------------
              Status: Pull Request Sent  (was: Coding In Progress)
    Git Pull Request: https://github.com/infinispan/infinispan/pull/4246


> Marshalled value is returned while executing javascript and returning value from cache over HotRod client
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: ISPN-6411
>                 URL: https://issues.jboss.org/browse/ISPN-6411
>             Project: Infinispan
>          Issue Type: Bug
>          Components: Remote Protocols
>    Affects Versions: 8.2.1.Final
>            Reporter: Anna Manukyan
>            Assignee: Galder Zamarreño
>             Fix For: 9.0.0.Alpha2, 9.0.0.Final
>
>
> When trying to execute a script over hotrod-client, which puts some data to the cache and returns it, the test fails with the following exception:
> {code}
> java.lang.ClassCastException: [B cannot be cast to java.lang.String
> 	at org.infinispan.client.hotrod.ExecTest.testRemoteScriptRemoteExecution(ExecTest.java:122)
> 	...
> {code}
> The test code and javascript code are:
> {code}
> @Test
>    public void testRemoteScriptRemoteExecution() throws IOException {
>       String cacheName = "testRemoteScriptRemoteExecution_REPL_SYNC";
>       ConfigurationBuilder builder = getDefaultClusteredCacheConfig(CacheMode.REPL_SYNC, true);
>       builder.dataContainer().keyEquivalence(new AnyServerEquivalence()).valueEquivalence(new AnyServerEquivalence()).compatibility().enable().marshaller(new GenericJBossMarshaller());
>       defineInAll(cacheName, builder);
>       try (InputStream is = this.getClass().getResourceAsStream("/test1.js")) {
>          String script = TestingUtil.loadFileAsString(is);
>          clients.get(0).getCache(SCRIPT_CACHE).put("testRemoteScriptRemoteExecution.js", script);
>       }
>       Map<String, String> params = new HashMap<>();
>       String result = clients.get(0).getCache(cacheName).execute("testRemoteScriptRemoteExecution.js", params);    //<- The exception is thrown here while casting to String
>       assertEquals("hoptimus prime", result);
>       assertEquals("hoptimus prime", clients.get(0).getCache(cacheName).get("a"));
>    }
> //test1.js
> // mode=local,language=javascript
> cache.put("a", "hoptimus prime");
> cache.get("a");
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)



More information about the infinispan-issues mailing list