I am trying to copy/migrate jenkins application from one old linux server(RHEL 6) to another linux server (rhel 8) server.I have copied the old jenkins home directory and ran below java command
and i tried to login with new hostname:8080 .i am getting below error. Could you please help me on how to resolve this.
java.lang.NoClassDefFoundError: org/jruby/javasupport/proxy/InternalJavaProxy
at org.jenkinsci.jruby.JRubyMapper.serializedClass(JRubyMapper.java:20)
at hudson.util.xstream.MapperDelegate.serializedClass(MapperDelegate.java:41)
at com.thoughtworks.xstream.mapper.MapperWrapper.serializedClass(MapperWrapper.java:121)
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:1266)
at com.thoughtworks.xstream.XStream.marshal(XStream.java:1255)
at com.thoughtworks.xstream.XStream.toXML(XStream.java:1228)
at hudson.XmlFile.write(XmlFile.java:213)
at jenkins.model.Jenkins.save(Jenkins.java:3547)
at jenkins.model.Jenkins.(Jenkins.java:1007)
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:261)
Are you using the same Jenkins version on old and new server?
If you use a newer Jenkins you probably have a plugin installed that is written in jruby.
jruby is no longer supported in Jenkins since Jenkins version 2.332.1
You will need to uninstall the plugin.
The specific message indicates that you have one or more plugins installed that are written in Ruby rather than being written in Java. The Jenkins project dropped support for plugins written in non-Java languages in January 2022. You’ll need to remove those plugins. The list of affected plugins and more details are in the blog post:
When upgrading from one Jenkins version to another, you should read and follow the instructions in the changelogs and the upgrade guides for the Jenkins versions between the original version and your destination version. The end of support for non-Java plugins is included in the Jenkins 2.332.1 upgrade guide.
Several of the command line options that you listed have been removed from the most recent Jenkins LTS release. You can read about that removal in the Jenkins 2.375.1 upgrade guide.
Read the upgrade guides for each of the versions that you covered with your upgrade. Do what the upgrade guides says to do. Investigate the failing jobs to understand why they are failing. Fix the failures.