[JBoss JIRA] (IPROTO-33) ClassCastException with Array of Enums
by Gustavo Fernandes (JIRA)
[ https://issues.jboss.org/browse/IPROTO-33?page=com.atlassian.jira.plugin.... ]
Gustavo Fernandes commented on IPROTO-33:
-----------------------------------------
I have a branch with a failing test
https://github.com/gustavonalle/protostream/tree/json
{{ProtobufUtilTest#testArrayofEnum}}
> ClassCastException with Array of Enums
> --------------------------------------
>
> Key: IPROTO-33
> URL: https://issues.jboss.org/browse/IPROTO-33
> Project: Infinispan ProtoStream
> Issue Type: Bug
> Affects Versions: 4.0.0.Alpha5
> Reporter: Gustavo Fernandes
>
> The entity is defined as:
> {code:java}
> public class Account extends BaseMessage {
> public enum Currency {
> EUR, GBP, USD, BRL
> }
> ...
> private Currency[] currencies;
> ...
> }
> {code}
> Protofile:
> {code}
> message Account {
> ...
> /* @TypeId(43) */
> enum Currency {
> EUR = 0;
> GBP = 1;
> ...
> }
> repeated Currency currencies = 6;
> ...
> }
> {code}
> Marshaller:
> {code:java}
> public class AccountMarshaller implements MessageMarshaller<Account> {
> ...
> @Override
> public Account readFrom(ProtoStreamReader reader) throws IOException {
> ...
> Account.Currency[] currencies = reader.readArray("currencies", Account.Currency.class);
> Account account = new Account();
> ...
> account.setCurrencies(currencies);
> return account;
> }
> @Override
> public void writeTo(ProtoStreamWriter writer, Account account) throws IOException {
> ...
> writer.writeArray("currencies", account.getCurrencies(), Account.Currency.class);
> }
> }
> {code}
> When trying to marshal and unmarshall a message:
> {code:java}
> Account account = ...
> SerializationContext context = ...
> byte[] bytes = ProtobufUtil.toWrappedByteArray(context, account);
> // Throws CCE
> Account acc = ProtobufUtil.fromWrappedByteArray(context, bytes);
> {code}
> {noformat}
> java.lang.ClassCastException: java.lang.Long cannot be cast to [B
> at org.infinispan.protostream.impl.ProtoStreamReaderImpl.readCollection(ProtoStreamReaderImpl.java:374)
> at org.infinispan.protostream.impl.ProtoStreamReaderImpl.readArray(ProtoStreamReaderImpl.java:470)
> at org.infinispan.protostream.domain.marshallers.AccountMarshaller.readFrom(AccountMarshaller.java:33)
> at org.infinispan.protostream.domain.marshallers.AccountMarshaller.readFrom(AccountMarshaller.java:14)
> at org.infinispan.protostream.impl.MessageMarshallerDelegate.unmarshall(MessageMarshallerDelegate.java:113)
> at org.infinispan.protostream.WrappedMessage.readMessage(WrappedMessage.java:306)
> at org.infinispan.protostream.ProtobufUtil.fromWrappedByteArray(ProtobufUtil.java:154)
> at org.infinispan.protostream.ProtobufUtil.fromWrappedByteArray(ProtobufUtil.java:149)
> {noformat}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
6 years, 11 months
[JBoss JIRA] (ISPN-7722) NPE in LocalTopologyManagerImpl when undeploying an application
by Ryan Emerson (JIRA)
[ https://issues.jboss.org/browse/ISPN-7722?page=com.atlassian.jira.plugin.... ]
Ryan Emerson resolved ISPN-7722.
--------------------------------
Resolution: Done
> NPE in LocalTopologyManagerImpl when undeploying an application
> ---------------------------------------------------------------
>
> Key: ISPN-7722
> URL: https://issues.jboss.org/browse/ISPN-7722
> Project: Infinispan
> Issue Type: Bug
> Components: Core
> Affects Versions: 9.0.0.Final
> Environment: JBoss 6.3.3.GA & Tomcat 8.5.8
> Reporter: Alexis NICOLAS
> Assignee: William Burns
> Fix For: 9.0.4.Final, 9.1.0.Final
>
>
> When undeploying an application using Infinispan configured with global state disabled from an application server you get the following error:
> {code}
> 2017-04-12 15:54:28.617 WARN o.i.t.CacheTopologyControlCommand:165 - ISPN000071: Caught exception when handling command CacheTopologyControlCommand{cache=XXXXX, type=SHUTDOWN_PERFORM, sender=null, joinInfo=null, topologyId=0, rebalanceId=0, currentCH=null, pendingCH=null, availabilityMode=null, actualMembers=null, throwable=null, viewId=0}
> java.lang.NullPointerException: null
> at org.infinispan.topology.LocalTopologyManagerImpl.handleCacheShutdown(LocalTopologyManagerImpl.java:655)
> at org.infinispan.topology.CacheTopologyControlCommand.doPerform(CacheTopologyControlCommand.java:204)
> at org.infinispan.topology.CacheTopologyControlCommand.invokeAsync(CacheTopologyControlCommand.java:159)
> at org.infinispan.remoting.inboundhandler.GlobalInboundInvocationHandler.invokeReplicableCommand(GlobalInboundInvocationHandler.java:173)
> at org.infinispan.remoting.inboundhandler.GlobalInboundInvocationHandler.runReplicableCommand(GlobalInboundInvocationHandler.java:154)
> at org.infinispan.remoting.inboundhandler.GlobalInboundInvocationHandler.lambda$handleReplicableCommand$1(GlobalInboundInvocationHandler.java:148)
> at org.infinispan.util.concurrent.BlockingTaskAwareExecutorServiceImpl$RunnableWrapper.run(BlockingTaskAwareExecutorServiceImpl.java:203)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> {code}
> It seems to be that in the method handleCacheShutdown(...) method of LocalTopologyManagerImpl a test whether globalStateManager is null is missing.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
6 years, 11 months
[JBoss JIRA] (IPROTO-33) ClassCastException with Array of Enums
by Adrian Nistor (JIRA)
[ https://issues.jboss.org/browse/IPROTO-33?page=com.atlassian.jira.plugin.... ]
Adrian Nistor commented on IPROTO-33:
-------------------------------------
I thought I fixed that already somewhere in my stashes.
> ClassCastException with Array of Enums
> --------------------------------------
>
> Key: IPROTO-33
> URL: https://issues.jboss.org/browse/IPROTO-33
> Project: Infinispan ProtoStream
> Issue Type: Bug
> Affects Versions: 4.0.0.Alpha5
> Reporter: Gustavo Fernandes
>
> The entity is defined as:
> {code:java}
> public class Account extends BaseMessage {
> public enum Currency {
> EUR, GBP, USD, BRL
> }
> ...
> private Currency[] currencies;
> ...
> }
> {code}
> Protofile:
> {code}
> message Account {
> ...
> /* @TypeId(43) */
> enum Currency {
> EUR = 0;
> GBP = 1;
> ...
> }
> repeated Currency currencies = 6;
> ...
> }
> {code}
> Marshaller:
> {code:java}
> public class AccountMarshaller implements MessageMarshaller<Account> {
> ...
> @Override
> public Account readFrom(ProtoStreamReader reader) throws IOException {
> ...
> Account.Currency[] currencies = reader.readArray("currencies", Account.Currency.class);
> Account account = new Account();
> ...
> account.setCurrencies(currencies);
> return account;
> }
> @Override
> public void writeTo(ProtoStreamWriter writer, Account account) throws IOException {
> ...
> writer.writeArray("currencies", account.getCurrencies(), Account.Currency.class);
> }
> }
> {code}
> When trying to marshal and unmarshall a message:
> {code:java}
> Account account = ...
> SerializationContext context = ...
> byte[] bytes = ProtobufUtil.toWrappedByteArray(context, account);
> // Throws CCE
> Account acc = ProtobufUtil.fromWrappedByteArray(context, bytes);
> {code}
> {noformat}
> java.lang.ClassCastException: java.lang.Long cannot be cast to [B
> at org.infinispan.protostream.impl.ProtoStreamReaderImpl.readCollection(ProtoStreamReaderImpl.java:374)
> at org.infinispan.protostream.impl.ProtoStreamReaderImpl.readArray(ProtoStreamReaderImpl.java:470)
> at org.infinispan.protostream.domain.marshallers.AccountMarshaller.readFrom(AccountMarshaller.java:33)
> at org.infinispan.protostream.domain.marshallers.AccountMarshaller.readFrom(AccountMarshaller.java:14)
> at org.infinispan.protostream.impl.MessageMarshallerDelegate.unmarshall(MessageMarshallerDelegate.java:113)
> at org.infinispan.protostream.WrappedMessage.readMessage(WrappedMessage.java:306)
> at org.infinispan.protostream.ProtobufUtil.fromWrappedByteArray(ProtobufUtil.java:154)
> at org.infinispan.protostream.ProtobufUtil.fromWrappedByteArray(ProtobufUtil.java:149)
> {noformat}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
6 years, 11 months
[JBoss JIRA] (ISPN-8073) ConfigurationConverterTest.testConversionAndSerializationFrom60 test failure
by Ryan Emerson (JIRA)
[ https://issues.jboss.org/browse/ISPN-8073?page=com.atlassian.jira.plugin.... ]
Ryan Emerson reassigned ISPN-8073:
----------------------------------
Assignee: Ryan Emerson (was: Tristan Tarrant)
> ConfigurationConverterTest.testConversionAndSerializationFrom60 test failure
> -----------------------------------------------------------------------------
>
> Key: ISPN-8073
> URL: https://issues.jboss.org/browse/ISPN-8073
> Project: Infinispan
> Issue Type: Bug
> Components: Test Suite - Core
> Affects Versions: 9.1.0.Final
> Reporter: Tristan Tarrant
> Assignee: Ryan Emerson
> Fix For: 9.1.1.Final
>
>
> java.lang.AssertionError: expected:<50> but was:<0>
> at org.infinispan.tools.ConfigurationConverterTest.assertPersistenceConverted(ConfigurationConverterTest.java:770)
> at org.infinispan.tools.ConfigurationConverterTest.access$1500(ConfigurationConverterTest.java:50)
> at org.infinispan.tools.ConfigurationConverterTest$1.call(ConfigurationConverterTest.java:88)
> at org.infinispan.test.TestingUtil.withCacheManager(TestingUtil.java:1433)
> at org.infinispan.tools.ConfigurationConverterTest.testConversionAndSerializationFrom60(ConfigurationConverterTest.java:69)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:748)
> ... Removed 21 stack frames
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
6 years, 11 months
[JBoss JIRA] (ISPN-8073) ConfigurationConverterTest.testConversionAndSerializationFrom60 test failure
by Ryan Emerson (JIRA)
[ https://issues.jboss.org/browse/ISPN-8073?page=com.atlassian.jira.plugin.... ]
Ryan Emerson updated ISPN-8073:
-------------------------------
Component/s: Loaders and Stores
> ConfigurationConverterTest.testConversionAndSerializationFrom60 test failure
> -----------------------------------------------------------------------------
>
> Key: ISPN-8073
> URL: https://issues.jboss.org/browse/ISPN-8073
> Project: Infinispan
> Issue Type: Bug
> Components: Loaders and Stores, Test Suite - Core
> Affects Versions: 9.1.0.Final
> Reporter: Tristan Tarrant
> Assignee: Ryan Emerson
> Fix For: 9.1.1.Final
>
>
> java.lang.AssertionError: expected:<50> but was:<0>
> at org.infinispan.tools.ConfigurationConverterTest.assertPersistenceConverted(ConfigurationConverterTest.java:770)
> at org.infinispan.tools.ConfigurationConverterTest.access$1500(ConfigurationConverterTest.java:50)
> at org.infinispan.tools.ConfigurationConverterTest$1.call(ConfigurationConverterTest.java:88)
> at org.infinispan.test.TestingUtil.withCacheManager(TestingUtil.java:1433)
> at org.infinispan.tools.ConfigurationConverterTest.testConversionAndSerializationFrom60(ConfigurationConverterTest.java:69)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:748)
> ... Removed 21 stack frames
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
6 years, 11 months