Skip to content

Conversation

@LuotuoMianyang
Copy link

Motivation

问题描述 在使用 SOFAArk 3.1.10 和 Spring Boot 3.2.1 时,安装 declaredMode=true 的 biz 模块时出现 File must exist 错误。错误发生在 biz 模块启动 Spring Boot 应用时,SOFAArk 的 parseArtifactId() 方法尝试访问已被删除的原始 JAR 文件。

关联issue:
#1101

Modification

Describe the idea and modifications you've done.

Result

Resolved or fixed #<1101>.

If there is no issue then describe the changes introduced by this PR.

@sofastack-cla
Copy link

sofastack-cla bot commented Nov 17, 2025

Hi @LuotuoMianyang, welcome to SOFAStack community, Please sign Contributor License Agreement!

After you signed CLA, we will automatically sync the status of this pull request in 3 minutes.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 17, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@LuotuoMianyang LuotuoMianyang changed the base branch from master to 3.1.x November 17, 2025 03:41
}
if (jarLocation.startsWith("file:")) {
jarLocation = jarLocation.substring("file:".length());
if (!jarLocation.endsWith(JAR_UNPACK)) {
Copy link
Collaborator

@lvjing2 lvjing2 Dec 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. 先确认下 jar_unpack 路径产生的时机是什么?
  2. 单独对 jar_unpack 逻辑定制处理是否合理?
  3. 这个路径文件,不去clean prefix、suffix,但后面的 parseArtifactId 逻辑还会执行,会有什么不同?为何不直接返回。
  4. 函数里对 IOException 做过处理,对 File must exist 异常也可以做下处理。
image

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

master代码里面似乎之前针对这里做过一些处理,针对.jar 为结尾的jarLocation做的处理

上述问题发生时机为安装biz的时候,默认会选择unpack,从unpack中加载资源,2.1 之前没有问题,3.x中新增了截图中的逻辑,但是unpakc的路径 是jar_unpack_XX ,导致找资源失败,从而导致安装biz模块失败,这里是加载biz模块的逻辑,失败了再做其他处理也没什么意义,可以看看master中 有
if (jarLocation.contains(JAR_SUFFIX)) { jarLocation = jarLocation.substring(0, jarLocation.lastIndexOf(JAR_SUFFIX) + JAR_SUFFIX.length()); }

 这样的逻辑是否合理

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

master代码里面似乎之前针对这里做过一些处理,针对.jar 为结尾的jarLocation做的处理

上述问题发生时机为安装biz的时候,默认会选择unpack,从unpack中加载资源,2.1 之前没有问题,3.x中新增了截图中的逻辑,但是unpakc的路径 是jar_unpack_XX ,导致找资源失败,从而导致安装biz模块失败,这里是加载biz模块的逻辑,失败了再做其他处理也没什么意义,可以看看master中 有
if (jarLocation.contains(JAR_SUFFIX)) { jarLocation = jarLocation.substring(0, jarLocation.lastIndexOf(JAR_SUFFIX) + JAR_SUFFIX.length()); }

 这样的逻辑是否合理

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants