Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-15466

Fatal Error No Class Definition found for Kernel32

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Fixed
    • core
    • Windows 7 64bit
      jdk1.7.0_07

    Description

      Hi,
      We are periodically getting issues with the hudson.util.jna.Kernel32 class not being found when plugins are calling the isSymlink method.

      [xUnit] [INFO] - [UnitTest-1.4 (default)] - 1 test report file(s) were found with the pattern 'tests.xml' relative to 'C:\Jenkins\jobs\NetworkTeam Test\workspace' for the testing framework 'UnitTest-1.4 (default)'.
      FATAL: Could not initialize class hudson.util.jna.Kernel32
      java.lang.NoClassDefFoundError: Could not initialize class hudson.util.jna.Kernel32
      	at hudson.util.jna.Kernel32Utils.isJunctionOrSymlink(Kernel32Utils.java:62)
      	at hudson.Util.isSymlink(Util.java:322)
      	at hudson.Util.deleteRecursive(Util.java:283)
      	at hudson.FilePath$11.invoke(FilePath.java:982)
      	at hudson.FilePath$11.invoke(FilePath.java:980)
      	at hudson.FilePath.act(FilePath.java:851)
      	at hudson.FilePath.act(FilePath.java:824)
      	at hudson.FilePath.deleteRecursive(FilePath.java:980)
      	at org.jenkinsci.plugins.xunit.XUnitPublisher.processDeletion(XUnitPublisher.java:374)
      	at org.jenkinsci.plugins.xunit.XUnitPublisher.performXUnit(XUnitPublisher.java:124)
      	at org.jenkinsci.plugins.xunit.XUnitPublisher.perform(XUnitPublisher.java:93)
      	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:807)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:782)
      	at hudson.model.Build$BuildExecution.post2(Build.java:183)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:729)
      	at hudson.model.Run.execute(Run.java:1541)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      	at hudson.model.ResourceController.execute(ResourceController.java:88)
      	at hudson.model.Executor.run(Executor.java:236)
      

      The class file seems to be present and correct compared with the github versions and we are running with Admin access to the filesystem.

      Any help would be appreciated.
      Rob

      Attachments

        Issue Links

          Activity

            pixman20 pixman20 added a comment -

            Since this is fixed on the trunk, will/can this be marked as resolved soon so that it can be released into 1.504?

            pixman20 pixman20 added a comment - Since this is fixed on the trunk, will/can this be marked as resolved soon so that it can be released into 1.504?

            And what is also very important when it could be released in LTS?

            nickolayr Nickolay Rumyantsev added a comment - And what is also very important when it could be released in LTS?

            Code changed in jenkins
            User: Jesse Glick
            Path:
            changelog.html
            core/src/main/java/hudson/Util.java
            core/src/main/java/hudson/util/jna/Kernel32Utils.java
            http://jenkins-ci.org/commit/jenkins/010866ba90fb7af074c5c447c1bd5143f60c00e2
            Log:
            [FIXED JENKINS-15466] More robust handling of Windows JNA errors.
            b5ed319 already caught linkage errors but then unconditionally returned false from Util.isSymlink, which is wrong;
            we want to fall back to the generic File.canonicalPath comparisons in this case.


            You received this message because you are subscribed to the Google Groups "Jenkins Commits" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com.
            For more options, visit https://groups.google.com/groups/opt_out.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html core/src/main/java/hudson/Util.java core/src/main/java/hudson/util/jna/Kernel32Utils.java http://jenkins-ci.org/commit/jenkins/010866ba90fb7af074c5c447c1bd5143f60c00e2 Log: [FIXED JENKINS-15466] More robust handling of Windows JNA errors. b5ed319 already caught linkage errors but then unconditionally returned false from Util.isSymlink, which is wrong; we want to fall back to the generic File.canonicalPath comparisons in this case. – You received this message because you are subscribed to the Google Groups "Jenkins Commits" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out .
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #2308
            [FIXED JENKINS-15466] More robust handling of Windows JNA errors. (Revision 010866ba90fb7af074c5c447c1bd5143f60c00e2)

            Result = SUCCESS
            Jesse Glick : 010866ba90fb7af074c5c447c1bd5143f60c00e2
            Files :

            • core/src/main/java/hudson/Util.java
            • changelog.html
            • core/src/main/java/hudson/util/jna/Kernel32Utils.java
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #2308 [FIXED JENKINS-15466] More robust handling of Windows JNA errors. (Revision 010866ba90fb7af074c5c447c1bd5143f60c00e2) Result = SUCCESS Jesse Glick : 010866ba90fb7af074c5c447c1bd5143f60c00e2 Files : core/src/main/java/hudson/Util.java changelog.html core/src/main/java/hudson/util/jna/Kernel32Utils.java

            I am facing this issue on version 2.73.2. Please find the log file below.

            Nov 02, 2017 3:41:48 PM hudson.remoting.jnlp.Main$CuiListener status
            INFO: Remote identity confirmed: fe:69:3c:a5:b3:d4:da:b1:4d:b4:d9:1b:0d:9a:1b:b4
            Nov 02, 2017 3:41:48 PM hudson.remoting.jnlp.Main$CuiListener status
            INFO: Connected
            WARNING: An illegal reflective access operation has occurred
            WARNING: Illegal reflective access by hudson.remoting.RemoteClassLoader (file:/C:/Users/jenkins/Desktop/slave.jar) to method java.lang.ClassLoader.getClassLoadingLock(java.lang.String)
            WARNING: Please consider reporting this to the maintainers of hudson.remoting.RemoteClassLoader
            WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
            WARNING: All illegal access operations will be denied in a future release
            Nov 02, 2017 3:41:55 PM hudson.util.jna.Kernel32Utils load
            SEVERE: Failed to load Kernel32
            java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
            at hudson.util.jna.Kernel32Utils.load(Kernel32Utils.java:112)
            at hudson.util.jna.Kernel32.<clinit>(Kernel32.java:37)
            at hudson.util.jna.Kernel32Utils.getWin32FileAttributes(Kernel32Utils.java:77)
            at hudson.util.jna.Kernel32Utils.isJunctionOrSymlink(Kernel32Utils.java:98)
            at hudson.Util.isSymlink(Util.java:513)
            at hudson.FilePath.deleteRecursive(FilePath.java:1201)
            at hudson.FilePath.deleteContentsRecursive(FilePath.java:1220)
            at hudson.FilePath.access$1100(FilePath.java:197)
            at hudson.FilePath$15.invoke(FilePath.java:1194)
            at hudson.FilePath$15.invoke(FilePath.java:1191)
            at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2750)
            at hudson.remoting.UserRequest.perform(UserRequest.java:153)
            at hudson.remoting.UserRequest.perform(UserRequest.java:50)
            at hudson.remoting.Request$2.run(Request.java:336)
            at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
            at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
            at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
            at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
            at hudson.remoting.Engine$1$1.run(Engine.java:94)
            at java.base/java.lang.Thread.run(Unknown Source)

            rakeshnambiar Rakesh Nambiar added a comment - I am facing this issue on version 2.73.2. Please find the log file below. Nov 02, 2017 3:41:48 PM hudson.remoting.jnlp.Main$CuiListener status INFO: Remote identity confirmed: fe:69:3c:a5:b3:d4:da:b1:4d:b4:d9:1b:0d:9a:1b:b4 Nov 02, 2017 3:41:48 PM hudson.remoting.jnlp.Main$CuiListener status INFO: Connected WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by hudson.remoting.RemoteClassLoader ( file:/C:/Users/jenkins/Desktop/slave.jar ) to method java.lang.ClassLoader.getClassLoadingLock(java.lang.String) WARNING: Please consider reporting this to the maintainers of hudson.remoting.RemoteClassLoader WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release Nov 02, 2017 3:41:55 PM hudson.util.jna.Kernel32Utils load SEVERE: Failed to load Kernel32 java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native at hudson.util.jna.Kernel32Utils.load(Kernel32Utils.java:112) at hudson.util.jna.Kernel32.<clinit>(Kernel32.java:37) at hudson.util.jna.Kernel32Utils.getWin32FileAttributes(Kernel32Utils.java:77) at hudson.util.jna.Kernel32Utils.isJunctionOrSymlink(Kernel32Utils.java:98) at hudson.Util.isSymlink(Util.java:513) at hudson.FilePath.deleteRecursive(FilePath.java:1201) at hudson.FilePath.deleteContentsRecursive(FilePath.java:1220) at hudson.FilePath.access$1100(FilePath.java:197) at hudson.FilePath$15.invoke(FilePath.java:1194) at hudson.FilePath$15.invoke(FilePath.java:1191) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2750) at hudson.remoting.UserRequest.perform(UserRequest.java:153) at hudson.remoting.UserRequest.perform(UserRequest.java:50) at hudson.remoting.Request$2.run(Request.java:336) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68) at java.base/java.util.concurrent.FutureTask.run(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at hudson.remoting.Engine$1$1.run(Engine.java:94) at java.base/java.lang.Thread.run(Unknown Source)

            People

              Unassigned Unassigned
              rstarkey Rob Starkey
              Votes:
              14 Vote for this issue
              Watchers:
              29 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: