Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-51998

Pipeline serialization fails on Java 11: java.lang.NoClassDefFoundError: Could not initialize class org.jboss.marshalling.river.RiverMarshaller

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      After patching of JENKINS-51837, I get into the following issue:

      java.lang.NoClassDefFoundError: Could not initialize class org.jboss.marshalling.river.RiverMarshaller
      	at org.jboss.marshalling.river.RiverMarshallerFactory.createMarshaller(RiverMarshallerFactory.java:54)
      	at org.jenkinsci.plugins.workflow.support.pickles.serialization.RiverWriter.<init>(RiverWriter.java:136)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:480)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:458)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgramIfPossible(CpsThreadGroup.java:445)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:372)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$200(CpsThreadGroup.java:83)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:244)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:232)
      	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      	at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:131)
      	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
      	at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
      	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
      	at java.base/java.lang.Thread.run(Thread.java:844)
      Finished: FAILURE
      

      Simple Pipelines work (if they are fast enough to complete before context save)

        Attachments

          Issue Links

            Activity

            oleg_nenashev Oleg Nenashev created issue -
            oleg_nenashev Oleg Nenashev made changes -
            Field Original Value New Value
            Epic Link JENKINS-40689 [ 177392 ]
            oleg_nenashev Oleg Nenashev made changes -
            Labels java10_hackathon
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Likely we need to patch or rebuild https://github.com/jboss-remoting/jboss-marshalling

            Show
            oleg_nenashev Oleg Nenashev added a comment - Likely we need to patch or rebuild https://github.com/jboss-remoting/jboss-marshalling
            svanoort Sam Van Oort made changes -
            Component/s workflow-cps-plugin [ 21713 ]
            Component/s workflow-support-plugin [ 21719 ]
            svanoort Sam Van Oort made changes -
            Remote Link This issue links to "Fixed as part of workflow-support #66 (Web Link)" [ 20905 ]
            svanoort Sam Van Oort made changes -
            Assignee Oleg Nenashev [ oleg_nenashev ]
            svanoort Sam Van Oort made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            miraha jang hyemi (Inactive) made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            Assignee Oleg Nenashev [ oleg_nenashev ]
            miraha jang hyemi (Inactive) made changes -
            Status Closed [ 6 ] In Review [ 10005 ]
            miraha jang hyemi (Inactive) made changes -
            Status In Review [ 10005 ] Closed [ 6 ]
            oleg_nenashev Oleg Nenashev made changes -
            Link This issue is duplicated by JENKINS-52001 [ JENKINS-52001 ]
            Hide
            sgabriel Samuel Gabriel added a comment -

            This issue is not resolved. We are experiencing this issue again with our Jenkins installation. It happens with a very simple pipeline that calls npm build

            We are using Jenkins 2.152

            Pipeline Support 2.22

            Here is the stacktrace:

            // code placeholder
            Nov 19, 2018 7:31:45 PM org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService reportProblemNov 19, 2018 7:31:45 PM org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService reportProblemWARNING: Unexpected exception in CPS VM thread: CpsFlowExecution[Owner[live-chat-feature/9:live-chat-feature #9]]java.lang.NoClassDefFoundError: Could not initialize class org.jboss.marshalling.river.RiverMarshaller at org.jboss.marshalling.river.RiverMarshallerFactory.createMarshaller(RiverMarshallerFactory.java:54) at org.jenkinsci.plugins.workflow.support.pickles.serialization.RiverWriter.<init>(RiverWriter.java:136) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:480) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:458) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgramIfPossible(CpsThreadGroup.java:445) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:372) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$200(CpsThreadGroup.java:83) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:244) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:232) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:131) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:844)
            

            Not sure if it is related by numerous errors appear before that regarding the atomic file locked by another process. 

            Nov 19, 2018 7:31:45 PM org.jenkinsci.plugins.workflow.cps.CpsThreadGroup saveProgramIfPossibleNov 19, 2018 7:31:45 PM org.jenkinsci.plugins.workflow.cps.CpsThreadGroup saveProgramIfPossibleWARNING: program state save failedjava.io.IOException: Unable to delete 'C:\Jenkins\jobs\live-chat-feature\builds\9\atomic2269173168243097261.tmp'. Tried 3 times (of a maximum of 3) waiting 0.1 sec between attempts. at hudson.Util.deleteFile(Util.java:277) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:499) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:458) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgramIfPossible(CpsThreadGroup.java:445) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:372) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$200(CpsThreadGroup.java:83) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:244) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:232) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:131) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:844)Caused by: java.nio.file.FileSystemException: C:\Jenkins\jobs\live-chat-feature\builds\9\atomic2269173168243097261.tmp: The process cannot access the file because it is being used by another process.
             at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:92) at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108) at java.base/sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:270) at java.base/sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:110) at java.base/java.nio.file.Files.deleteIfExists(Files.java:1173) at hudson.Util.tryOnceDeleteFile(Util.java:316) at hudson.Util.deleteFile(Util.java:272) ... 17 more
            

             

            Show
            sgabriel Samuel Gabriel added a comment - This issue is not resolved. We are experiencing this issue again with our Jenkins installation. It happens with a very simple pipeline that calls npm build We are using Jenkins 2.152 Pipeline Support 2.22 Here is the stacktrace: // code placeholder Nov 19, 2018 7:31:45 PM org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService reportProblemNov 19, 2018 7:31:45 PM org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService reportProblemWARNING: Unexpected exception in CPS VM thread: CpsFlowExecution[Owner[live-chat-feature/9:live-chat-feature #9]]java.lang.NoClassDefFoundError: Could not initialize class org.jboss.marshalling.river.RiverMarshaller at org.jboss.marshalling.river.RiverMarshallerFactory.createMarshaller(RiverMarshallerFactory.java:54) at org.jenkinsci.plugins.workflow.support.pickles.serialization.RiverWriter.<init>(RiverWriter.java:136) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:480) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:458) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgramIfPossible(CpsThreadGroup.java:445) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:372) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$200(CpsThreadGroup.java:83) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:244) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:232) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:131) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang. Thread .run( Thread .java:844) Not sure if it is related by numerous errors appear before that regarding the atomic file locked by another process.  Nov 19, 2018 7:31:45 PM org.jenkinsci.plugins.workflow.cps.CpsThreadGroup saveProgramIfPossibleNov 19, 2018 7:31:45 PM org.jenkinsci.plugins.workflow.cps.CpsThreadGroup saveProgramIfPossibleWARNING: program state save failedjava.io.IOException: Unable to delete 'C:\Jenkins\jobs\live-chat-feature\builds\9\atomic2269173168243097261.tmp' . Tried 3 times (of a maximum of 3) waiting 0.1 sec between attempts. at hudson.Util.deleteFile(Util.java:277) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:499) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:458) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgramIfPossible(CpsThreadGroup.java:445) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:372) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$200(CpsThreadGroup.java:83) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:244) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:232) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:131) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang. Thread .run( Thread .java:844)Caused by: java.nio.file.FileSystemException: C:\Jenkins\jobs\live-chat-feature\builds\9\atomic2269173168243097261.tmp: The process cannot access the file because it is being used by another process. at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:92) at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108) at java.base/sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:270) at java.base/sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:110) at java.base/java.nio.file.Files.deleteIfExists(Files.java:1173) at hudson.Util.tryOnceDeleteFile(Util.java:316) at hudson.Util.deleteFile(Util.java:272) ... 17 more  
            sgabriel Samuel Gabriel made changes -
            Resolution Fixed [ 1 ]
            Status Closed [ 6 ] Reopened [ 4 ]
            Assignee Oleg Nenashev [ oleg_nenashev ]
            oleg_nenashev Oleg Nenashev made changes -
            Summary Pipeline serialization fails on Java 10: java.lang.NoClassDefFoundError: Could not initialize class org.jboss.marshalling.river.RiverMarshaller Pipeline serialization fails on Java 11: java.lang.NoClassDefFoundError: Could not initialize class org.jboss.marshalling.river.RiverMarshaller
            oleg_nenashev Oleg Nenashev made changes -
            Epic Link JENKINS-40689 [ 177392 ] JENKINS-52012 [ 191514 ]
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Samuel Gabriel yes, it was closed due to the temporary workaround we applied for the hackfest. Currently I am working on making this workaround available in update centers somehow.

            There is a separate story for a production-grade solution which is needed for the Java 11 GA availability (JENKINS-52187)

            Show
            oleg_nenashev Oleg Nenashev added a comment - Samuel Gabriel yes, it was closed due to the temporary workaround we applied for the hackfest. Currently I am working on making this workaround available in update centers somehow. There is a separate story for a production-grade solution which is needed for the Java 11 GA availability ( JENKINS-52187 )
            oleg_nenashev Oleg Nenashev made changes -
            Link This issue relates to JENKINS-52187 [ JENKINS-52187 ]
            oleg_nenashev Oleg Nenashev made changes -
            Issue Type Improvement [ 4 ] Bug [ 1 ]
            Hide
            batmat Baptiste Mathus added a comment -

            Samuel Gabriel also, just in case: if you are running Jenkins on Java 11, please note that this is currently not supported at all. We are only as I'm writing reaching the "Preview" status, described in https://jenkins.io/doc/administration/requirements/java/ but the GA is planned for some time in early 2019.

            In case someone stumbles into this issue here and would like to run Jenkins on Java 11.

            Show
            batmat Baptiste Mathus added a comment - Samuel Gabriel also, just in case: if you are running Jenkins on Java 11, please note that this is currently not supported at all. We are only as I'm writing reaching the "Preview" status, described in https://jenkins.io/doc/administration/requirements/java/ but the GA is planned for some time in early 2019. In case someone stumbles into this issue here and would like to run Jenkins on Java 11.
            Hide
            sgabriel Samuel Gabriel added a comment -

            Oleg Nenashev  we are actually using JDK 10.  Which this issue was reportedly supposed to fix.

            Show
            sgabriel Samuel Gabriel added a comment - Oleg Nenashev   we are actually using JDK 10.  Which this issue was reportedly supposed to fix.
            Hide
            batmat Baptiste Mathus added a comment - - edited

            Samuel Gabriel please refer to https://jenkins.io/doc/administration/requirements/java/.

            Jenkins does not, and will not, support JDK 10.

            So in your case, given we are about to announce the JDK 11 Preview (https://www.meetup.com/fr-FR/Jenkins-online-meetup/events/257008190/), you might want to upgrade to JDK 11 given anyway you're already using a setup using unreleased/preview components. We will for sure warmly welcome feedback about the Preview.
            If your setup is a production one, it might be better to go back to JDK 8 until we reach GA for JDK 11, but that is ultimately your choice, now you know the support status.

            Thanks for your understanding.

            Show
            batmat Baptiste Mathus added a comment - - edited Samuel Gabriel please refer to https://jenkins.io/doc/administration/requirements/java/ . Jenkins does not, and will not, support JDK 10. So in your case, given we are about to announce the JDK 11 Preview ( https://www.meetup.com/fr-FR/Jenkins-online-meetup/events/257008190/ ), you might want to upgrade to JDK 11 given anyway you're already using a setup using unreleased/preview components. We will for sure warmly welcome feedback about the Preview. If your setup is a production one, it might be better to go back to JDK 8 until we reach GA for JDK 11, but that is ultimately your choice, now you know the support status. Thanks for your understanding.
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Samuel Gabriel Baptiste Mathus I have added an explicit section about Java 10 and Java 12 support to the JEP-211: https://github.com/jenkinsci/jep/pull/228

            Show
            oleg_nenashev Oleg Nenashev added a comment - Samuel Gabriel Baptiste Mathus I have added an explicit section about Java 10 and Java 12 support to the JEP-211: https://github.com/jenkinsci/jep/pull/228
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Samuel Gabriel In order to get a temporary fix...

            1. Switch your update center to the Java 11 experimental update center https://updates.jenkins.io/temporary-experimental-java11
            2. Install the Pipeline: Support plugin v. 3.0-java11-alpha-1

            Note that the release is not fully compatible with the 2.x version. You should ensure that there is no running Pipelines at the time of the upgrade. A final solution is currently in progress by Sam Van Oort

            Show
            oleg_nenashev Oleg Nenashev added a comment - Samuel Gabriel In order to get a temporary fix... Switch your update center to the Java 11 experimental update center https://updates.jenkins.io/temporary-experimental-java11 Install the Pipeline: Support plugin v. 3.0-java11-alpha-1 Note that the release is not fully compatible with the 2.x version. You should ensure that there is no running Pipelines at the time of the upgrade. A final solution is currently in progress by Sam Van Oort
            Hide
            sgabriel Samuel Gabriel added a comment -

            Oleg Nenashev Thank you Oleg will check it out.

            Show
            sgabriel Samuel Gabriel added a comment - Oleg Nenashev Thank you Oleg will check it out.
            oleg_nenashev Oleg Nenashev made changes -
            Epic Link JENKINS-52012 [ 191514 ] JENKINS-51805 [ 191255 ]
            oleg_nenashev Oleg Nenashev made changes -
            Link This issue relates to JENKINS-55177 [ JENKINS-55177 ]
            batmat Baptiste Mathus made changes -
            Labels java10_hackathon java10_hackathon java11
            vivek Vivek Pandey made changes -
            Labels java10_hackathon java11 java10_hackathon java11 pipeline-triaged
            batmat Baptiste Mathus made changes -
            Labels java10_hackathon java11 pipeline-triaged java10_hackathon java11 pipeline-triaged triaged
            oleg_nenashev Oleg Nenashev made changes -
            Assignee Oleg Nenashev [ oleg_nenashev ]
            Hide
            batmat Baptiste Mathus added a comment -

            Considering this fixed given it didn't resurface since early December 2018.

            Show
            batmat Baptiste Mathus added a comment - Considering this fixed given it didn't resurface since early December 2018.
            batmat Baptiste Mathus made changes -
            Status Reopened [ 4 ] Closed [ 6 ]
            Resolution Fixed [ 1 ]

              People

              • Assignee:
                Unassigned
                Reporter:
                oleg_nenashev Oleg Nenashev
              • Votes:
                2 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: