From the exception, it seems that you are not using the same version of
Geode. Could you look into that...
Also, when creating a client, you use "ClientCacheFactory" and define a
pool pointing at the locators.
https://geode.apache.org/docs/guide/16/topologies_and_comm/cs_configuration/client_server_example_configurations.html
ClientCache c = new ClientCacheFactory().addPoolLocator(host, port).create();
FunctionService.onServers(PoolManager.find("DEFAULT")).execute("FunctionName").getResult()
//I think the default pool created is called "DEFAULT".
That should hopefully connect to your servers, where the functions have
been deployed, invoke the function and return the result back to the client.
--Udo
On 10/30/18 13:13, Marcus Dushshantha Chandradasa wrote:
Hi All,
I am trying to figure out how to programmatically create Regions on a
Geode Cluster. I followed below links but without any success.
https://geode.apache.org/docs/guide/16/developing/region_options/dynamic_region_creation.html
https://stackoverflow.com/questions/50833166/cannot-create-region-dynamically-from-client-in-geode/50850584
So far, I have the CreateRegionFunction and
CreateRegionCacheListener copied and JARed them together. I am referig
them in my client as well as added to the classpath for Geode Cluster.
Below is my client code. I am receiving the below error when I try to
execute. Any help would be really appreciated.
Error :
SEVERE: Servlet.service() for servlet [dispatcherServlet] in context
with path [] threw exception [Request processing failed; nested
exception is org.apache.geode.SystemConnectException: Rejecting the
attempt of a member using an older version of the product to join the
distributed system] with root cause
org.apache.geode.SystemConnectException: Rejecting the attempt of a
member using an older version of the product to join the distributed
system
at
org.apache.geode.distributed.internal.membership.gms.membership.GMSJoinLeave.attemptToJoin(GMSJoinLeave.java:433)
at
org.apache.geode.distributed.internal.membership.gms.membership.GMSJoinLeave.join(GMSJoinLeave.java:329)
at
org.apache.geode.distributed.internal.membership.gms.mgr.GMSMembershipManager.join(GMSMembershipManager.java:664)
Cache cache =new CacheFactory()
.set( ConfigurationProperties.LOCATORS,
"localhost[10334],localhost[10335]")
.create(); Execution execution = FunctionService.onServers(cache); ArrayList
argList =new ArrayList(); argList.add("region_new"); RegionAttributes attr =new
AttributesFactory().create(); argList.add(attr); Function function =new
CreateRegionFunction(); //FunctionService.registerFunction(function); Object result =
execution.setArguments(argList).execute(function).getResult();