linux 启动Jenkins时遇到问题:“java.io.文件未找到异常:/usr/share/java/jenkins/war/元信息/清单.MF(没有这样的文件或目录)”

yfwxisqw  于 2023-02-18  发布在  Linux
关注(0)|答案(8)|浏览(540)

我刚下载了Jenkins WAR,版本1.651.1。我正尝试在我的Amazon Linux机器上设置它。我运行的是Java 1.7。我将WAR移动到它自己的目录/usr/share/java/jenkins中,然后将JENKINS_HOME设置为该目录。然后我运行了这里列出的命令-https://wiki.jenkins-ci.org/display/JENKINS/Starting+and+Accessing+Jenkins。在网站上看起来很简单。但我得到了以下错误:

[davea@mydevbox ~]$ java -jar /usr/share/java/jenkins/jenkins.war 
Running from: /usr/share/java/jenkins/jenkins.war
webroot: EnvVars.masterEnvVars.get("JENKINS_HOME")
Apr 19, 2016 9:29:34 PM winstone.Logger logInternal
INFO: Beginning extraction from war file
Apr 19, 2016 9:29:34 PM winstone.Logger logInternal
INFO: Winstone shutdown successfully
Apr 19, 2016 9:29:34 PM winstone.Logger logInternal
SEVERE: Container startup failed
java.io.FileNotFoundException: /usr/share/java/jenkins/war/META-INF/MANIFEST.MF (No such file or directory)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
    at winstone.HostConfiguration.getWebRoot(HostConfiguration.java:280)
    at winstone.HostConfiguration.<init>(HostConfiguration.java:83)
    at winstone.HostGroup.initHost(HostGroup.java:66)
    at winstone.HostGroup.<init>(HostGroup.java:45)
    at winstone.Launcher.<init>(Launcher.java:145)
    at winstone.Launcher.main(Launcher.java:356)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at Main._main(Main.java:307)
    at Main.main(Main.java:98)

我还需要做什么才能让Jenkins开始呢?

**编辑:**响应给定建议的输出...

[davea@mydevbox ~]$ sudo useradd jenkins
[davea@mydevbox ~]$ sudo chown -R jenkins:jenkins /usr/share/java/jenkins/jenkins.war 
[davea@mydevbox ~]$ 
[davea@mydevbox ~]$ sudo su - jenkins
[jenkins@mydevbox ~]$ java -jar /usr/share/java/jenkins/jenkins.war
Running from: /usr/share/java/jenkins/jenkins.war
webroot: EnvVars.masterEnvVars.get("JENKINS_HOME")
Apr 21, 2016 4:46:08 PM winstone.Logger logInternal
INFO: Beginning extraction from war file
Apr 21, 2016 4:46:08 PM winstone.Logger logInternal
INFO: Winstone shutdown successfully
Apr 21, 2016 4:46:08 PM winstone.Logger logInternal
SEVERE: Container startup failed
java.io.FileNotFoundException: /usr/java/jboss/standalone/deployments/jenkins.war/war/META-INF/MANIFEST.MF (No such file or directory)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
    at winstone.HostConfiguration.getWebRoot(HostConfiguration.java:280)
    at winstone.HostConfiguration.<init>(HostConfiguration.java:83)
    at winstone.HostGroup.initHost(HostGroup.java:66)
    at winstone.HostGroup.<init>(HostGroup.java:45)
    at winstone.Launcher.<init>(Launcher.java:145)
    at winstone.Launcher.main(Launcher.java:356)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at Main._main(Main.java:307)
    at Main.main(Main.java:98)
wr98u20j

wr98u20j1#

我认为这是一个许可相关的问题。
我猜用户和组所有者被设置为与jenkins试图运行的用户不同的用户。尝试使用以下命令正确设置:

$sudo chown -R <jenkins_user><jenkins_group> /usr/share/java/jenkins/
0g0grzrc

0g0grzrc2#

"java. io.文件未找到异常:/usr/share/java/jenkins/war/元信息/清单. MF(没有这样的文件或目录)"
伙计们冷静点。
别受指挥。

mkdir/变量/缓存/Jenkins;搜索:Jenkins/var/cache/Jenkins;

然后启动应用程序。

wztqucjr

wztqucjr3#

我遇到了完全相同的问题。无法更改用户,我通过将--httpPort=9090附加到Java运行命令来更改托管端口。
$ java -jar /usr/share/java/jenkins/jenkins.war --httpPort=9090

zzwlnbp8

zzwlnbp84#

我的意见是:Jenkins用户不仅必须是$JENKINS_HOME的 * 所有者 *,而且看起来还必须是jenkins.war的 * 所有者 *(不仅仅是访问它)。在为Jenkins配置系统单元文件时发现了困难的方法。

yhuiod9q

yhuiod9q5#

您使用的用户ID可能不是JENKINS_HOME的所有者。
我在Vagrant上遇到过这种情况,当时我试图在vagrant拥有的JENKINS_HOME上使用jenkins用户。jenkins确实JENKINS_HOME具有写入权限,但这还不够:必须是主人。
我知道这一点是因为当我尝试sudo -u jenkins touch file-in-jenkins-home时,我得到了touch: setting times (...): Operation not permitted,然后我找到了https://unix.stackexchange.com/questions/64848/cannot-touch-m-a-writable-file

ylamdve6

ylamdve66#

在我的例子中,我遇到这个问题是因为一个名为"jenkins"的用户已经在我的mac上创建了。
之后:
1.用'/Library/Application Support/Jenkins/Uninstall.command'卸载损坏的Jenkins,
1.移除"Jenkins"用户,
1.并从https://jenkins.io/download重新安装

  • -〉一切都很顺利。
ki1q1bka

ki1q1bka7#

在我不小心删除了/var/cache/jenkins中该高速缓存后,我也遇到了同样的问题。我通过在/var/cache/中手动创建jenkins文件夹,并使用与/var/lib/jenkins中相同的权限来解决这个问题。

5ssjco0h

5ssjco0h8#

I have an old jenkins version 1.641, and downloaded the war file of 2.240.1, when run

java -jar jenkins.war

I got similar errors:
java.io.FileNotFoundException: c:\jenkins.jenkins\war\META-INF\MANIFEST.MF (Access is denied) at java.io.FileOutputStream.open0(Native Method) at java.io.FileOutputStream.open(Unknown Source) at java.io.FileOutputStream.(Unknown Source) at java.io.FileOutputStream.(Unknown Source) at winstone.HostConfiguration.getWebRoot(HostConfiguration.java:278) at winstone.HostConfiguration.(HostConfiguration.java:81) at winstone.HostGroup.initHost(HostGroup.java:66) at winstone.HostGroup.(HostGroup.java:45) at winstone.Launcher.(Launcher.java:172) at winstone.Launcher.main(Launcher.java:362) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at Main._main(Main.java:375) at Main.main(Main.java:151) 2020-02-07 22:06:19.010+0000 [id=1] SEVERE winstone.Logger#logInternal: Container startup failed java.io.FileNotFoundException: c:\jenkins.jenkins\war\META-INF\MANIFEST.MF (Access is denied) at java.io.FileOutputStream.open0(Native Method) at java.io.FileOutputStream.open(Unknown Source) at java.io.FileOutputStream.(Unknown Source) at java.io.FileOutputStream.(Unknown Source) at winstone.HostConfiguration.getWebRoot(HostConfiguration.java:278) at winstone.HostConfiguration.(HostConfiguration.java:81) at winstone.HostGroup.initHost(HostGroup.java:66) at winstone.HostGroup.(HostGroup.java:45) at winstone.Launcher.(Launcher.java:172) at winstone.Launcher.main(Launcher.java:362) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at Main._main(Main.java:375) at Main.main(Main.java:151)
it is found that the folder c:\jenkins\.jenkins\war did not exist.
After manually created the folder, the new Jenkins works.

相关问题