[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 updated IPROTO-33:
--------------------------------
Status: Open (was: New)
> 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] (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:
-----------------------------------------
Hey [~anistor], the IPROTO project is not in sync with the released versions of protostream, so I cannot report issues against the correct version
> 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] (IPROTO-33) ClassCastException with Array of Enums
by Gustavo Fernandes (JIRA)
Gustavo Fernandes created IPROTO-33:
---------------------------------------
Summary: 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-7988) ScatteredSyncFuncTest>DistSyncFuncTest.testComputeIfAbsentFromNonOwner fails with trace logging enabled
by Dan Berindei (JIRA)
[ https://issues.jboss.org/browse/ISPN-7988?page=com.atlassian.jira.plugin.... ]
Dan Berindei commented on ISPN-7988:
------------------------------------
>From Radim: The thing that went wrong was that the compute command was successful even if it did not match the criteria (absent/present). Also, compute command has to send the whole new value from primary to originator and store it (if successful) because originator does not know the previous value - it cannot generate it in order to store that for backup.
> ScatteredSyncFuncTest>DistSyncFuncTest.testComputeIfAbsentFromNonOwner fails with trace logging enabled
> -------------------------------------------------------------------------------------------------------
>
> Key: ISPN-7988
> URL: https://issues.jboss.org/browse/ISPN-7988
> Project: Infinispan
> Issue Type: Bug
> Components: Test Suite - Core
> Reporter: Dan Berindei
> Assignee: Radim Vansa
> Priority: Critical
> Labels: testsuite_stability
>
> Every time I run the test I get this failure twice, with the same test parameters:
> {noformat}
> testComputeIfAbsentFromNonOwner[SCATTERED_SYNC, tx=false, numOwners=1, l1=false](org.infinispan.scattered.ScatteredSyncFuncTest) Time elapsed: 0.159 sec <<< FAILURE!
> java.lang.AssertionError: expected [1] but found [0]
> at org.testng.Assert.fail(Assert.java:94)
> at org.testng.Assert.failNotEquals(Assert.java:494)
> at org.testng.Assert.assertEquals(Assert.java:123)
> at org.testng.Assert.assertEquals(Assert.java:370)
> at org.testng.Assert.assertEquals(Assert.java:380)
> at org.infinispan.scattered.Utils.assertOwnershipAndNonOwnership(Utils.java:49)
> at org.infinispan.scattered.ScatteredSyncFuncTest.assertOwnershipAndNonOwnership(ScatteredSyncFuncTest.java:20)
> at org.infinispan.distribution.BaseDistFunctionalTest.assertOnAllCachesAndOwnership(BaseDistFunctionalTest.java:162)
> {noformat}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
6 years, 11 months
[JBoss JIRA] (ISPN-8077) Split some test classes in order to get clean test runs for native clients
by Martin Gencur (JIRA)
[ https://issues.jboss.org/browse/ISPN-8077?page=com.atlassian.jira.plugin.... ]
Martin Gencur updated ISPN-8077:
--------------------------------
Status: Open (was: New)
> Split some test classes in order to get clean test runs for native clients
> --------------------------------------------------------------------------
>
> Key: ISPN-8077
> URL: https://issues.jboss.org/browse/ISPN-8077
> Project: Infinispan
> Issue Type: Bug
> Components: Test Suite - Core
> Affects Versions: 9.1.0.Final, 9.0.3.Final
> Reporter: Martin Gencur
>
> Some test classes include tests which are run by the native clients but the native clients don't support them:
> ForceReturnValuesTest.testSameInstanceForSameForceReturnValues
> ForceReturnValuesTest.testDifferentInstancesForDifferentForceReturnValues
> RemoteCacheManagerTest.testMarshallerInstance
> RemoteCacheManagerTest.testGetUndefinedCache
> The goal is to split them so that the "passing" parts can be run by the clients.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
6 years, 11 months
[JBoss JIRA] (ISPN-8077) Split some test classes in order to get clean test runs for native clients
by Martin Gencur (JIRA)
[ https://issues.jboss.org/browse/ISPN-8077?page=com.atlassian.jira.plugin.... ]
Martin Gencur reassigned ISPN-8077:
-----------------------------------
Assignee: Martin Gencur
> Split some test classes in order to get clean test runs for native clients
> --------------------------------------------------------------------------
>
> Key: ISPN-8077
> URL: https://issues.jboss.org/browse/ISPN-8077
> Project: Infinispan
> Issue Type: Bug
> Components: Test Suite - Core
> Affects Versions: 9.1.0.Final, 9.0.3.Final
> Reporter: Martin Gencur
> Assignee: Martin Gencur
>
> Some test classes include tests which are run by the native clients but the native clients don't support them:
> ForceReturnValuesTest.testSameInstanceForSameForceReturnValues
> ForceReturnValuesTest.testDifferentInstancesForDifferentForceReturnValues
> RemoteCacheManagerTest.testMarshallerInstance
> RemoteCacheManagerTest.testGetUndefinedCache
> The goal is to split them so that the "passing" parts can be run by the clients.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
6 years, 11 months