hudson.util.HudsonFailedToLoad error in Jenkins

18,288

Solution 1

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.

Solution 2

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.

Solution 3

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.

Solution 4

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
Share:
18,288
rick
Author by

rick

Updated on June 11, 2022

Comments

  • rick
    rick almost 2 years

    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

  • rick
    rick over 8 years
    Thank you for the response. How did you upgrade java version in Jenkins?
  • kian
    kian over 5 years
    Although Jenkins successfully boots after this, it nuked references to the existing jobs/workspaces, requiring us to rebuild the (unfortunately manually created) jobs from scratch - is this an end-all be(e)-all solution?
  • Admin
    Admin over 2 years
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.