caching - Internal Gemfire Error While querying Gemfire using JAVA API -
i trying query java in gemfire. able put data , regions using java api in gemfire. whenever try query regions, internalgemfireerror.
i start locators , servers in gfsh
gfsh>start locator --name=locator --log-level=debug gfsh>configure pdx --read-serialized=true gfsh>start server --name=server1 --log-level=debug create region --name=account --type=partition
i have created client project using java api put , fetch data
client.java
public static void main(string[] args) throws functiondomainexception, typemismatchexception, nameresolutionexception, queryinvocationtargetexception { clientcache cache = new clientcachefactory().set("cache-xml-file", "cacheclient.xml") .create(); region<integer, account> accountregion = cache.getregion("account"); list<account> accounts = testdata.createaccountdata(); for(account : accounts) { accountregion.put(a.getaccountnumber(), a); } }
cacheclient.xml
<?xml version="1.0" encoding="utf-8"?> <client-cache xmlns="http://schema.pivotal.io/gemfire/cache" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://schema.pivotal.io/gemfire/cache http://schema.pivotal.io/gemfire/cache/cache-8.1.xsd" version="8.1"> <pool name="mypool" subscription-enabled="true"> <locator port="10334" host="192.168.2.4"/> </pool> <pdx read-serialized="true"> <pdx-serializer> <class-name>com.gemstone.gemfire.pdx.reflectionbasedautoserializer</class-name> <parameter name="classes"> <string>gemfire.vo.*</string> </parameter> <parameter name="check-portability"> <string>true</string> </parameter> </pdx-serializer> </pdx> <region name="account"> <region-attributes refid="proxy"/> </region> </client-cache>
account.java
public class account { public account() { // todo auto-generated constructor stub } private string name; private string opendate; private int accountnumber; public string getname() { return name; } public void setname(string name) { this.name = name; } public string getopendate() { return opendate; } public void setopendate(string opendate) { this.opendate = opendate; } public int getaccountnumber() { return accountnumber; } public void setaccountnumber(int accountnumber) { this.accountnumber = accountnumber; } @override public string tostring() { return "account [name=" + name + ", opendate=" + opendate + ", accountnumber=" + accountnumber + "]"; } public account(string name, string opendate, int accountnumber) { super(); this.name = name; this.opendate = opendate; this.accountnumber = accountnumber; }
while querying or gettingf data, write
accountregion.query("select * /account");
or
account acc = accountregion.get(1);
and throws me following exception
exception in thread "main" com.gemstone.gemfire.internalgemfireerror @ com.gemstone.gemfire.internal.assert.throwerror(assert.java:84) @ com.gemstone.gemfire.internal.assert.asserttrue(assert.java:48) @ com.gemstone.gemfire.internal.internaldataserializer.readdataserializable(internaldataserializer.java:2507) @ com.gemstone.gemfire.internal.internaldataserializer.basicreadobject(internaldataserializer.java:2921) @ com.gemstone.gemfire.dataserializer.readobject(dataserializer.java:3210) @ com.gemstone.gemfire.internal.util.blobhelper.deserializeblob(blobhelper.java:110) @ com.gemstone.gemfire.internal.util.blobhelper.deserializeblob(blobhelper.java:77) @ com.gemstone.gemfire.internal.cache.tier.sockets.cacheserverhelper.deserialize(cacheserverhelper.java:55) @ com.gemstone.gemfire.internal.cache.tier.sockets.part.getobject(part.java:233) @ com.gemstone.gemfire.internal.cache.tier.sockets.part.getobject(part.java:238) @ com.gemstone.gemfire.cache.client.internal.abstractop.processobjresponse(abstractop.java:280) @ com.gemstone.gemfire.cache.client.internal.getpdxtypebyidop$getpdxtypebyidopimpl.processresponse(getpdxtypebyidop.java:45) @ com.gemstone.gemfire.cache.client.internal.abstractop.processresponse(abstractop.java:215) @ com.gemstone.gemfire.cache.client.internal.abstractop.attemptreadresponse(abstractop.java:166) @ com.gemstone.gemfire.cache.client.internal.abstractop.attempt(abstractop.java:369) @ com.gemstone.gemfire.cache.client.internal.connectionimpl.execute(connectionimpl.java:270) @ com.gemstone.gemfire.cache.client.internal.pooling.pooledconnection.execute(pooledconnection.java:319) @ com.gemstone.gemfire.cache.client.internal.opexecutorimpl.executewithpossiblereauthentication(opexecutorimpl.java:930) @ com.gemstone.gemfire.cache.client.internal.opexecutorimpl.execute(opexecutorimpl.java:158) @ com.gemstone.gemfire.cache.client.internal.opexecutorimpl.execute(opexecutorimpl.java:113) @ com.gemstone.gemfire.cache.client.internal.poolimpl.execute(poolimpl.java:702) @ com.gemstone.gemfire.cache.client.internal.getpdxtypebyidop.execute(getpdxtypebyidop.java:28) @ com.gemstone.gemfire.pdx.internal.clienttyperegistration.gettype(clienttyperegistration.java:107) @ com.gemstone.gemfire.pdx.internal.typeregistry.gettype(typeregistry.java:122) @ com.gemstone.gemfire.internal.internaldataserializer.readpdxserializable(internaldataserializer.java:3157) @ com.gemstone.gemfire.internal.internaldataserializer.basicreadobject(internaldataserializer.java:2979) @ com.gemstone.gemfire.dataserializer.readobject(dataserializer.java:3210) @ com.gemstone.gemfire.internal.cache.tier.sockets.objectpartlist.fromdata(objectpartlist.java:238) @ com.gemstone.gemfire.internal.internaldataserializer.invokefromdata(internaldataserializer.java:2480) @ com.gemstone.gemfire.internal.dsfidfactory.create(dsfidfactory.java:1078) @ com.gemstone.gemfire.internal.internaldataserializer.basicreadobject(internaldataserializer.java:2797) @ com.gemstone.gemfire.dataserializer.readobject(dataserializer.java:3210) @ com.gemstone.gemfire.internal.util.blobhelper.deserializeblob(blobhelper.java:110) @ com.gemstone.gemfire.internal.util.blobhelper.deserializeblob(blobhelper.java:77) @ com.gemstone.gemfire.internal.cache.tier.sockets.cacheserverhelper.deserialize(cacheserverhelper.java:55) @ com.gemstone.gemfire.internal.cache.tier.sockets.part.getobject(part.java:233) @ com.gemstone.gemfire.internal.cache.tier.sockets.part.getobject(part.java:238) @ com.gemstone.gemfire.cache.client.internal.queryop$queryopimpl$1.handle(queryop.java:110) @ com.gemstone.gemfire.cache.client.internal.abstractop.processchunkedresponse(abstractop.java:322) @ com.gemstone.gemfire.cache.client.internal.queryop$queryopimpl.processresponse(queryop.java:165) @ com.gemstone.gemfire.cache.client.internal.abstractop.processresponse(abstractop.java:215) @ com.gemstone.gemfire.cache.client.internal.abstractop.attemptreadresponse(abstractop.java:153) @ com.gemstone.gemfire.cache.client.internal.abstractop.attempt(abstractop.java:369) @ com.gemstone.gemfire.cache.client.internal.connectionimpl.execute(connectionimpl.java:270) @ com.gemstone.gemfire.cache.client.internal.pooling.pooledconnection.execute(pooledconnection.java:319) @ com.gemstone.gemfire.cache.client.internal.opexecutorimpl.executewithpossiblereauthentication(opexecutorimpl.java:930) @ com.gemstone.gemfire.cache.client.internal.opexecutorimpl.execute(opexecutorimpl.java:158) @ com.gemstone.gemfire.cache.client.internal.opexecutorimpl.execute(opexecutorimpl.java:113) @ com.gemstone.gemfire.cache.client.internal.poolimpl.execute(poolimpl.java:702) @ com.gemstone.gemfire.cache.client.internal.queryop.execute(queryop.java:51) @ com.gemstone.gemfire.cache.client.internal.serverproxy.query(serverproxy.java:77) @ com.gemstone.gemfire.internal.cache.localregion.query(localregion.java:11017) @ gemfire.poc.lab.main(lab.java:34)
Comments
Post a Comment