[infinispan-issues] [JBoss JIRA] (ISPN-6408) ClassCastException while executed javascript returns Integer to js-client
Galder Zamarreño (JIRA)
issues at jboss.org
Fri Apr 15 05:24:00 EDT 2016
[ https://issues.jboss.org/browse/ISPN-6408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Galder Zamarreño updated ISPN-6408:
-----------------------------------
Status: Pull Request Sent (was: Coding In Progress)
Git Pull Request: https://github.com/infinispan/infinispan/pull/4242
> ClassCastException while executed javascript returns Integer to js-client
> -------------------------------------------------------------------------
>
> Key: ISPN-6408
> URL: https://issues.jboss.org/browse/ISPN-6408
> Project: Infinispan
> Issue Type: Bug
> Components: Remote Protocols
> Reporter: Anna Manukyan
> Assignee: Galder Zamarreño
> Fix For: 9.0.0.Alpha2, 9.0.0.Final
>
>
> In case if the javascript returns number, the execution of it over js-client, returns the following error:
> {code}
> Message:
> java.lang.ClassCastException: java.lang.Integer cannot be cast to [B
> Stacktrace:
> undefined
> The code is:
> // mode=local,language=javascript,datatype='text/plain; charset=utf-8'
> cache.size()
> The verifying test is:
> it('can execute a script remotely to get node address from cacheManager', function(done) {
> Promise.all([client, readFile('spec/utils/test-cacheManager.js')])
> .then(function(vals) {
> var c = vals[0];
> return c.addScript('test-cacheManager.js', vals[1].toString())
> .then(function() { return c; } );
> })
> .then(t.assert(t.exec('test-cacheManager.js'),
> t.toBe(0)))
> .catch(failed(done)).finally(done);
> });
> {code}
> There is no exception on server side. Also please find below the log of the node.js execution:
> {code}
> [2016-03-18 18:10:53.848] [DEBUG] connection - Connecting to 127.0.0.1:11222
> [2016-03-18 18:10:53.849] [DEBUG] connection - Connected to 127.0.0.1:11222
> [2016-03-18 18:10:53.849] [DEBUG] client - Invoke ping(msgId=186)
> [2016-03-18 18:10:53.849] [TRACE] encoder - Encode operation with topology id 0
> [2016-03-18 18:10:53.849] [TRACE] transport - Write buffer(msgId=186) to 127.0.0.1:11222
> [2016-03-18 18:10:53.852] [TRACE] decoder - Read header(msgId=186): opCode=24, status=6, hasNewTopology=0
> [2016-03-18 18:10:53.852] [TRACE] decoder - Call decode for request(msgId=186)
> [2016-03-18 18:10:53.852] [TRACE] connection - After decoding request(msgId=186), buffer size is 6, and offset 6
> [2016-03-18 18:10:53.852] [TRACE] connection - Complete success for request(msgId=186) with undefined
> [2016-03-18 18:10:53.852] [DEBUG] client - Invoke put(msgId=187,key=>test-cacheManager.js,value=>S// mode=local,language=javascript,datatype='text/plain; charset=utf-8'
> cache.size(),opts=undefined)
> [2016-03-18 18:10:53.853] [TRACE] encoder - Encode operation with topology id 0
> [2016-03-18 18:10:53.853] [TRACE] transport - Write buffer(msgId=187) to 127.0.0.1:11222
> [2016-03-18 18:10:53.854] [TRACE] decoder - Read header(msgId=187): opCode=2, status=6, hasNewTopology=0
> [2016-03-18 18:10:53.854] [TRACE] decoder - Call decode for request(msgId=187)
> [2016-03-18 18:10:53.854] [TRACE] connection - After decoding request(msgId=187), buffer size is 6, and offset 6
> [2016-03-18 18:10:53.854] [TRACE] connection - Complete success for request(msgId=187) with undefined
> [2016-03-18 18:10:53.854] [DEBUG] client - Invoke execute(msgId=188,scriptName=test-cacheManager.js,params=undefined)
> [2016-03-18 18:10:53.855] [TRACE] encoder - Encode operation with topology id 0
> [2016-03-18 18:10:53.855] [TRACE] transport - Write buffer(msgId=188) to 127.0.0.1:11222
> [2016-03-18 18:10:53.855] [DEBUG] connection - Disconnected from 127.0.0.1:11222
> [2016-03-18 18:10:53.858] [TRACE] decoder - Read header(msgId=188): opCode=80, status=133, hasNewTopology=0
> [2016-03-18 18:10:53.858] [ERROR] decoder - Error decoding body of request(msgId=188): java.lang.ClassCastException: java.lang.Integer cannot be cast to [B
> [2016-03-18 18:10:53.859] [TRACE] connection - After decoding request(msgId=188), buffer size is 75, and offset 75
> [2016-03-18 18:10:53.859] [TRACE] connection - Complete failure for request(msgId=188) with java.lang.ClassCastException: java.lang.Integer cannot be cast to [B
> [2016-03-18 18:10:53.869] [DEBUG] client - Invoke clear(msgId=189)
> [2016-03-18 18:10:53.869] [TRACE] encoder - Encode operation with topology id 0
> [2016-03-18 18:10:53.869] [TRACE] transport - Write buffer(msgId=189) to 127.0.0.1:11222
> [2016-03-18 18:10:53.869] [TRACE] decoder - Read header(msgId=189): opCode=20, status=0, hasNewTopology=0
> [2016-03-18 18:10:53.869] [TRACE] decoder - Call decode for request(msgId=189)
> [2016-03-18 18:10:53.869] [TRACE] connection - After decoding request(msgId=189), buffer size is 6, and offset 6
> [2016-03-18 18:10:53.869] [TRACE] connection - Complete success for request(msgId=189) with undefined
> [2016-03-18 18:10:53.878] [DEBUG] connection - Disconnected from 127.0.0.1:11222
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the infinispan-issues
mailing list