Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When the FSTObjectInput.readObject fails, any chance of more info? #58

Open
davidwynter opened this issue Nov 28, 2017 · 2 comments
Open

Comments

@davidwynter
Copy link

Version 4.18 of Kontraktor. When I get a failure with the de/serialization, probably due to my code, it is very hard to find the cause.
E.g. here is a typical trace:

Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.nustaq.serialization.serializers.FSTCPThrowableSerializer.instantiate(FSTCPThrowableSerializer.java:42)
at org.nustaq.serialization.FSTObjectInput.instantiateAndReadWithSer(FSTObjectInput.java:501)
at org.nustaq.serialization.FSTObjectInput.readObjectWithHeader(FSTObjectInput.java:370)
at org.nustaq.serialization.FSTObjectInput.readArrayNoHeader(FSTObjectInput.java:910)
at org.nustaq.serialization.FSTObjectInput.readArray(FSTObjectInput.java:890)
at org.nustaq.serialization.FSTObjectInput.instantiateArray(FSTObjectInput.java:460)
at org.nustaq.serialization.FSTObjectInput.instantiateSpecialTag(FSTObjectInput.java:429)
at org.nustaq.serialization.FSTObjectInput.readObjectWithHeader(FSTObjectInput.java:364)
at org.nustaq.serialization.FSTObjectInput.readObjectInternal(FSTObjectInput.java:331)
at org.nustaq.serialization.FSTObjectInput.readObject(FSTObjectInput.java:302)
at org.nustaq.serialization.FSTObjectInput.readObject(FSTObjectInput.java:245)
at org.nustaq.serialization.FSTConfiguration.asObject(FSTConfiguration.java:1137)
at org.nustaq.kontraktor.remoting.encoding.RemoteCallEntry.unpackArgs(RemoteCallEntry.java:140)
at org.nustaq.kontraktor.remoting.base.ConnectionRegistry.processRemoteCallEntry(ConnectionRegistry.java:430)
at org.nustaq.kontraktor.remoting.base.ConnectionRegistry.receiveObject(ConnectionRegistry.java:332)
at org.nustaq.kontraktor.remoting.base.ActorClient$3.receiveObject(ActorClient.java:98)
at org.nustaq.kontraktor.remoting.base.ObjectSink.receiveObject(ObjectSink.java:38)
at org.nustaq.kontraktor.remoting.websockets.JSR356ClientConnector$WSClientEndpoint.onMessage(JSR356ClientConnector.java:140)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at io.undertow.websockets.jsr.annotated.BoundMethod.invoke(BoundMethod.java:87)
at io.undertow.websockets.jsr.annotated.AnnotatedEndpoint$2.onMessage(AnnotatedEndpoint.java:142)
at io.undertow.websockets.jsr.FrameHandler$6.run(FrameHandler.java:245)
at io.undertow.websockets.jsr.ServerWebSocketContainer$1.call(ServerWebSocketContainer.java:162)
at io.undertow.websockets.jsr.ServerWebSocketContainer$1.call(ServerWebSocketContainer.java:159)
at io.undertow.websockets.jsr.ServerWebSocketContainer.invokeEndpointMethod(ServerWebSocketContainer.java:575)
at io.undertow.websockets.jsr.ServerWebSocketContainer$6.run(ServerWebSocketContainer.java:561)
at io.undertow.websockets.jsr.OrderedExecutor$ExecutorTask.run(OrderedExecutor.java:67)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

I assume you have the name of the field and the outer JSON element and everything in between. Any chance of dumping those in the trace output?

@davidwynter
Copy link
Author

I think this is the culprit, names have been changed to protect the innocent.

Formatted JSON Data
{  
"styp":"array",
"seq":[  
  2,
  {  
     "typ":"call",
     "obj":{  
        "isContinue":0,
        "queue":0,
        "futureKey":1,
        "receiverKey":1,
        "cb":null,
        "args":null,
        "method":"getProducts",
        "serializedArgs":"{\"styp\":\"array\",\"seq\":[1,{\"typ\":\"uk.co.example.Application\",\"obj\":{\"numberOfDogs\":12,\"extraInformation\":{\"typ\":\"list\",\"obj\":[0]},\"advance\":{\"typ\":\"java.math.BigDecimal\",\"obj\":[\"1000\"]},\"grossHousehold\":null,\"startDate\":null,\"questions\":{\"typ\":\"uk.co.example.Questions\",\"obj\":{\"numberOfThings\":null,\"numberOfMissed\":null,\"numberOfMissedOther\":null,\"everHadBeef\":null,\"everMadeHouse\":null,\"missedPaymentsOnThingy\":null}},\"applicants\":{\"typ\":\"list\",\"obj\":[0]},\"propertyDetails\":null,\"authorises\":\"Y\",\"applicationName\":null,\"reference\":null,\"campaign\":null,\"ddBankAccount\":null,\"employmentStatus\":null,\"filterResults\":\"N\",\"homeOwner\":null,\"purpose\":null,\"sourcing\":null,\"stage\":null,\"userId\":\"stdclient\"}}]}"
     }
  },
  2
]
}

@RuedigerMoeller
Copy link
Owner

Exchanging data is hard ;). That's actually a FST issue, will transfer ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants