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

LinkageError loader attempted duplicate class definition for name causes Jenkins to doesn't start

XMLWordPrintable

      Using load step to load two different groovy files without an explicit class but the same package declaration, causes Jenkins to fail during startup process if the build should be resumed.

      For example, create a dummy pipeline like

      def util
      def config
      def util2
      
      node('master') {
          sh 'cp -r /tmp/test/src .'
      
          config = load 'src/org/foo/devops/JenkinsEnvironment.groovy'
          util = load 'src/org/foo/devops/Utility.groovy'
      
          config.loadProdConfiguration()    
      }
      util.isValueExist("")
      
      echo "kill me while I'm sleeping"
      sleep 20
      
      node('master') {
          util2 = load 'src/org/foo/devops/Utility.groovy'
          util = load 'src/org/foo/devops/Utility.groovy'
      }
      

      And copy the two attached files at /tmp/test/src/org/foo/devops/
      (Files can be retrieved as you prefer)

      Build the job and restart jenkins while is building.

      Then you won't be able to access Jenkins.

        1. JenkinsEnvironment.groovy
          0.1 kB
        2. startup-error.log
          8 kB
        3. startup-page.log
          3 kB
        4. Utility.groovy
          0.2 kB

            abayer Andrew Bayer
            escoem Emilio Escobar
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: