简体   繁体   中英

hudson.util.HudsonFailedToLoad error in Jenkins

I am getting below error when i am trying to access my Jenkins server,

hudson.util.HudsonFailedToLoad: org.jvnet.hudson.reactor.ReactorException: java.lang.Error: java.lang.reflect.InvocationTargetException
at hudson.WebAppMain$3.run(WebAppMain.java:234)
Caused by: org.jvnet.hudson.reactor.ReactorException: java.lang.Error: java.lang.reflect.InvocationTargetException
    at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:269)
    at jenkins.InitReactorRunner.run(InitReactorRunner.java:44)
    at jenkins.model.Jenkins.executeReactor(Jenkins.java:910)
    at jenkins.model.Jenkins.<init>(Jenkins.java:809)
    at hudson.model.Hudson.<init>(Hudson.java:82)
    at hudson.model.Hudson.<init>(Hudson.java:78)
    at hudson.WebAppMain$3.run(WebAppMain.java:222)
Caused by: java.lang.Error: java.lang.reflect.InvocationTargetException
    at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:109)
    at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:169)
    at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
    at jenkins.model.Jenkins$7.runTask(Jenkins.java:899)
    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:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:105)
    ... 8 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
    at com.thoughtworks.xstream.core.util.OrderRetainingMap.entrySet(OrderRetainingMap.java:77)
    at java.util.HashMap.putMapEntries(HashMap.java:511)
    at java.util.HashMap.putAll(HashMap.java:784)
    at com.thoughtworks.xstream.core.util.OrderRetainingMap.<init>(OrderRetainingMap.java:36)
    at com.thoughtworks.xstream.converters.reflection.FieldDictionary.buildMap(FieldDictionary.java:135)
    at com.thoughtworks.xstream.converters.reflection.FieldDictionary.fieldsFor(FieldDictionary.java:76)
    at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:127)
    at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:149)
    at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:108)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
    at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:82)
    at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.marshal(AbstractTreeMarshallingStrategy.java:37)
    at com.thoughtworks.xstream.XStream.marshal(XStream.java:898)
    at com.thoughtworks.xstream.XStream.marshal(XStream.java:887)
    at com.thoughtworks.xstream.XStream.toXML(XStream.java:860)
    at hudson.XmlFile.write(XmlFile.java:178)
    at hudson.model.Descriptor.save(Descriptor.java:758)
    at hudson.plugins.git.GitTool.onLoaded(GitTool.java:108)
    ... 13 more

At the end of error file,i thought may be error related to Git tool. So i have also removed git-client plugin from /var/lib/jenkins/plugins. But after that it will show error unable to read config.xml file even though file is already there in /var/lib/jenkins/config.xml

I need git-client plugin also. I don't know how to solve this problem. Please help if anyone know about this issue. Thanks

I met this java.lang.ArrayIndexOutOfBoundsException: -1 error before. It was because I started jenkins server with lower java version(maybe 1.6 or older?). And at the end I resolved this issue by starting jenkins with a newer version of java.

I stopped jenkins service and deleted that file and folder from

Jenkins_HOME/plugin
cloudbees-folder.jpi
cloudbees-folder [directory]

and then restart jenkins service.

Removing plugins from jenkins directory and restarting jenkins worked for me.

For my linux system, I did following:

  1. goto jenkins home "/var/lib/jenkins/"

  2. ls plugins //plugins directory inside jenkins home exists

  3. Make sure to copy plugins directory to some other path for backup

  4. cd plugins

  5. sudo rm -rf ./* Remove entire contents inside plugins directory.

  6. Restart jenkins with command: sudo service jenkins restart

  7. Restart jenkins link in browser and it opened normally.

Resolved: https://issues.jenkins-ci.org/browse/JENKINS-41241

The issue get resolves when you delete all the plugins from Jenkins Installation folder. Follow these steps (Windows installation)

  1. Go to Jenkins installation folder in "C:\Program files\Jenkins\Plugins" copy all the files in some other drive for future reference.
  2. Stop Jenkins server : Go to Control Panel\All Control Panel Items\Administrative Tools\Services search for Jenkins and stop it
  3. Delete all the files in the "C:\Program files\Jenkins\Plugins" folder
  4. Restart the Jenkins your good to go but all the plugins will have to be reinstalled
  5. Refer the "Plugins " folder which you have copied in some other destination and install the plugins

Basically, this type of error comes when Jenkins find some chaos inside its plugin or config folders arose due to any of our effort to upgrade/downgrade/update.

The simple solution is , we need to login to Jenkins and go to the location where we were trying to do the modification, and try to revert it back by deleting or modifying to its previous state.

eg I got this similar issue while trying to upgrade/downgarde the credentials plugin. So I went to /home/Jenkins/plugins and deleted all the files related to credentials and restarted the Jenkins from tomcat.

/home/Jenkins/plugins
rm -rf credentials.jpi.pinned
rm -rf credentials.jpi.disabled
rm -rf credentials.jpi
rm -rf credentials.bak

In my case I installed a new JDK 1.8, without uninstalling existing 1.7. Try uninstalling newer jdk (1.8 in my case) solved my problem.

I found that the plugins Matrix-auth.jpi and PrioritySorter.jpi are causing problems. When they are deleted it worked.

使用 systemctl stop jenkins 停止 jenkins 并使用 kill -9 终止进程并尝试使用 systemctl start jenkins 重新启动 jenkins 或运行 jenkins jar 文件。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM