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

attempted duplicate class definition for name: "com/cloudbees/plugins/credentials/CredentialsMatcher$CQL"

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major

      Jenkins can't connect to Bitbucket repositories. Logging indicates a duplicate class definition error (see stack trace below). Office 365 plugin is installed and configured. Trying to reproduce the error in local development setup. Ran the docker setup locally and connection to Bitbucket works. Office plugin installed but not configured at the moment locally but ongoing to see if the error appears.

      Stacktrace jenkins logging:

      Apr 29, 2021 7:29:31 AM WARNING hudson.init.impl.InstallUncaughtExceptionHandler handleException
      Caught unhandled exception with ID f02655e9-d341-4058-bc2a-234d6a09964f
      java.lang.LinkageError: loader (instance of hudson/ClassicPluginStrategy$AntClassLoader2): attempted duplicate class definition for name: "com/cloudbees/plugins/credentials/CredentialsMatcher$CQL"
      at com.cloudbees.jenkins.plugins.bitbucket.api.credentials.BitbucketOAuthAuthenticatorSource.matcher(BitbucketOAuthAuthenticatorSource.java:56)
      at jenkins.authentication.tokens.api.AuthenticationTokens.matcher(AuthenticationTokens.java:87)
      at com.cloudbees.jenkins.plugins.bitbucket.BitbucketCredentials.fillCredentialsIdItems(BitbucketCredentials.java:90)
      at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource$DescriptorImpl.doFillCredentialsIdItems(BitbucketSCMSource.java:1163)
      at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
      at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:396)
      at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:408)
      at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:212)
      at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:145)
      at org.kohsuke.stapler.MetaClass$11.doDispatch(MetaClass.java:536)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:766)
      Caused: javax.servlet.ServletException

          [JENKINS-65510] attempted duplicate class definition for name: "com/cloudbees/plugins/credentials/CredentialsMatcher$CQL"

          koen added a comment -

          Update of Jenkins version to 2.277.3 and bitbucket-branch-source plugin to 2.9.8 did the trick.

          koen added a comment - Update of Jenkins version to 2.277.3 and bitbucket-branch-source plugin to 2.9.8 did the trick.

          Similar "duplicate class definition" errors for "edu/hm/hafner/echarts/JacksonFacade" have been seen in JENKINS-65261, where JacksonFacade was actually defined in two jar files of the same plugin, but the error kept occurring even after the jar files were fixed. Currently, I suspect it is a race condition in the Jenkins core and depends on what the first requests are after Jenkins is restarted.

          Kalle Niemitalo added a comment - Similar "duplicate class definition" errors for "edu/hm/hafner/echarts/JacksonFacade" have been seen in JENKINS-65261 , where JacksonFacade was actually defined in two jar files of the same plugin, but the error kept occurring even after the jar files were fixed. Currently, I suspect it is a race condition in the Jenkins core and depends on what the first requests are after Jenkins is restarted.

          JENKINS-65766 caused "duplicate class definition" errors in Jenkins 2.276 and higher, until it was fixed in Jenkins 2.297 and 2.289.2. This JENKINS-65510 was reported on Jenkins 2.277.2, which is among the affected versions. Because the stack trace also matches, I am marking this as a duplicate. Please reopen if the error still occurs with a fixed version.

          Kalle Niemitalo added a comment - JENKINS-65766 caused "duplicate class definition" errors in Jenkins 2.276 and higher, until it was fixed in Jenkins 2.297 and 2.289.2. This JENKINS-65510 was reported on Jenkins 2.277.2, which is among the affected versions. Because the stack trace also matches, I am marking this as a duplicate. Please reopen if the error still occurs with a fixed version.

            srhebbar Srivardhan Hebbar
            koenv koen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: