ClassCastException inside of UnusableEntryException
hi,
i'm trying to implement a gigaspaces based search service which impements caching.
so the searchService first checks weather there is already a corresponding SearchResponse in the space. if there is one, than reads it, and returns with the hit ist. if there is no corresponding (matching query string) SearchResponse, than it writes a SearchRequest (POJO) to the space and the PU is responding by writing a SearchResponse (POJO) back to the space (with a lease time of let's say 5 minutes). the PU is using a poling container and is running as a puInstance.sh.
when the SearchService is writing the the SearchRequest to the space the PU is able to take it, and able to write the ServiceResponse. but when the SearchService tries to read it there is an UnusableEntryException. when checking the exceptions content: - unusable fields :null - partialEntry :null - nested Exception: exception:java.lang.ClassCastException: org.mypackage.SearchResponse at com.j_spaces.core.client.JSpaceProxyUtil.getEntry(SourceFile:730) at com.j_spaces.core.client.JSpaceProxyUtil.getEntry(SourceFile:871) at com.j_spaces.core.client.JSpaceProxyUtil.getEntry(SourceFile:854) at com.j_spaces.core.client.single.action.AbstractSingleSpaceReadTakeActionListener.read(SourceFile:210) at com.j_spaces.core.client.single.action.SingleSpaceReadActionListener.onAction(SourceFile:35) at com.j_spaces.core.client.single.action.SingleSpaceReadActionListener.onAction(SourceFile:16) at com.j_spaces.core.client.AbstractSpaceProxy.read(SourceFile:167) at com.j_spaces.core.client.AbstractSpaceProxy.read(SourceFile:150) at org.mypackage.SerarchService.performSearch()
The strange thing is that from gs.sh i can see that there is 1 object of SearchResponse, and i can even display it with: space sql -url jini://*/searchSpace_container/searchSpace -query select * from org.mypackgae.SearchResponse
also when i run the SearchService.performSearch() with the same parameters, it's able to read the SearchResponse (produce by the previous cal)
some more detail about the POJO: - SearchResponse implements Serializable - it has a: private static final long serialVersionUID - it implements hashCode() based on apaches HashCodeBuilder - it impements equals() based on EqualsBuilder - its using the following annotations for the getId() field: @SpaceRouting @SpaceProperty(index=IndexType.BASIC) @SpaceId(autoGenerate = false)
any tips are appreciated!
{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=2654]{quote}