alibaba / alibaba/fastjson2

[BUG]com.alibaba.fastjson2.JSONException: create objectReader error, objectType

Open
#2,995 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
4.4k
Forks
613
Avg merge
1d 22h
Merged PRs (30d)
6

Description

### 问题描述
*简要描述您碰到的问题。*

image

### 环境信息
*请填写以下信息:*

- OS信息: [e.g.:windos7 or windo10]
- JDK信息: [e.g.:jdk 1.8 32位]
- 版本信息:[e.g.:Fastjson2 2.0.51]

### 重现步骤
*如何操作可以重现该问题:*
暂时我也不清楚,客户侧偶发产生的问题,没有相关日志收集到

```java
Map map = new HashMap<>();
String jsonString = JSON.toJSONString(map);
return JSON.parseObject(jsonString, tClass);
```

### 期待的正确结果
*对您期望发生的结果进行清晰简洁的描述。*
JSON.parseObject(jsonString, tClass); 执行正常

### 相关日志输出
*请复制并粘贴任何相关的日志输出。*
com.alibaba.fastjson2.JSONException: create objectReader error, objectType com.mes.employee.bean.req.login.LogoutRequest
at com.alibaba.fastjson2.reader.ObjectReaderCreatorASM.jitObjectReader(ObjectReaderCreatorASM.java:619)
at com.alibaba.fastjson2.reader.ObjectReaderCreatorASM.createObjectReader(ObjectReaderCreatorASM.java:347)
at com.alibaba.fastjson2.reader.ObjectReaderProvider.getObjectReaderInternal(ObjectReaderProvider.java:831)
at com.alibaba.fastjson2.reader.ObjectReaderProvider.getObjectReader(ObjectReaderProvider.java:753)
at com.alibaba.fastjson2.JSON.parseObject(JSON.java:858)

#### 附加信息
*如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。*
由此问题是否会导致metaspace的溢出,因为我的程序后续就出现了java.lang.OutOfMemoryError: Metaspace

Contributor guide

Open the contributing guide

Research direction

Start with the provided JSON.parseObject(jsonString, tClass) example and inspect ObjectReaderCreatorASM.java at jitObjectReader (line 619), createObjectReader (line 347), and ObjectReaderProvider.java at lines 831 and 753. A useful next step is to obtain the missing OS, JDK, Fastjson2 version, LogoutRequest definition, and a reproducible failure. Done means the failure is reproducible and parsing completes without the reported exception or unexplained Metaspace growth.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
18/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.