Skip to content

NullPointerException in JSON codec parsing stream encoded with Jackson Smile #24009

@feutche

Description

@feutche

Affects: 5.1.11

Using Spring 5.1.11, Spring Boot 2.1.10, Jackson 2.10.1, but it was there in previous versions as well.

There seems to be an issue in Spring Web with #20699, streaming Smile encoded data.

I'm trying to receive a stream of objects created by Spring WebFlux app as Flux<T> using Smile encoding. JSON stream works OK.

With Smile most of the time I get NullPointerException:

at com.fasterxml.jackson.databind.util.TokenBuffer.copyCurrentEvent(TokenBuffer.java:1032)
at org.springframework.http.codec.json.Jackson2Tokenizer.processTokenArray(Jackson2Tokenizer.java:170)
at org.springframework.http.codec.json.Jackson2Tokenizer.parseTokenBufferFlux(Jackson2Tokenizer.java:135)
at org.springframework.http.codec.json.Jackson2Tokenizer.tokenize(Jackson2Tokenizer.java:94)

It seems that current token of parser passed to copyCurrentEvent is null.

I'm trying now to understand how exactly does it happen but decided to raise the issue anyway.

Unfortunately it's not the easiest one to debug as it goes away if you slow it down, which probably suggests that the problem manifests itself when there's no input available to process as next array element is not received yet.

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions