An exception is thrown when using the static variable Map as a return
com.alibaba.fastjson.JSONException: write javaBean error, fastjson version 1.2.76, class org.apache.flink.table.data.binary.BinaryStringData, fieldName : id, Memory segment does not represent off heap memory
The rest of the code remains unchanged, and only an empty new Map is returned. The result is normal, which proves that there is a problem with the encoding of the fields inside, so it can be re-encoded
for (Map<String, Object> map : FakerConstant.TABLE_ROW_DATA_RESULT) {
Map<String, Object> m = new HashMap<>();
map.forEach((key, value) -> {
m.put(
// You need to re-encode it, otherwise it will report FastJson exception. write javaBean error, fastjson version 1.2.76
new String(key.getBytes(), StandardCharsets.UTF_8),
new String(String.valueOf(value).getBytes(), StandardCharsets.UTF_8)););
});
res.add(m);
}
Read More:
- [Solved] fastjson Error: write javaBean error, fastjson version 1.2.76, class io.undertow.servlet.xx
- [Solved] Failed toString() invocation on an object com.alibaba.fastjson.JSONException: write javaBean error
- [Solved] org.apache.flink.client.program.ProgramInvocationException: The main method caused an error
- JAVA Error: package org.apache.commons.codec.binary does not exist
- [Solved] java.lang.IllegalAccessError: class org.springframework.data.redis.core.$ Proxy237 cannot access its superinterface org.springframework.data.redis.core.RedisConnectionUtils$RedisConnectionProxy
- When the database table field is set to self incrementing, use the entity class to insert or update the data to solve the error (Hibernate Framework)
- [Solved] org.apache.maven.archiver.MavenArchiver.getManifest(org.apache.maven.project.MavenProject…
- [Solved] Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version of
- Ali easyexcel error: org.apache.poi.ss.usermodel.font.setbold (z) V
- [Solved] Consider defining a bean of type ‘org.springframework.data.redis.core.RedisTemplate‘ in your configu
- [Solved] Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException
- [Solved] org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession…
- Defining a bean of type ‘org.springframework.data.redis.core.RedisTemplate‘ in your configuration.
- [Solved] Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration
- Mybatis query error: Exception in thread “main” org.apache.ibatis.exceptions.PersistenceException…
- [Solved] org.apache.ibatis.executor.ExecutorException: No constructor found in void matching [java.lang.String]
- [Solved] com.alibaba.fastjson.JSONException: syntax error, pos 1, json
- [Solved] Java.lang.ClassNotFoundException: org.apache.commons.fileupload.FileItemFactory
- How to Solve Java Runtime (class file version 53.0)ERROR