一千萬個為什麽

搜索

為什麽Jenkins無法讀取config.xml?



java.io.EOFException: no more data available - expected end tag  to close start tag  from line 2, parser stopped on END_TAG seen ...\n\n... @42:1
    at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:3035)
    at org.xmlpull.mxp1.MXParser.more(MXParser.java:3046)
    at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1384)
    at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)
    at com.thoughtworks.xstream.io.xml.XppReader.pullNextEvent(XppReader.java:109)
Caused: com.thoughtworks.xstream.io.StreamException:  : no more data available - expected end tag  to close start tag  from line 2, parser stopped on END_TAG seen ...\n\n... @42:1
    at com.thoughtworks.xstream.io.xml.XppReader.pullNextEvent(XppReader.java:126)
    at com.thoughtworks.xstream.io.xml.AbstractPullReader.readRealEvent(AbstractPullReader.java:148)
    at com.thoughtworks.xstream.io.xml.AbstractPullReader.readEvent(AbstractPullReader.java:135)
    at com.thoughtworks.xstream.io.xml.AbstractPullReader.hasMoreChildren(AbstractPullReader.java:87)
    at com.thoughtworks.xstream.io.ReaderWrapper.hasMoreChildren(ReaderWrapper.java:32)
    at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:309)
    at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:270)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
Caused: com.thoughtworks.xstream.converters.ConversionException:  : no more data available - expected end tag  to close start tag  from line 2, parser stopped on END_TAG seen ...\n\n... @42:1 :  : no more data available - expected end tag  to close start tag  from line 2, parser stopped on END_TAG seen ...\n\n... @42:1
---- Debugging information ----
message             :  : no more data available - expected end tag  to close start tag  from line 2, parser stopped on END_TAG seen ...\n\n... @42:1
cause-exception     : com.thoughtworks.xstream.io.StreamException
cause-message       :  : no more data available - expected end tag  to close start tag  from line 2, parser stopped on END_TAG seen ...\n\n... @42:1
class               : hudson.model.Hudson
required-type       : hudson.model.Hudson
converter-type      : hudson.util.RobustReflectionConverter
path                : /hudson
line number         : 42
version             : not available
-------------------------------
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:79)
    at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
    at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
    at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1189)
    at hudson.util.XStream2.unmarshal(XStream2.java:114)
    at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1173)
    at hudson.XmlFile.unmarshal(XmlFile.java:160)
Caused: java.io.IOException: Unable to read /var/lib/jenkins/config.xml
    at hudson.XmlFile.unmarshal(XmlFile.java:162)
    at jenkins.model.Jenkins.loadConfig(Jenkins.java:3078)
    at jenkins.model.Jenkins.access$1200(Jenkins.java:307)
    at jenkins.model.Jenkins$16.run(Jenkins.java:3096)
    at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
    at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
    at jenkins.model.Jenkins$7.runTask(Jenkins.java:1090)
    at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
    at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused: org.jvnet.hudson.reactor.ReactorException
    at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:269)
    at jenkins.InitReactorRunner.run(InitReactorRunner.java:47)
    at jenkins.model.Jenkins.executeReactor(Jenkins.java:1124)
    at jenkins.model.Jenkins.(Jenkins.java:929)
    at hudson.model.Hudson.(Hudson.java:86)
    at hudson.model.Hudson.(Hudson.java:82)
    at hudson.WebAppMain$3.run(WebAppMain.java:235)
Caused: hudson.util.HudsonFailedToLoad
    at hudson.WebAppMain$3.run(WebAppMain.java:252)

轉載註明原文: 為什麽Jenkins無法讀取config.xml?

一共有 2 個回答:

它看起來像你的XML標簽不平衡。你應該通過一個XML驗證器運行你的配置文件,看看它有什麽問題,如果你無法親眼目睹它的話。

這會有很多原因。如果您正在編寫/更新 JENKINS_HOME/config.xml ,那麽語法錯誤的可能性可能在 config.xml 中。所以你可以通過以下步驟恢復它:

第1步:停止jenkins服務

cmd> service jenkins stop

第2步:將 mv JENKINS_HOME/config.xml 復制到另一個文件進行備份

cmd> mv JENKINS_HOME/config.xml JENKINS_HOME/config.xml_bak

第3步:啟動jenkins服務

cmd> service jenkins start