Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question

ClassCastException with readMultiple in partitioned schema

Hi All.

When using MyObj[] myObjs=gigaSpace.readMultiple(myObj, Integer.MAX_VALUE); Im getting java.lang.ClassCastException, this happened only with partitioned schema, all read operations are returning objects of Object type. This is fine??


{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=2475]{quote}

asked 2008-07-22 11:41:04 -0500

nullcipher2 gravatar image

updated 2013-08-08 09:52:00 -0500

jaissefsfex gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

What is your myObj ? POJO or SQLQuery object? Are you using 6.5? Do you have multiple inheritance with the template class hierarchy?


answered 2008-07-22 13:23:49 -0500

shay hassidim gravatar image
edit flag offensive delete link more


I´m using GigaspacesXAP6.5

... MyObj myObj = new MyObj(); MyObj[] myObjs=gigaSpace.readMultiple(myObj, Integer.MAX_VALUE); ...

public interface IMyObj() { .... }

@SpaceClass(replicate=true,persist=false,fifo=false,includeProperties=IncludeProperties.EXPLICIT) public class MyObj implements IMyObj, Comparable<myobj>, Serializable { ... }

nullcipher2 gravatar image nullcipher2  ( 2008-07-22 16:37:47 -0500 )edit

Can you get the result into Object[] and cast each object separately? Lets see if this works.


shay hassidim gravatar image shay hassidim  ( 2008-07-22 16:57:03 -0500 )edit

Yes, it works, but why I need to cast in partitioned space. With no partitions I dont need to cast.

nullcipher2 gravatar image nullcipher2  ( 2008-07-23 17:55:15 -0500 )edit

With 6.5 is should work.
Are you using 6.5 GA?


shay hassidim gravatar image shay hassidim  ( 2008-07-24 11:10:56 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2008-07-22 11:41:04 -0500

Seen: 60 times

Last updated: Jul 22 '08