RFR: 8359423: Improve error message in case of missing jsa shared archive [v5]
Martin Doerr
mdoerr at openjdk.org
Thu Sep 11 15:47:34 UTC 2025
On Thu, 11 Sep 2025 12:00:33 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:
>> In case we use `-Xshare:on` with additional flags (regarding coh or coops) and we have the corresponding jsa archive not present,
>> we get this message/error :
>>
>>
>> Error occurred during initialization of VM
>> Unable to use shared archive.
>>
>>
>> The error message could be a little improved, e.g. telling what jsa file is not present .
>> For example
>>
>>
>> ./images/jdk/bin/java -Xshare:on -version
>> [0.017s][error][aot] Opening of static archive /build_linux/images/jdk/lib/server/classes.jsa failed
>> Error occurred during initialization of VM
>> Unable to use shared archive (unrecoverable archive loading error).
>
> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
>
> Fix message
Otherwise, LGTM.
src/hotspot/share/cds/aotMetaspace.cpp line 1291:
> 1289: vm_exit_during_initialization("Unable to use AOT cache.", nullptr);
> 1290: } else {
> 1291: vm_exit_during_initialization("Unable to use shared archive. Unrecoverable archive loading error", message);
Maybe we should add a hint like "Run with -Xlog:aot,cds for details."?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25846#issuecomment-3281519585
PR Review Comment: https://git.openjdk.org/jdk/pull/25846#discussion_r2341512385
More information about the hotspot-runtime-dev
mailing list