Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]开启 JDK9 Module功能,fastjson2 和 fastjson2-extension 包的 module name 同名 #1923

Closed
EthanKk opened this issue Oct 8, 2023 · 9 comments
Labels
bug Something isn't working fixed
Milestone

Comments

@EthanKk
Copy link

EthanKk commented Oct 8, 2023

问题描述

开启 JDK9 Module功能,fastjson2 和 fastjson2-extension 包的 module name 同名

环境信息

请填写以下信息:

  • JDK信息: [e.g.:Oracle jdk 17]
  • 版本信息:[e.g.:Fastjson2 2.0.41]

重现步骤

在代码中使用 com.alibaba.fastjson2.support.config.FastJsonConfig 类,需要在 module-info.java 中 requires com.alibaba.fastjson2。
FastJsonConfig 类在 fastjson2-extension.jar 中,此 jar 的 module-info.java 中配置的 module name 为 com.alibaba.fastjson2。

但是 fastjson2.jar 中 module-info.java 配置的 module name 同样为 com.alibaba.fastjson2,两个 jar 的 module name 同名。

当两个 jar 同时被引用时,根据 module name 冲突

此 bug 为 #1856 修复后的新 bug

@EthanKk EthanKk added the bug Something isn't working label Oct 8, 2023
@wenshao wenshao added this to the 2.0.42 milestone Oct 8, 2023
@yanxutao89
Copy link
Collaborator

麻烦提供下可以复现的测试示例吧

@EthanKk
Copy link
Author

EthanKk commented Oct 26, 2023

image
不同 jar 包使用了相同的 module name

@wenshao wenshao modified the milestones: 2.0.42, 2.0.43 Nov 5, 2023
@wenshao
Copy link
Member

wenshao commented Dec 3, 2023

2.0.42版本这个问题还存在么?

@wenshao wenshao modified the milestones: 2.0.43, 2.0.44 Dec 3, 2023
@EthanKk
Copy link
Author

EthanKk commented Dec 4, 2023

2.0.42版本这个问题还存在么?

这边版本中还是一样存在这个问题

image

@wenshao wenshao modified the milestones: 2.0.44, 2.0.45 Dec 24, 2023
@wenshao
Copy link
Member

wenshao commented Dec 29, 2023

@EthanKk
Copy link
Author

EthanKk commented Jan 2, 2024

https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.45-SNAPSHOT/ 请帮2.0.45-SNAPSHOT验证问题是否已经修复

是 fastjson2-extension 包中的 module name 不对,而不是 fastjson2 包。
看了fastjson2-extension的源码,并没有显式指定 module-info.java,但 jar 包中有 module-info.class,里面的 module name 仍然是是错的:
image

@wenshao
Copy link
Member

wenshao commented Jan 2, 2024

@EthanKk
Copy link
Author

EthanKk commented Jan 4, 2024

https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2-extension/2.0.45-SNAPSHOT/

2.0.45-SNAPSHOT我看到已经改好了

恩,最新的快照里已经 ok 了

@wenshao wenshao added the fixed label Jan 7, 2024
@wenshao
Copy link
Member

wenshao commented Jan 7, 2024

https://github.com/alibaba/fastjson2/releases/tag/2.0.45
问题已修复,请用新版本

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed
Projects
None yet
Development

No branches or pull requests

3 participants