SerializeNullable annotation not work
See original GitHub issueprotocol
public class GetUserIdByIdRes {
private @SerializeNullable byte[] userId;
public GetUserIdByIdRes(@Deserialize("userId") byte[] userId) {
this.userId = userId;
}
@Serialize
public byte[] getUserId() {
return userId;
}
}
exception
java.util.concurrent.ExecutionException: io.activej.rpc.protocol.RpcRemoteException: java.lang.NullPointerException
at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1928)
at com.test.rookiedb.rpc.RookieClient.multiGet(RookieClient.java:150)
at com.test.rookiedb.rpc.RookieClient.getUserIdById(RookieClient.java:168)
at com.test.rookiedb.RookieDbEngine.getUserIdById(RookieDbEngine.java:190)
at com.test.BaseEngine.read(BaseEngine.java:164)
at com.test.DefaultEngine.read(DefaultEngine.java:116)
at com.test.DefaultEngineTest$ReadTask.run(DefaultEngineTest.java:161)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
at java.util.concurrent.FutureTask.run(FutureTask.java)
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)
Caused by: io.activej.rpc.protocol.RpcRemoteException: java.lang.NullPointerException
Issue Analytics
- State:
- Created a year ago
- Comments:10
Top Results From Across the Web
How to tell Jackson to ignore a field during serialization if its ...
Include.NON_EMPTY indicates that property is serialized if its value is not null and not empty. Include.NON_NULL indicates that property is serialized if its ......
Read more >Ignore Null Fields with Jackson - Baeldung
This quick tutorial is going to cover how to set up Jackson to ignore null fields when serializing a java class.
Read more >Jackson - How to ignore null fields - Mkyong.com
To ignore the null fields, put @JsonInclude on class level or field level. 2. @JsonInclude – Class Level. Staff.java. import com.fasterxml.
Read more >OpenAPITools/jackson-databind-nullable - GitHub
This module provides a JsonNullable wrapper class and a Jackson module to serialize/deserialize it. The JsonNullable wrapper shall be used to wrap Java...
Read more >Ignore Null Fields with Jackson in Java and Spring Boot
In this tutorial, learn how to ignore null fields when serializing POJOs with Jackson, in Java and Spring Boot.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
In your original example, the location of the annotations is not correct. There are two solutions: either without getter and with public userId
in this case annotaion @Deserialize not required
or with getter with all serialize annotaions and priavte userId
@KciNKh thanks for your help~