3

我们已经安排了一个 Jenkins 构建来创建 AWS 虚拟机,虚拟机成功上线,但是在归档工件时,作业失败并出现以下错误消息。

Archiving artifacts
ERROR: Step ‘Archive the artifacts’ aborted due to exception: 
java.lang.NoClassDefFoundError: Could not initialize class sun.nio.fs.LinuxNativeDispatcher
    at sun.nio.fs.LinuxUserDefinedFileAttributeView.copyExtendedAttributes(LinuxUserDefinedFileAttributeView.java:291)
    at sun.nio.fs.LinuxFileSystem.copyNonPosixAttributes(LinuxFileSystem.java:72)
    at sun.nio.fs.UnixCopyFile.copyFile(UnixCopyFile.java:267)
    at sun.nio.fs.UnixCopyFile.copy(UnixCopyFile.java:581)
    at sun.nio.fs.UnixFileSystemProvider.copy(UnixFileSystemProvider.java:253)
    at java.nio.file.Files.copy(Files.java:1274)
    at hudson.FilePath$31$1.visit(FilePath.java:2296)
    at hudson.util.DirScanner.scanSingle(DirScanner.java:44)
    at hudson.FilePath$ExplicitlySpecifiedDirScanner.scan(FilePath.java:2991)
    at hudson.FilePath$31.invoke(FilePath.java:2290)
    at hudson.FilePath$31.invoke(FilePath.java:2283)
    at hudson.FilePath.act(FilePath.java:1042)
    at hudson.FilePath.act(FilePath.java:1025)
    at hudson.FilePath.copyRecursiveTo(FilePath.java:2283)
    at jenkins.model.StandardArtifactManager.archive(StandardArtifactManager.java:61)
    at hudson.tasks.ArtifactArchiver.perform(ArtifactArchiver.java:235)
    at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
    at hudson.model.Build$BuildExecution.post2(Build.java:186)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
    at hudson.model.Run.execute(Run.java:1823)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:429)

是什么导致了这个问题以及如何解决它?

4

3 回答 3

3

我在 Centos7 系统中遇到了同样的问题并解决了安装新 jdk 并使用 /usr/sbin/alternatives --config java 设置默认 jdk

之后,重新启动 Jenkins,仅此而已

于 2018-11-16T10:38:08.883 回答
1

在我们的例子中,这是由openjdkJenkins 运行时更新包引起的。詹金斯重启修复了它。可能是由指向当前 JVM 目录的旧符号链接引起的。

于 2019-08-19T17:35:24.490 回答
-1

禁用apparrmor

/etc/init.d/apparmor stop
于 2018-08-21T10:27:21.027 回答