0
votes

I am using hazelcast -2.5 in a cluster. I am trying to load an ArrayList of User defined objects (with a few String fields and one Integer) in the store-load implementation of my Hazelcast Map (String, ArrayList). The initial load all does not give me any exceptions. However, if the load gets invoked due to a get call on the map for a key for which there is no value in the map (and hence the load gets called), I see the following exception being thrown (I am also doing a remove operation on the map after that point in time):

Store thrown exception for CONCURRENT_MAP_REMOVE

It gives me a class cast exception stating that my UD Object cannot be cast to a String. I would not be surprised if I missed something in my implementation - its just that when this call is made, I am trying to do a get operation on the map and assigning the result to an ArrayList of User Defined Object. The load operation in the store-load also returns an ArrayList of User defined object (the store-load is declared in the same way).

WARNING: [192.168.1.1]:5703 [dev] Store thrown exception for CONCURRENT_MAP_REMOVE
java.lang.ClassCastException: models.test.TestClass cannot be cast to java.lang.String
    at models.test.StoreLoadTestMap.load(StoreLoadTestMap.java:1)
    at com.hazelcast.impl.concurrentmap.MapStoreWrapper.load(MapStoreWrapper.java:143)
    at com.hazelcast.impl.ConcurrentMapManager$RemoveOperationHandler$RemoveLoader.doMapStoreOperation(ConcurrentMapManager.java:2681)
    at com.hazelcast.impl.ConcurrentMapManager$AbstractMapStoreOperation.run(ConcurrentMapManager.java:3860)
    at com.hazelcast.impl.executor.ParallelExecutorService$ParallelExecutorImpl$ExecutionSegment.run(ParallelExecutorService.java:212)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
    at com.hazelcast.impl.ExecutorThreadFactory$1.run(ExecutorThreadFactory.java:38) 

Any ideas on troubleshooting this?

1
I need to confirm but it seems like I'll get this exception if the arraylist being returned from the load operation (in the store-load implementation) is empty. - ali haider

1 Answers

0
votes

It appears that you will get this exception if the arraylist being returned from the hazelcast load operation (in the store-load implementation) is empty.