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

Ask Your Question

How to disable the protective mode in system property for XAP 9.1


Previosly I am using XAP 8.0.0 for my application. When I tried to run in XAP 9.1 my application is producing wrong result because it cannot write and route the data into each partition as required. So when I looked in XAP documentation for upgrading to 9.1.0, It says that I can disable the com.gs.protectiveMode.wrongEntryRoutingUsage to false. But I don't know how to do these and where??

Hope you all can helps me on this matter. Thanks

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

asked 2013-01-01 07:36:45 -0500

zainalhisham gravatar image

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

jaissefsfex gravatar image
edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

Since you probably use embedded space proxy when writing the object to the space - why won't you set the routing field using the following:

mySpaceobject.setRountingField(clusterInfo.getInstanceId() - 1);


answered 2013-01-01 08:15:23 -0500

shay hassidim gravatar image
edit flag offensive delete link more


I just want to know how to disable the protective mode so that I can run the application in XAP 9.1.0. In my application I used map and reduce using executor based remoting to call a method on a Processor with its collocated partition space. The method is just to writeMultiple the collection of data in its partition space only without routing to other partition space. This working fine in XAP 8. So I just want to try to disable the protective mode to see whether its can resolved this matter.

Anyway Thanks


answered 2013-01-01 09:38:54 -0500

zainalhisham gravatar image
edit flag offensive delete link more


How does your pojo looks like? do you have a specific routing value? do you have a specific ID or can you use auto generated ID? if you can use the auto generated id and you don't need a routing property it will work because the routing will be based on ID and the auto generated id makes sure to create an id which its routing matches the current partition.

That said, the exception message it self explains exactly how to disable to protective mode, put the system property described in the exception in the GSC's which contains the space.


eitany gravatar imageeitany ( 2013-01-01 12:04:51 -0500 )edit

I don't have any routing id, I just have collection of data to be written using writeMultiple to respective space. The exception I got is as below:

Caused by: com.gigaspaces.client.WriteMultipleException: Success:3, errors:6, [class com.gigaspaces.client.protective.ProtectiveModeException:6
StackTrace: com.gigaspaces.client.protective.ProtectiveModeException: Operation is rejected - the routing value in the written entry of type 'org.openspaces.testdata.common.IEArray' does not match this space partition id. The value within the entry's routing property named 'IE' is 0, 1, 2, 1 which matches partition id 3 while current partition id is 2. Having a mismatching routing value would result in a remote client not being able to locate this entry as the routing value will not match the partition the entry is located. (you can disable this protection, though it is not recommended, by setting the following system property: com.gs.protectiveMode.wrongEntryRoutingUsage=false).

so I just want to know how to disable the protection.Do I need to go to folder root">gigaspacesroot\config\gs.properties and edit the line ??? so that I can put the com -Dcom.gs.protectiveMode.wrongEntryRoutingUsage=false. I really dont know how. So that what I want to know.

zainalhisham gravatar imagezainalhisham ( 2013-01-01 14:33:06 -0500 )edit

The following will set the com.gs.protectiveMode.wrongEntryRoutingUsage system property to false on all the GSCs.

on windows:

set GSC_JAVA_OPTIONS="-Dcom.gs.protectiveMode.wrongEntryRoutingUsage=false"

on linux:

export GSC_JAVA_OPTIONS='-Dcom.gs.protectiveMode.wrongEntryRoutingUsage=false'

and then start the gs-agent.


shay hassidim gravatar imageshay hassidim ( 2013-01-01 15:23:18 -0500 )edit

Then the correct solution in your case is not to disable the protective mode but to add auto generated id to the IEArray pojo, from your description it seems that it does not have an id property, is this true?

just add the following

private String id;

public String getId(){ return this.id };
public void setId(String id){ this.id = id };

This will solve this since the autogenerated id will be used for routing and it will be generated properly.


eitany gravatar imageeitany ( 2013-01-01 22:42:39 -0500 )edit


We added this protection exactly to make sure you don't have this bug, this mean that you are writing in embedded proxy objects that are added to the wrong partition. there is way to disable it but i do not recommend it as it display a bug in your logic and if you disable this you wont see that.

the correct solution will be to use a cluster proxy and to write these object to another parition or check why are you trying to write object to this partition.

let me know if you need more info,


answered 2013-01-01 07:45:25 -0500

dragnot gravatar image
edit flag offensive delete link more

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: 2013-01-01 07:36:45 -0500

Seen: 351 times

Last updated: Jan 01 '13