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

Attemp to (de-)serialize anonymous class javaposse.jobdsl.plugin.LookupStrategy$2

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: job-dsl-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.116
      Job DSL Plugin 1.68
    • Similar Issues:

      Description

      After upgrade Jenkins to 2.116 I see in the logs the following error:

      Apr 11, 2018 9:06:15 PM WARNING org.jenkinsci.remoting.util.AnonymousClassWarnings warn
      Attempt to (de-)serialize anonymous class javaposse.jobdsl.plugin.LookupStrategy$2 in file:/var/lib/jenkins/plugins/job-dsl/WEB-INF/lib/classes.jar; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/

      It is not related to the plugin version - I tried to downgrade to 1.67 - problem still exists in this version. Before Jenkins upgrade (it was a direct upgrade from 2.114 to 2.116) I hadn't had such errors.

        Attachments

          Activity

          Hide
          daspilker Daniel Spilker added a comment -

          I can reproduce this issue. Even when running the job-dsl build step on master. This should only be caused by XStream (de-)serialization of ExecuteDslScripts.lookupStrategy.

          Oleg Nenashev: LookupStrategy$2 is an enum. It gets serialized as <lookupStrategy>SEED_JOB</lookupStrategy>, so it should be save to (de-)serialize. Can't we make an exception for enums?

           https://github.com/jenkinsci/job-dsl-plugin/blob/job-dsl-1.68/job-dsl-plugin/src/main/groovy/javaposse/jobdsl/plugin/LookupStrategy.java

          Show
          daspilker Daniel Spilker added a comment - I can reproduce this issue. Even when running the job-dsl build step on master. This should only be caused by XStream (de-)serialization of ExecuteDslScripts.lookupStrategy . Oleg Nenashev : LookupStrategy$2 is an enum. It gets serialized as <lookupStrategy>SEED_JOB</lookupStrategy> , so it should be save to (de-)serialize. Can't we make an exception for enums?   https://github.com/jenkinsci/job-dsl-plugin/blob/job-dsl-1.68/job-dsl-plugin/src/main/groovy/javaposse/jobdsl/plugin/LookupStrategy.java
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          Enums are whitelisted in JEP-200. It is not a JEP-200, but a warning introduced by Jesse Glick for JENKINS-49795. This enum is really a nested class though it could be refactored (e.g. you could create static handlers and store them in a field)

          Show
          oleg_nenashev Oleg Nenashev added a comment - Enums are whitelisted in JEP-200. It is not a JEP-200, but a warning introduced by Jesse Glick for JENKINS-49795 . This enum is really a nested class though it could be refactored (e.g. you could create static handlers and store them in a field)
          Show
          daspilker Daniel Spilker added a comment - PR: https://github.com/jenkinsci/job-dsl-plugin/pull/1122
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Daniel Spilker
          Path:
          docs/Home.md
          job-dsl-plugin/src/main/groovy/javaposse/jobdsl/plugin/LookupStrategy.java
          http://jenkins-ci.org/commit/job-dsl-plugin/50f78603067d4bd0ed77646d801b5ccd771def3d
          Log:
          fixed anonymous class warning

          [FIXES JENKINS-50750]

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Spilker Path: docs/Home.md job-dsl-plugin/src/main/groovy/javaposse/jobdsl/plugin/LookupStrategy.java http://jenkins-ci.org/commit/job-dsl-plugin/50f78603067d4bd0ed77646d801b5ccd771def3d Log: fixed anonymous class warning [FIXES JENKINS-50750]
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Daniel Spilker
          Path:
          docs/Home.md
          job-dsl-plugin/src/main/groovy/javaposse/jobdsl/plugin/LookupStrategy.java
          http://jenkins-ci.org/commit/job-dsl-plugin/0466f20650d2a7dd9e201848406abe311d9120e6
          Log:
          Merge pull request #1122 from daspilker/JENKINS-50750

          JENKINS-50750 fixed anonymous class warning

          Compare: https://github.com/jenkinsci/job-dsl-plugin/compare/c094cd7e82b6...0466f20650d2

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Spilker Path: docs/Home.md job-dsl-plugin/src/main/groovy/javaposse/jobdsl/plugin/LookupStrategy.java http://jenkins-ci.org/commit/job-dsl-plugin/0466f20650d2a7dd9e201848406abe311d9120e6 Log: Merge pull request #1122 from daspilker/ JENKINS-50750 JENKINS-50750 fixed anonymous class warning Compare: https://github.com/jenkinsci/job-dsl-plugin/compare/c094cd7e82b6...0466f20650d2

            People

            • Assignee:
              daspilker Daniel Spilker
              Reporter:
              ewypych Emil Wypych
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: