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

java.lang.ClassCastException: class com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategy cannot be cast to class hudson.security.GlobalMatrixAuthorizationStrategy

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • openshift-login-plugin
    • Jenkins version 2.319.2 for Redhat OpenShift 3

      Version
      OpenShift Master: v3.11.157
      Kubernetes Master: v1.11.0+d4cacc0
      OpenShift Web Console: v3.11.157


      Hi,

      The current version of Jenkins is v.2.319.2 for Redhat Openshift 3.

      In order to utilize the features of the Role-based Authorization Plugin, we upgraded the existing version of Matrix-Authorization Strategy plugin from v.2.6.6 to v.2.6.7, and then fresh installed the Role-based Authorization Plugin v.3.2.0.

      The installation was success without any error, and Jenkins could restart successfully after the plugin installation. However, as we successfully signed in Jenkins with any registered users, Jenkins reported an error 'Oops! A problem occurred while processing the request. Logging ID=xxxxxxxxxxxxxxx' on the landing page and logged the following Unhandled Exception event in the log.

      2022-05-11 02:10:40 WARNING hudson.init.impl.InstallUncaughtExceptionHandler handleException Caught unhandled exception with ID f8704ed7-53f3-4739-b4df-010da5eec14b
      java.lang.ClassCastException: class com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategy cannot be cast to class hudson.security.GlobalMatrixAuthorizationStrategy (com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategy is in unnamed module of loader jenkins.util.AntClassLoader @b1aa77c; hudson.security.GlobalMatrixAuthorizationStrategy is in unnamed module of loader jenkins.util.AntClassLoader @2bf821c) 

       

      We could still able to access the 'Dashborad' even such exception event occurred, and run the pipeline scripts properly.

      Version of Installed Matrix Authorization Strategy & Role-based Authorization Strategy Plugins*

       

      OpenShift Jenkins Environment*

       

          [JENKINS-68490] java.lang.ClassCastException: class com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategy cannot be cast to class hudson.security.GlobalMatrixAuthorizationStrategy

          Daniel Beck added a comment -

          Please provide the content of the config.xml file in your Jenkins home directory (redact what's needed first).

          Daniel Beck added a comment - Please provide the content of the config.xml file in your Jenkins home directory (redact what's needed first).

          The stack trace of the exception would be interesting. AFAICT, RoleBasedAuthorizationStrategy has never extended GlobalMatrixAuthorizationStrategy so, what's trying cast it to that and why?

          Kalle Niemitalo added a comment - The stack trace of the exception would be interesting. AFAICT, RoleBasedAuthorizationStrategy has never extended GlobalMatrixAuthorizationStrategy so, what's trying cast it to that and why?

          Markus Winter added a comment -

          Seems to be a duplicate of JENKINS-68355

          Markus Winter added a comment - Seems to be a duplicate of  JENKINS-68355

          Markus Winter added a comment -

          See https://github.com/jenkinsci/openshift-login-plugin:

          This plugin requires use of the global matrix authorization strategy in Jenkins.

          Markus Winter added a comment - See https://github.com/jenkinsci/openshift-login-plugin: This plugin requires use of the global matrix authorization strategy in Jenkins.

          Daniel Beck added a comment - Yeah, https://github.com/jenkinsci/openshift-login-plugin/blob/05e3a4e1d73756e01d6c39cf93f073c5046f61d4/src/main/java/org/openshift/jenkins/plugins/openshiftlogin/OpenShiftOAuth2SecurityRealm.java#L962-L963 would do it.

          Kingston Chan added a comment -

          Thank you so much for your information.

          Kingston Chan added a comment - Thank you so much for your information.

            Unassigned Unassigned
            chankingston Kingston Chan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: