Jenkins: error ( jenkins.util.xstream.CriticalXStreamException: )

Dear Jenkins community,

I am getting this error when I am trying to upgrade jenkins from 2.332. to 2.401 LTS using RPM on RHL 7
JDK: 11

com.thoughtworks.xstream.mapper.CannotResolveClassException: hudson.plugins.active_directory.ActiveDirectorySecurityRealm
	at com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:81)
	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
	at com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass(DynamicProxyMapper.java:55)
	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
	at com.thoughtworks.xstream.mapper.PackageAliasingMapper.realClass(PackageAliasingMapper.java:88)
	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
	at com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAliasingMapper.java:79)
	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
	at com.thoughtworks.xstream.mapper.ArrayMapper.realClass(ArrayMapper.java:74)
	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
	at com.thoughtworks.xstream.mapper.SecurityMapper.realClass(SecurityMapper.java:71)
	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
	at hudson.util.XStream2$CompatibilityMapper.realClass(XStream2.java:453)
	at hudson.util.xstream.MapperDelegate.realClass(MapperDelegate.java:46)
	at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
	at com.thoughtworks.xstream.mapper.CachingMapper.realClass(CachingMapper.java:47)
	at hudson.util.RobustReflectionConverter.determineType(RobustReflectionConverter.java:521)
	at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:346)
Caused: jenkins.util.xstream.CriticalXStreamException: 
---- Debugging information ----
cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message       : hudson.plugins.active_directory.ActiveDirectorySecurityRealm
class               : hudson.model.Hudson
required-type       : hudson.model.Hudson
converter-type      : hudson.util.RobustReflectionConverter
path                : /hudson/securityRealm
line number         : 128
version             : not available
-------------------------------
	at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:381)
	at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:289)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:74)
	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:72)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:68)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:52)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:136)
	at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1464)
	at hudson.util.XStream2.unmarshal(XStream2.java:231)
	at hudson.util.XStream2.unmarshal(XStream2.java:202)
	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1441)
	at hudson.XmlFile.unmarshal(XmlFile.java:196)
Caused: java.io.IOException: Unable to read /var/lib/jenkins/config.xml
	at hudson.XmlFile.unmarshal(XmlFile.java:199)
	at hudson.XmlFile.unmarshal(XmlFile.java:179)
	at jenkins.model.Jenkins.loadConfig(Jenkins.java:3320)
	at jenkins.model.Jenkins$12.run(Jenkins.java:3423)
	at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:177)
	at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:305)
	at jenkins.model.Jenkins$5.runTask(Jenkins.java:1164)
	at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:221)
	at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:120)
	at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused: org.jvnet.hudson.reactor.ReactorException
	at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:290)
	at jenkins.InitReactorRunner.run(InitReactorRunner.java:49)
	at jenkins.model.Jenkins.executeReactor(Jenkins.java:1199)
	at jenkins.model.Jenkins.(Jenkins.java:987)
	at hudson.model.Hudson.(Hudson.java:86)
	at hudson.model.Hudson.(Hudson.java:82)
	at hudson.WebAppMain$3.run(WebAppMain.java:247)
Caused: hudson.util.HudsonFailedToLoad
	at hudson.WebAppMain$3.run(WebAppMain.java:264)

Did you upgrade the plugins as well?

Before we upgrading to 2.401 we have been upgrade plugins while upgrading from 2.221 to 2.332 version.

On of my colleague trying to upgrade jenkins from 2.221 to 2.332 by replacing .war file only. But it was not works.
So I have trying to upgrade jenkins using #yum upgrade jenkins

FOr version 2.401 it was not working. So I have downgrade version 2.401 to 2.331.2 using RPM.

Note: RPM downloaded manually.

Thanks&Regards…

Red Hat Enterprise Linux 7 will be unsupported by the Jenkins project Nov 16, 2023 as announced in the May 30, 2023 blog post and discussed in the community discussion topic. This is a very good time to transition to a new server that is running a newer operating system like Red Hat Enterprise Linux 9

  • Create a backup of the Jenkins home directory on your old RHEL 7 server.
  • Install Red Hat Enterprise Linux 9 on a new server
  • Install Java 17 and Jenkins 2.414.1 on the new server
  • Install the plugins on the new server based on the plugins installed on the old RHEL 7 server
  • Create a backup of the installation on the new server so that you can restore in case of surprises
  • Restore the jobs and other configurations from the old server to the new server (don’t restore the plugins, you want the new plugins installed with 2.414.1)
  • Test the new server meets your needs, then switch from the old server to the new server
1 Like

Thank you so much @MarkEWaite