JDK-8244634 : LoadLibraryW failed from tools/jpackage tests after JDK-8242302
  • Type: Bug
  • Component: tools
  • Sub-Component: jpackage
  • Affected Version: 15
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: windows
  • Submitted: 2020-05-08
  • Updated: 2020-08-10
  • Resolved: 2020-05-12
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 15
15 b23Fixed
Related Reports
Relates :  
Relates :  
Description
After JDK-8242302, many tools/jpackage tests failed on Windows system (tested Windows 2016), due to LoadLibraryW( ...bin\jli.dll) faild. System error [126], screenshot attached.

Comments
I believe that with JDK-8242302 (since jpackageapplauncher began to be linked statically) the call inside JLI_LAUNCH at java_md.c:725 if (!hSplashLib) { hSplashLib = LoadLibrary(libraryPath); } has failed, even though librarypath is correct
10-08-2020

URL: https://hg.openjdk.java.net/jdk/jdk/rev/99fe4024af19 User: asemenyuk Date: 2020-05-12 23:48:39 +0000
12-05-2020

Review: http://cr.openjdk.java.net/~asemenyuk/8244634/webrev.01/
12-05-2020

By some reason loading of dependent dlls from the directory where dll requested for load by LoadLibrary() resides doesn't work. This is either test system specific issue or Windows 2016 specific issue. Anyways adding path to the runtime/bin directory of the app to PATH environment variable solves the problem. Altering PATH env variable might be not the best option though. Calling AddDllDirectory() before LoadLibrary() can be the better alternative. UPD: Tried adding call to AddDllDirectory() before LoadLibrary() and it didn't work. Trying the fix with adjusting PATH env variable instead.
11-05-2020

jpackage tests running in Mahc5 jobs don't fail though. Can you run the test with environment variable "JPACKAGE_DEBUG" set to "true"?
08-05-2020

Reproducible by simply run jtreg -nr -v1 -jdk:jdk open/test/jdk/tools/jpackage/share/JavaOptionsTest.java Test passed before JDK-8242302, fail with system error (see screenshot) with/after JDK-8242302 There are many other jpackage tests run into the same error.
08-05-2020