alibaba / alibaba/fastjson2

[QUESTION]序列化对象的构造函数问题

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

Description

### 请描述您的问题
序列化对象的构造函数包含不存在的类会报ClassNotFound,比如说我封装了一个通用jar和通用对象,但是这个通用jar中的通用对象构造函数依赖了一个`true`的类库,序列化时报NoClassDefFoundError,使用时没有用这个包含不存在类的构造函数,请问一下有何方法避免NoClassDefFoundError

Contributor guide

Open the contributing guide

Research direction

Start by reproducing serialization of the generic object with its optional dependency absent, using the constructor scenario described in the issue. Investigate how fastjson2 loads or inspects constructors when the referenced class is unavailable. Done means establishing whether this is expected behavior and documenting or implementing a reliable way to avoid NoClassDefFoundError.

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
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.