Skip to content

[JENKINS-29507] JenkinsRule initialization failed on a platform un-supported by JNA #21278

Description

@jenkins-infra-bot

org.jvnet.hudson.test.JenkinsRule contains static initialization block with:

if (!Functions.isWindows()) {
    try {
GNUCLibrary.LIBC.unsetenv("MAVEN_OPTS");
GNUCLibrary.LIBC.unsetenv("MAVEN_DEBUG_OPTS");
    } catch (Exception e) {
LOGGER.log(Level.WARNING,"Failed to cancel out MAVEN_OPTS",e);
    }
}

This part of code doesn't work as expected in the situation when loading "c" library fails. The exception can't be caught in the static block.

Above means a testsuite can't be executed on by JNA un-supported platform when JenkinsRule is used (obviously by many plug-ins).

Stacktrace looks similar like:

java.lang.UnsatisfiedLinkError: Native library (com/sun/jna/hp-ux-ia64n/libjnidispatch.so) not found in resource path ([file:/hudson_workspace/workspace/HTS-ProcCleanerCI/target/surefire/surefirebooter7685486171447239626.jar])
 	at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:776)
 	at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:736)
 	at com.sun.jna.Native.(Native.java:131)
 	at org.jvnet.hudson.test.JenkinsRule.(JenkinsRule.java:2129)
 	at org.jenkinsci.plugins.proccleaner.PsCleanerTest.(PsCleanerTest.java:68)

PsCleanerTest.java:68 : @​Rule public JenkinsRule j = new JenkinsRule();
JenkinsRule.java:2129 : GNUCLibrary.LIBC.unsetenv("MAVEN_OPTS");


Originally reported by pajasoft, imported from: JenkinsRule initialization failed on a platform un-supported by JNA
  • status: Resolved
  • priority: Major
  • component(s): core
  • resolution: Fixed
  • resolved: 2015-09-17T18:04:49+00:00
  • votes: 0
  • watchers: 3
  • imported: 2025-11-24
Raw content of original issue

org.jvnet.hudson.test.JenkinsRule contains static initialization block with:

        if (!Functions.isWindows()) {
            try {
                GNUCLibrary.LIBC.unsetenv("MAVEN_OPTS");
                GNUCLibrary.LIBC.unsetenv("MAVEN_DEBUG_OPTS");
            } catch (Exception e) {
                LOGGER.log(Level.WARNING,"Failed to cancel out MAVEN_OPTS",e);
            }
        }

This part of code doesn't work as expected in the situation when loading "c" library fails. The exception can't be caught in the static block.

Above means a testsuite can't be executed on by JNA un-supported platform when JenkinsRule is used (obviously by many plug-ins).

Stacktrace looks similar like:

java.lang.UnsatisfiedLinkError: Native library (com/sun/jna/hp-ux-ia64n/libjnidispatch.so) not found in resource path ([file:/hudson_workspace/workspace/HTS-ProcCleanerCI/target/surefire/surefirebooter7685486171447239626.jar])
 	at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:776)
 	at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:736)
 	at com.sun.jna.Native.<clinit>(Native.java:131)
 	at org.jvnet.hudson.test.JenkinsRule.<clinit>(JenkinsRule.java:2129)
 	at org.jenkinsci.plugins.proccleaner.PsCleanerTest.<init>(PsCleanerTest.java:68)

PsCleanerTest.java:68 : @Rule public JenkinsRule j = new JenkinsRule(); JenkinsRule.java:2129 : GNUCLibrary.LIBC.unsetenv("MAVEN_OPTS");

  • environment: PPC64, HP-UX etc.

No activity

Activity on this issue will appear here.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions