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

Sharable Libraries class loader "Grabs" to different class loader

XMLWordPrintable

      I have a shared library class I am trying to execute in a jenkins pipeline.  In the shared libraries doc it says you can "Grab" an artifact from a maven repo and load it into your classpath.  In this case I'm pulling amazon's java sdk so that I can make some calls to describe our AMIs.  The groovy class in the shared library works fine if I run it on my local dev box via command line.  When I upload it to the shared library and try to execute it through a jenkins pipeline, I get the error below.

      hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: com.amazonaws.services.ec2.AmazonEC2Client.describeImages() is applicable for argument types: (com.amazonaws.services.ec2.model.DescribeImagesRequest) values: [{ImageIds: [],Owners: [],ExecutableUsers: [],Filters: [{Name: tag:Name,Values: [Convert Rets Base Image]}]}]
      Possible solutions: describeImages(), describeImages(com.amazonaws.services.ec2.model.DescribeImagesRequest), describeTags(), describeTags(com.amazonaws.services.ec2.model.DescribeTagsRequest)
      The following classes appear as argument class and as parameter class, but are defined by different class loader:
      com.amazonaws.services.ec2.model.DescribeImagesRequest (defined by 'AntClassLoader
      ...
      If one of the method suggestions matches the method you wanted to call,
      then check your class loader setup.
      ...

      I've included the pipeline I'm using, the console output of the build, and the groovy script I'm calling in the shared library.  I haven't been able to find anything online and it looks like I'm doing everything the documentation says I should be doing.  I'm hoping I just misconfigured something but I'm thinking there may be a bug somewhere.

        1. Pipeline
          0.3 kB
        2. DescribeImages.groovy
          2 kB
        3. BuildConsoleOutput
          24 kB

            Unassigned Unassigned
            cjmead Corey Mead
            Votes:
            4 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: