Post

1 follower Follow
0
Avatar

Native Client C# PDX Serialization error

 I'm running the sample projects for PDX serialization and always get the same error regardless of example or type/complexity of object being serialized:

System.Runtime.InteropServices.SEHException was unhandled by user code
HResult=-2147467259
Message=External component has thrown an exception.
Source=GemStone.GemFire.Cache
ErrorCode=-2147467259
StackTrace:
at gemfire.SerializationRegistry.GetPDXIdForType(SByte* , SharedPtr<gemfire::Serializable>* )
at GemStone.GemFire.Cache.Generic.Serializable.GetPDXIdForType(SByte* poolName, IGFSerializable pdxType)
at GemStone.GemFire.Cache.Generic.Internal.PdxTypeRegistry.GetPDXIdForType(Type type, SByte* poolname, PdxType nType, Boolean checkIfThere)
at GemStone.GemFire.Cache.Generic.Internal.PdxHelper.SerializePdx(DataOutput dataOutput, IPdxSerializable pdxObject)
at GemStone.GemFire.Cache.Generic.DataOutput.WriteObject(Object obj)
at GemStone.GemFire.Cache.Generic.Internal.PdxLocalWriter.WriteObject(String fieldName, Object obj)
at GemStone.GemFire.Cache.Generic.Internal.PdxWriterWithTypeCollector.WriteObject(String fieldName, Object obj)
at PdxTests.PortfolioPdx.ToData(IPdxWriter writer) in c:\pivotal\GemClient\Pivotal_GemFire_NativeClient_64bit_8200\SampleCode\quickstart\csharp\PortfolioPdx.cs:line 267
at GemStone.GemFire.Cache.Generic.Internal.PdxHelper.SerializePdx(DataOutput dataOutput, IPdxSerializable pdxObject)
at gemfire.PdxManagedCacheableKey.toData(PdxManagedCacheableKey* , DataOutput* output)
InnerException:

I am using a server started with GFSH for my tests, I get the same error where the server is localhost or on a different machine.

I set up my server with these commands:

start locator --name=locator1

start pulse

start server --name=server1 --server-port=40411

create region --name=Portfolios --type=REPLICATE

my client cache config is like this:

<?xml version="1.0" encoding="UTF-8"?>

<!-- Well-formed and valid xml file -->
<client-cache>

<region name = "Portfolios" >
<region-attributes refid="CACHING_PROXY" pool-name="examplePool" />
</region>
<pool name="examplePool" subscription-enabled="true" >
<server host="<my server name>" port="40404" />
</pool>
</client-cache>

 

 

native client is on a windows 7 visual studio 2013 framework 4.  Server is windows 2012

I haven't tried to reinstall the native client yet.  I'm referencing GemStone.GemFire.Cache from the bin it is not registered in the GAC.  That may be what I try next.

What am I missing?  

Jeff Bogenschneider

Please sign in to leave a comment.

1 comment

0
Avatar

I worked with Pivotal to investigate this further and it appears to be firewall related.  I haven't completely figured it out yet, but the client makes the request to the server on the server's port but there is another port involved that isn't opened.  This port is assigned from a configurable range

Server Error:

[warning 2016/04/27 10:23:53.421 PDT server1 <ServerConnection on port 40411 Thread 13> tid=0x6f] Server connection from [identity(WI1LT-JBOGENSCH(default_GemfireDS:23788:loner):2:GFNative_cQ_3rjuvUk23788:default_GemfireDS,connection=1; port=55082]: Unexpected IOException:
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:209)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at com.gemstone.gemfire.internal.cache.tier.sockets.Message.fetchHeader(Message.java:627)
at com.gemstone.gemfire.internal.cache.tier.sockets.Message.readHeaderAndPayload(Message.java:651)
at com.gemstone.gemfire.internal.cache.tier.sockets.Message.read(Message.java:594)
at com.gemstone.gemfire.internal.cache.tier.sockets.Message.recv(Message.java:1091)
at com.gemstone.gemfire.internal.cache.tier.sockets.Message.recv(Message.java:1105)
at com.gemstone.gemfire.internal.cache.tier.sockets.BaseCommand.readRequest(BaseCommand.java:933)
at com.gemstone.gemfire.internal.cache.tier.sockets.ServerConnection.doNormalMsg(ServerConnection.java:743)
at com.gemstone.gemfire.internal.cache.tier.sockets.ServerConnection.doOneMessage(ServerConnection.java:920)
at com.gemstone.gemfire.internal.cache.tier.sockets.ServerConnection.run(ServerConnection.java:1165)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at com.gemstone.gemfire.internal.cache.tier.sockets.AcceptorImpl$1$1.run(AcceptorImpl.java:579)
at java.lang.Thread.run(Thread.java:745)

depending upon the PDX Serialization method you are using you may also see:

[severe 2016/04/27 10:21:05.668 PDT server1 <Function Execution Processor4> tid=0x98] UnExpected exception during function execution on local node Distributed Region
com.gemstone.gemfire.cache.execute.FunctionException: com.gemstone.gemfire.SerializationException: An IOException was thrown while deserializing
at com.gemstone.gemfire.management.internal.beans.QueryDataFunction$LocalQueryFunction.execute(QueryDataFunction.java:541)
at com.gemstone.gemfire.internal.cache.execute.AbstractExecution.executeFunctionLocally(AbstractExecution.java:359)
at com.gemstone.gemfire.internal.cache.execute.AbstractExecution$2.run(AbstractExecution.java:325)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at com.gemstone.gemfire.distributed.internal.DistributionManager.runUntilShutdown(DistributionManager.java:692)
at com.gemstone.gemfire.distributed.internal.DistributionManager$9$1.run(DistributionManager.java:1149)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.gemstone.gemfire.SerializationException: An IOException was thrown while deserializing
at com.gemstone.gemfire.internal.cache.EntryEventImpl.deserialize(EntryEventImpl.java:1557)
at com.gemstone.gemfire.internal.cache.EntryEventImpl.deserialize(EntryEventImpl.java:1546)
at com.gemstone.gemfire.internal.cache.VMCachedDeserializable.getDeserializedValue(VMCachedDeserializable.java:124)
at com.gemstone.gemfire.internal.cache.LocalRegion.getDeserialized(LocalRegion.java:1275)
at com.gemstone.gemfire.internal.cache.LocalRegion$NonTXEntry.getValue(LocalRegion.java:9140)
at com.gemstone.gemfire.internal.cache.EntriesSet$EntriesIterator.moveNext(EntriesSet.java:183)
at com.gemstone.gemfire.internal.cache.EntriesSet$EntriesIterator.<init>(EntriesSet.java:121)
at com.gemstone.gemfire.internal.cache.EntriesSet.iterator(EntriesSet.java:85)
at com.gemstone.gemfire.cache.query.internal.ResultsCollectionWrapper.iterator(ResultsCollectionWrapper.java:181)
at com.gemstone.gemfire.cache.query.internal.QRegion.iterator(QRegion.java:225)
at com.gemstone.gemfire.cache.query.internal.CompiledSelect.doNestedIterations(CompiledSelect.java:696)
at com.gemstone.gemfire.cache.query.internal.CompiledSelect.doIterationEvaluate(CompiledSelect.java:561)
at com.gemstone.gemfire.cache.query.internal.CompiledSelect.evaluate(CompiledSelect.java:271)
at com.gemstone.gemfire.cache.query.internal.DefaultQuery.executeUsingContext(DefaultQuery.java:529)
at com.gemstone.gemfire.cache.query.internal.DefaultQuery.execute(DefaultQuery.java:365)
at com.gemstone.gemfire.cache.query.internal.DefaultQuery.execute(DefaultQuery.java:303)
at com.gemstone.gemfire.management.internal.beans.QueryDataFunction$LocalQueryFunction.execute(QueryDataFunction.java:536)
... 7 more
Caused by: java.io.IOException: No Instantiator has been registered for class with id 8
at com.gemstone.gemfire.internal.InternalDataSerializer.readUserDataSerializable(InternalDataSerializer.java:3007)
at com.gemstone.gemfire.internal.InternalDataSerializer.basicReadObject(InternalDataSerializer.java:2914)
at com.gemstone.gemfire.DataSerializer.readObject(DataSerializer.java:3210)
at com.gemstone.gemfire.internal.util.BlobHelper.deserializeBlob(BlobHelper.java:110)
at com.gemstone.gemfire.internal.cache.EntryEventImpl.deserialize(EntryEventImpl.java:1554)
... 23 more

 

Jeff Bogenschneider 0 votes