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

ClassNotFoundException for AWS CloudWatch classes

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • monitoring-plugin
    • Jenkins version: 2.479.2
      Monitoring plugin version: 2.4.0
      aws-java-sdk plugin version: 1.12.772-474.v7f79a_2046a_fb_
      Java version: OpenJDK 17

      The monitoring plugin fails to access AWS CloudWatch classes with the following error:

      java.lang.NoClassDefFoundError: com/amazonaws/services/cloudwatch/AmazonCloudWatchClientBuilder
      

      This occurs when JavaMelody attempts to publish metrics to CloudWatch (when -Djavamelody.cloudwatch-namespace is configured).

      The issue appears to be related to:

      • Jenkins core change in 2.479.2 (JENKINS-74814) which modified class loading behavior with RETAIN_CLASS_REFERENCE
      • The CloudWatch classes are present in aws-java-sdk plugin (1.12.772) but the monitoring plugin can't access them despite having aws-cloudwatch-library dependency in pom.xml

      Steps to Reproduce:

      • Install monitoring plugin 2.4.0
      • Install aws-java-sdk plugin
      • Configure JavaMelody with -Djavamelody.cloudwatch-namespace=your-namespace
      • Access Jenkins monitoring page

      Current Behavior:

      ClassNotFoundException when accessing monitoring page
      CloudWatch metrics are not published

      Expected Behavior:

      Monitoring plugin should successfully access AWS CloudWatch classes
      Metrics should be published to CloudWatch

          [JENKINS-75117] ClassNotFoundException for AWS CloudWatch classes

          Yevhen created issue -
          Basil Crow made changes -
          Remote Link New: This issue links to "jenkinsci/monitoring-plugin#17 (Web Link)" [ 30503 ]
          Basil Crow made changes -
          Assignee Original: evernat [ evernat ] New: Basil Crow [ basil ]
          Basil Crow made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Basil Crow made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Fixed but Unreleased [ 10203 ]
          evernat made changes -
          Status Original: Fixed but Unreleased [ 10203 ] New: Resolved [ 5 ]

            basil Basil Crow
            yevhenzamburskyi Yevhen
            Votes:
            6 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: