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

Error parsing step event to Pojo #200

Closed
meywood opened this issue Jun 15, 2023 · 1 comment · Fixed by #242
Closed

Error parsing step event to Pojo #200

meywood opened this issue Jun 15, 2023 · 1 comment · Fixed by #242
Assignees
Labels
bug Something isn't working

Comments

@meywood
Copy link
Collaborator

meywood commented Jun 15, 2023

This attached file contains the JSON for the event that is throwing the exception:
step.json.txt

the following exception when parsing the attached event:

at com.casper.sdk.service.impl.event.EventBuilder.buildPojoEvent(EventBuilder.java:125) ~[casper-java-sdk-2.3.3.jar:?]
	at com.casper.sdk.service.impl.event.EventBuilder.buildEvent(EventBuilder.java:100) ~[casper-java-sdk-2.3.3.jar:?]
	at com.casper.sdk.service.impl.event.EventServiceImpl.consumeEvent(EventServiceImpl.java:89) ~[casper-java-sdk-2.3.3.jar:?]
	at com.casper.sdk.service.impl.event.EventServiceImpl.lambda$consumeEvents$0(EventServiceImpl.java:69) ~[casper-java-sdk-2.3.3.jar:?]
	at org.apache.cxf.jaxrs.sse.client.SseEventSourceImpl$InboundSseEventListenerImpl.onNext(SseEventSourceImpl.java:126) ~[cxf-rt-rs-sse-3.5.5.jar:3.5.5]
	at org.apache.cxf.jaxrs.sse.client.SseEventSourceImpl$InboundSseEventListenerDelegate.lambda$onNext$0(SseEventSourceImpl.java:79) ~[cxf-rt-rs-sse-3.5.5.jar:3.5.5]
	at java.util.concurrent.CopyOnWriteArrayList.forEach(CopyOnWriteArrayList.java:807) ~[?:?]
	at org.apache.cxf.jaxrs.sse.client.SseEventSourceImpl$InboundSseEventListenerDelegate.onNext(SseEventSourceImpl.java:79) ~[cxf-rt-rs-sse-3.5.5.jar:3.5.5]
	at org.apache.cxf.jaxrs.sse.client.InboundSseEventProcessor.lambda$process$0(InboundSseEventProcessor.java:100) ~[cxf-rt-rs-sse-3.5.5.jar:3.5.5]
	at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:264) ~[?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java) ~[?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
	at java.lang.Thread.run(Thread.java:829) ~[?:?]
Caused by: com.fasterxml.jackson.databind.JsonMappingException: N/A
 at [Source: UNKNOWN; byte offset: #UNKNOWN] (through reference chain: com.casper.sdk.service.impl.event.EventRoot["Step"]->com.cas
[step.json.txt](https://github.com/casper-network/casper-java-sdk/files/11757029/step.json.txt)
per.sdk.model.event.step.Step["execution_effect"]->com.casper.sdk.model.deploy.ExecutionEffect["transforms"]->java.util.ArrayList[93]->com.casper.sdk.model.deploy.Entry["transform"]->com.casper.sdk.model.deploy.transform.WriteCLValue["WriteCLValue"]->com.casper.sdk.model.clvalue.CLValueMap["bytes"])
	at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:276) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:627) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:615) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:143) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:314) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:177) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.casper.sdk.jackson.deserializer.AbstractAnyOfDeserializer.deserializeTypedFromObject(AbstractAnyOfDeserializer.java:61) ~[casper-java-sdk-2.3.3.jar:?]
	at com.fasterxml.jackson.databind.deser.AbstractDeserializer.deserializeWithType(AbstractDeserializer.java:263) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:138) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:314) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:177) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.casper.sdk.jackson.deserializer.AbstractAnyOfDeserializer.deserializeTypedFromObject(AbstractAnyOfDeserializer.java:61) ~[casper-java-sdk-2.3.3.jar:?]
	at com.fasterxml.jackson.databind.deser.AbstractDeserializer.deserializeWithType(AbstractDeserializer.java:263) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:138) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:314) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:177) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer._deserializeFromArray(CollectionDeserializer.java:359) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:244) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:28) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:314) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:177) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:314) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:177) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:314) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:177) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:323) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4730) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3677) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3645) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.casper.sdk.service.impl.event.EventBuilder.buildPojoEvent(EventBuilder.java:121) ~[casper-java-sdk-2.3.3.jar:?]
	... 14 more
Caused by: java.nio.BufferUnderflowException
	at java.nio.HeapByteBuffer.get(HeapByteBuffer.java:182) ~[?:?]
	at dev.oak3.sbs4j.DeserializerBuffer.readBytes(DeserializerBuffer.java:357) ~[sbs4j-0.1.8.jar:?]
	at dev.oak3.sbs4j.DeserializerBuffer.readByteArray(DeserializerBuffer.java:126) ~[sbs4j-0.1.8.jar:?]
	at com.casper.sdk.model.clvalue.CLValuePublicKey.deserializeCustom(CLValuePublicKey.java:71) ~[casper-java-sdk-2.3.3.jar:?]
	at com.casper.sdk.model.clvalue.CLValueMap.deserializeCustom(CLValueMap.java:93) ~[casper-java-sdk-2.3.3.jar:?]
	at com.casper.sdk.model.clvalue.CLValueMap.deserializeCustom(CLValueMap.java:105) ~[casper-java-sdk-2.3.3.jar:?]
	at com.casper.sdk.model.clvalue.AbstractCLValue.deserialize(AbstractCLValue.java:124) ~[casper-java-sdk-2.3.3.jar:?]
	at com.casper.sdk.model.clvalue.AbstractCLValueWithChildren.setJsonBytes(AbstractCLValueWithChildren.java:53) ~[casper-java-sdk-2.3.3.jar:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:141) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:314) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:177) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.casper.sdk.jackson.deserializer.AbstractAnyOfDeserializer.deserializeTypedFromObject(AbstractAnyOfDeserializer.java:61) ~[casper-java-sdk-2.3.3.jar:?]
	at com.fasterxml.jackson.databind.deser.AbstractDeserializer.deserializeWithType(AbstractDeserializer.java:263) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:138) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:314) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:177) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.casper.sdk.jackson.deserializer.AbstractAnyOfDeserializer.deserializeTypedFromObject(AbstractAnyOfDeserializer.java:61) ~[casper-java-sdk-2.3.3.jar:?]
	at com.fasterxml.jackson.databind.deser.AbstractDeserializer.deserializeWithType(AbstractDeserializer.java:263) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:138) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:314) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:177) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer._deserializeFromArray(CollectionDeserializer.java:359) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:244) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:28) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:314) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:177) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:314) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:177) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:314) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:177) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:323) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4730) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3677) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3645) ~[jackson-databind-2.14.2.jar:2.14.2]
	at com.casper.sdk.service.impl.event.EventBuilder.buildPojoEvent(EventBuilder.java:121) ~[casper-java-sdk-2.3.3.jar:?]
	... 14 more
@meywood meywood added the bug Something isn't working label Aug 7, 2023
@meywood
Copy link
Collaborator Author

meywood commented Jan 29, 2024

After discussions with Ed. Any step transform that contains an 'Any' data type should not try to desierialize the bytes from the transform JSON array but just implement the JSON

@meywood meywood self-assigned this Jan 29, 2024
@meywood meywood linked a pull request Feb 5, 2024 that will close this issue
cnorburn added a commit that referenced this issue Feb 14, 2024
Issues/200 - Issues with nested Any in events
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant