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

Transform anonymous classes sent over remoting into non anonymous classes

    XMLWordPrintable

Details

    • Evergreen - Milestone 1

    Description

      Issue

      The Git plugin triggers the following warnings currently:

      Attempt to (de-)serialize anonymous class org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1 in file:/evergreen/jenkins/var/plugins/git-client/WEB-INF/lib/git-client.jar; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
      

      And

      Attempt to (de-)serialize anonymous class org.jenkinsci.plugins.gitclient.Git$1 in file:/evergreen/jenkins/var/plugins/git-client/WEB-INF/lib/git-client.jar; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
      

      Expected

      The anonymous class should be extracted to a full blown one so that this warning (and more importantly remoting works as fine as possible) goes away.

      Thanks!

      Attachments

        Issue Links

          Activity

            batmat Baptiste Mathus created issue -
            batmat Baptiste Mathus made changes -
            Field Original Value New Value
            Link This issue relates to JENKINS-53251 [ JENKINS-53251 ]
            batmat Baptiste Mathus made changes -
            Summary Transform o.j.p.g.RemoteGitImpl$CommandInvocationHandler$1 into a non anonymous class Transform anonymous classes sent over remoting into non anonymous classes
            batmat Baptiste Mathus made changes -
            Description h3. Issue

            The Git plugin triggers the following warnings currently:

            {noformat}
            Attempt to (de-)serialize anonymous class org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1 in file:/evergreen/jenkins/var/plugins/git-client/WEB-INF/lib/git-client.jar; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
            {noformat}

            h3. Expected

            The anonymous class should be extracted to a full blown one so that this warning (and more importantly remoting works as fine as possible) goes away.

            Thanks!
            h3. Issue

            The Git plugin triggers the following warnings currently:

            {noformat}
            Attempt to (de-)serialize anonymous class org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1 in file:/evergreen/jenkins/var/plugins/git-client/WEB-INF/lib/git-client.jar; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
            {noformat}

            And

            {noformat}
            Attempt to (de-)serialize anonymous class org.jenkinsci.plugins.gitclient.Git$1 in file:/evergreen/jenkins/var/plugins/git-client/WEB-INF/lib/git-client.jar; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
            {noformat}

            h3. Expected

            The anonymous class should be extracted to a full blown one so that this warning (and more importantly remoting works as fine as possible) goes away.

            Thanks!
            jglick Jesse Glick added a comment -

            Note: from the NetBeans IDE you can just Ctrl-Alt-Shift-A and if possible make sure the result is static.

            jglick Jesse Glick added a comment - Note: from the NetBeans IDE you can just Ctrl-Alt-Shift-A and if possible make sure the result is static .
            markewaite Mark Waite added a comment -

            All my attempts to find those anonymous inner classes with either Netbeans or IntelliJ have failed. I feel stupid that I can't find them inside the source files. I see the evidence in the target/classes directory that anonymous inner classes are being generated, but I just don't see them in the implementation.

            Any pointers to techniques to identify them would be much appreciated (preferably without mocking my ineptitude). I've tried finding them with Netbeans. I've tried finding them with IntelliJ. I've tried using a Java decompiler.

            markewaite Mark Waite added a comment - All my attempts to find those anonymous inner classes with either Netbeans or IntelliJ have failed. I feel stupid that I can't find them inside the source files. I see the evidence in the target/classes directory that anonymous inner classes are being generated, but I just don't see them in the implementation. Any pointers to techniques to identify them would be much appreciated (preferably without mocking my ineptitude). I've tried finding them with Netbeans. I've tried finding them with IntelliJ. I've tried using a Java decompiler.
            jglick Jesse Glick added a comment -

            Let me see:

            git-client-plugin$ git pull && mvn compile && javap -classpath target/classes -c -private -l 'org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1'
            …
            Error: class not found: org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1
            

            batmat are you sure you are running the most recent version of git-client? I just started Evergreen and it claims to be running 2.7.0. According to the wiki the current version is 3.0.0-beta5. It is not very useful to report bugs to plugin authors about old versions, in this case from December.

            jglick Jesse Glick added a comment - Let me see: git-client-plugin$ git pull && mvn compile && javap -classpath target/classes -c -private -l 'org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1' … Error: class not found: org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1 batmat are you sure you are running the most recent version of git-client ? I just started Evergreen and it claims to be running 2.7.0. According to the wiki the current version is 3.0.0-beta5. It is not very useful to report bugs to plugin authors about old versions, in this case from December.
            jglick Jesse Glick added a comment -

            In fact with a little digging you can see that this was already fixed and the fix released in 3.0.0-beta4.

            jglick Jesse Glick added a comment - In fact with a little digging you can see that this was already fixed and the fix released in 3.0.0-beta4.
            jglick Jesse Glick made changes -
            Link This issue duplicates JENKINS-52948 [ JENKINS-52948 ]
            jglick Jesse Glick made changes -
            Resolution Duplicate [ 3 ]
            Status Open [ 1 ] Resolved [ 5 ]
            batmat Baptiste Mathus added a comment - https://github.com/jenkins-infra/evergreen/pull/292
            batmat Baptiste Mathus added a comment - FTR https://github.com/jenkinsci/git-client-plugin/pull/330 fix
            batmat Baptiste Mathus made changes -
            Component/s git-client-plugin [ 17423 ]
            Component/s git-plugin [ 15543 ]
            markewaite Mark Waite made changes -
            Status Resolved [ 5 ] Closed [ 6 ]

            People

              markewaite Mark Waite
              batmat Baptiste Mathus
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: