The FileArchiveOperationHandler is neither atomic nor idempotent (see http://www.gigaspaces.com/docs/JavaDoc9.1/org/openspaces/archive/ArchiveOperationHandler.html ). Therefore you must return false.

The problem you encountered ClassCastException is in TweetArchiveFilter. It should implement EventExceptionHandler<Object> and then with reflection determine if it should be casted to "SpaceDocument[]" or "SpaceDocument"