[JBoss JIRA] (ISPN-6407) java.io.UTFDataFormatException while putting to cache using cacheManager.getCache() over javascript
by Galder Zamarreño (JIRA)
[ https://issues.jboss.org/browse/ISPN-6407?page=com.atlassian.jira.plugin.... ]
Galder Zamarreño commented on ISPN-6407:
----------------------------------------
Actually, adding such validation would be a pain and TBH, there's no reason the user should be trying to open a client to that cache since it already has the {{addScript}} to take care of that.
> java.io.UTFDataFormatException while putting to cache using cacheManager.getCache() over javascript
> ---------------------------------------------------------------------------------------------------
>
> Key: ISPN-6407
> URL: https://issues.jboss.org/browse/ISPN-6407
> Project: Infinispan
> Issue Type: Bug
> Components: Remote Protocols
> Reporter: Anna Manukyan
> Assignee: Galder Zamarreño
>
> The following exception is thrown while execution the following javascript in local mode:
> {code}
> // mode=local,language=javascript,datatype='text/plain; charset=utf-8'
> cacheManager.getCache().put("a", "a");
> cacheManager.getCache().get("a")
> 18:00:24,666 ERROR [org.infinispan.interceptors.InvocationContextInterceptor] (HotRodServerWorker-7-128) ISPN000136: Error executing command PutKeyValueCommand, writing keys [test-cacheManager.js]: java.io.UTFDataFormatException: Invalid byte
> at org.jboss.marshalling.UTFUtils.readUTFBytes(UTFUtils.java:162)
> at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:285)
> at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:209)
> at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:41)
> at org.infinispan.commons.marshall.jboss.AbstractJBossMarshaller.objectFromObjectStream(AbstractJBossMarshaller.java:134)
> at org.infinispan.commons.marshall.jboss.AbstractJBossMarshaller.objectFromByteBuffer(AbstractJBossMarshaller.java:112)
> at org.infinispan.commons.marshall.AbstractMarshaller.objectFromByteBuffer(AbstractMarshaller.java:82)
> at org.infinispan.server.hotrod.HotRodTypeConverter.unmarshall(HotRodTypeConverter.scala:38)
> at org.infinispan.server.hotrod.HotRodTypeConverter.boxValue(HotRodTypeConverter.scala:22)
> at org.infinispan.interceptors.compat.BaseTypeConverterInterceptor.visitPutKeyValueCommand(BaseTypeConverterInterceptor.java:86)
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:78)
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
> at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:110)
> at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:79)
> at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:43)
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:78)
> at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:335)
> at org.infinispan.cache.impl.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1658)
> at org.infinispan.cache.impl.CacheImpl.putInternal(CacheImpl.java:1107)
> at org.infinispan.cache.impl.CacheImpl.put(CacheImpl.java:1097)
> at org.infinispan.cache.impl.DecoratedCache.put(DecoratedCache.java:540)
> at org.infinispan.cache.impl.AbstractDelegatingAdvancedCache.put(AbstractDelegatingAdvancedCache.java:229)
> at org.infinispan.server.hotrod.CacheDecodeContext.put(CacheDecodeContext.scala:211)
> at org.infinispan.server.hotrod.HotRodDecoder.org$infinispan$server$hotrod$HotRodDecoder$$decodeValue(HotRodDecoder.scala:145)
> at org.infinispan.server.hotrod.HotRodDecoder$$anonfun$decode$1.apply$mcV$sp(HotRodDecoder.scala:55)
> at org.infinispan.server.hotrod.HotRodDecoder.wrapSecurity(HotRodDecoder.scala:224)
> at org.infinispan.server.hotrod.HotRodDecoder.decode(HotRodDecoder.scala:50)
> at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:370)
> at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:168)
> at org.infinispan.server.hotrod.HotRodDecoder.org$infinispan$server$core$transport$StatsChannelHandler$$super$channelRead(HotRodDecoder.scala:32)
> at org.infinispan.server.core.transport.StatsChannelHandler$class.channelRead(StatsChannelHandler.scala:32)
> at org.infinispan.server.hotrod.HotRodDecoder.channelRead(HotRodDecoder.scala:32)
> at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
> at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
> at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846)
> at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:130)
> at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
> at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
> at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
> at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
> at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
> at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
> at java.lang.Thread.run(Thread.java:745)
> {code}
> If the javascript is changed to be:
> {code}
> // mode=local,language=javascript,datatype='text/plain; charset=utf-8'
> cache.put("a", "a");
> cache.get("a")
> {code}
> then everything works fine.
> The test verifying this use case is:
> {code}
> 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('a')))
> .catch(failed(done)).finally(done);
> });
> {code}
> UPDATE:
> The exception is thrown not only in case of cacheManager usage. It is also thrown while using marshaller, or adding a simple line in the executed script like:
> var a = null;
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 11 months
[JBoss JIRA] (ISPN-6407) java.io.UTFDataFormatException while putting to cache using cacheManager.getCache() over javascript
by Galder Zamarreño (JIRA)
[ https://issues.jboss.org/browse/ISPN-6407?page=com.atlassian.jira.plugin.... ]
Galder Zamarreño resolved ISPN-6407.
------------------------------------
Resolution: Migrated to another ITS
> java.io.UTFDataFormatException while putting to cache using cacheManager.getCache() over javascript
> ---------------------------------------------------------------------------------------------------
>
> Key: ISPN-6407
> URL: https://issues.jboss.org/browse/ISPN-6407
> Project: Infinispan
> Issue Type: Bug
> Components: Remote Protocols
> Reporter: Anna Manukyan
> Assignee: Galder Zamarreño
>
> The following exception is thrown while execution the following javascript in local mode:
> {code}
> // mode=local,language=javascript,datatype='text/plain; charset=utf-8'
> cacheManager.getCache().put("a", "a");
> cacheManager.getCache().get("a")
> 18:00:24,666 ERROR [org.infinispan.interceptors.InvocationContextInterceptor] (HotRodServerWorker-7-128) ISPN000136: Error executing command PutKeyValueCommand, writing keys [test-cacheManager.js]: java.io.UTFDataFormatException: Invalid byte
> at org.jboss.marshalling.UTFUtils.readUTFBytes(UTFUtils.java:162)
> at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:285)
> at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:209)
> at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:41)
> at org.infinispan.commons.marshall.jboss.AbstractJBossMarshaller.objectFromObjectStream(AbstractJBossMarshaller.java:134)
> at org.infinispan.commons.marshall.jboss.AbstractJBossMarshaller.objectFromByteBuffer(AbstractJBossMarshaller.java:112)
> at org.infinispan.commons.marshall.AbstractMarshaller.objectFromByteBuffer(AbstractMarshaller.java:82)
> at org.infinispan.server.hotrod.HotRodTypeConverter.unmarshall(HotRodTypeConverter.scala:38)
> at org.infinispan.server.hotrod.HotRodTypeConverter.boxValue(HotRodTypeConverter.scala:22)
> at org.infinispan.interceptors.compat.BaseTypeConverterInterceptor.visitPutKeyValueCommand(BaseTypeConverterInterceptor.java:86)
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:78)
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
> at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:110)
> at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:79)
> at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:43)
> at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:78)
> at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:335)
> at org.infinispan.cache.impl.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1658)
> at org.infinispan.cache.impl.CacheImpl.putInternal(CacheImpl.java:1107)
> at org.infinispan.cache.impl.CacheImpl.put(CacheImpl.java:1097)
> at org.infinispan.cache.impl.DecoratedCache.put(DecoratedCache.java:540)
> at org.infinispan.cache.impl.AbstractDelegatingAdvancedCache.put(AbstractDelegatingAdvancedCache.java:229)
> at org.infinispan.server.hotrod.CacheDecodeContext.put(CacheDecodeContext.scala:211)
> at org.infinispan.server.hotrod.HotRodDecoder.org$infinispan$server$hotrod$HotRodDecoder$$decodeValue(HotRodDecoder.scala:145)
> at org.infinispan.server.hotrod.HotRodDecoder$$anonfun$decode$1.apply$mcV$sp(HotRodDecoder.scala:55)
> at org.infinispan.server.hotrod.HotRodDecoder.wrapSecurity(HotRodDecoder.scala:224)
> at org.infinispan.server.hotrod.HotRodDecoder.decode(HotRodDecoder.scala:50)
> at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:370)
> at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:168)
> at org.infinispan.server.hotrod.HotRodDecoder.org$infinispan$server$core$transport$StatsChannelHandler$$super$channelRead(HotRodDecoder.scala:32)
> at org.infinispan.server.core.transport.StatsChannelHandler$class.channelRead(StatsChannelHandler.scala:32)
> at org.infinispan.server.hotrod.HotRodDecoder.channelRead(HotRodDecoder.scala:32)
> at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
> at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
> at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846)
> at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:130)
> at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
> at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
> at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
> at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
> at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
> at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
> at java.lang.Thread.run(Thread.java:745)
> {code}
> If the javascript is changed to be:
> {code}
> // mode=local,language=javascript,datatype='text/plain; charset=utf-8'
> cache.put("a", "a");
> cache.get("a")
> {code}
> then everything works fine.
> The test verifying this use case is:
> {code}
> 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('a')))
> .catch(failed(done)).finally(done);
> });
> {code}
> UPDATE:
> The exception is thrown not only in case of cacheManager usage. It is also thrown while using marshaller, or adding a simple line in the executed script like:
> var a = null;
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 11 months
[JBoss JIRA] (HRJS-4) java.io.UTFDataFormatException when the executed script exceeds 128 chars
by Galder Zamarreño (JIRA)
Galder Zamarreño created HRJS-4:
-----------------------------------
Summary: java.io.UTFDataFormatException when the executed script exceeds 128 chars
Key: HRJS-4
URL: https://issues.jboss.org/browse/HRJS-4
Project: Infinispan Javascript client
Issue Type: Bug
Reporter: Galder Zamarreño
When converting a String into JBoss String (e.g. to pass add the script file itself), the final step after encoding the JBoss String itself is to convert the buffer into String. This was done because only String key/values were supported but doing such conversion added some extra bytes to the payload, generating an incorrect String which resulted in a {{java.io.UTFDataFormatException}} exception.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 11 months
[JBoss JIRA] (ISPN-6528) wrong layout of backup site name in cache continer
by Martin Vrabel (JIRA)
Martin Vrabel created ISPN-6528:
-----------------------------------
Summary: wrong layout of backup site name in cache continer
Key: ISPN-6528
URL: https://issues.jboss.org/browse/ISPN-6528
Project: Infinispan
Issue Type: Bug
Components: Console
Affects Versions: 8.2.1.Final
Reporter: Martin Vrabel
Priority: Minor
<backups>
<backup site="TestBackupNameOne" strategy="SYNC"/>
<backup site="TestBackupNameTwo" strategy="SYNC"/>
</backups>
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 11 months