[GRADLE-3288] Regression: JNA path conflicts in test execution JVM Created: 24/Apr/15  Updated: 28/Apr/15  Resolved: 28/Apr/15

Status: Resolved
Project: Gradle
Affects Version/s: 2.4-rc-1
Fix Version/s: 2.4-rc-2

Type: Bug
Reporter: Sterling Greene Assignee: Gary Hale
Resolution: Fixed Votes: 0



I have a project where the unit tests fail with Gradle 2.4.-rc-1 but pass with Gradle 2.3

I'm going to try to narrow it down further but the errors I'm getting suggest classloader issues. I get one java.lang.UnsatisfiedLinkError and several java.lang.NoClassDefFoundError

I should add that not all the unit test fail. 33 completed 11 failed.

The unsatisfied link error is JNA releated (I believe we've seen this happen before in other contexts).. Our project uses JNA and apparently so does Gradle.

java.lang.UnsatisfiedLinkError: Unable to load library 'shell32': com.sun.jna.Native.open(Ljava/lang/String;)J
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:166)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:239)
at com.sun.jna.Library$Handler.(Library.java:140)
at com.sun.jna.Native.loadLibrary(Native.java:393)
at com.sun.jna.platform.win32.Shell32.(Shell32.java:30)
at my.code.is.here.Utility.getUserAppDataDir(Utility.java:82)

Comment by Gary Hale [ 28/Apr/15 ]

This was due to the initialization of NativeServices in ActionExecutionWorker which had the side-effect of initializing the JNA libraries as well. It's been changed so that ActionExecutionWorker still initializes NativeServices, but does not initialize the JNA stuff (as it's not needed there).

Generated at Wed Jun 30 12:44:53 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.