Uploaded image for project: 'Ivy'
  1. Ivy
  2. IVY-1599

IvyAuthenticator causes strange issues in Eclipse IDE

    XMLWordPrintableJSON

Details

    • Story
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.4.0, 2.5.0-rc1
    • None
    • Core
    • None

    Description

      I have very annoying case. Took a time and collected some material.

      I am running Eclipse IDE with Maven projects (m2e is working inside - integration of Maven to Eclipse), basically performing some build workflows over Maven projects by m2e (by Maven running in Eclipse process), at some point the following exception occurs later:

      java.lang.NoClassDefFoundError: org/apache/ivy/util/Credentials
          at org.apache.ivy.util.url.CredentialsStore.getCredentials(CredentialsStore.java:55)
          at org.apache.ivy.util.url.IvyAuthenticator.getPasswordAuthentication(IvyAuthenticator.java:91)
          at java.base/java.net.Authenticator.requestPasswordAuthenticationInstance(Authenticator.java:461)
          at java.base/java.net.Authenticator.requestPasswordAuthentication(Authenticator.java:412)
          at java.base/sun.net.www.protocol.http.HttpURLConnection$1.run(HttpURLConnection.java:454)
          at java.base/sun.net.www.protocol.http.HttpURLConnection$1.run(HttpURLConnection.java:449)
          at java.base/java.security.AccessController.doPrivileged(Native Method)
          at java.base/sun.net.www.protocol.http.HttpURLConnection.privilegedRequestPasswordAuthentication(HttpURLConnection.java:448)
          at java.base/sun.net.www.protocol.http.HttpURLConnection.getServerAuthentication(HttpURLConnection.java:2470)
          at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1755)
          at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1509)
          at java.base/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:527)
          at org.eclipse.jgit.transport.http.JDKHttpConnection.getResponseCode(JDKHttpConnection.java:115)
          at org.eclipse.jgit.util.HttpSupport.response(HttpSupport.java:207)
          at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:514)
          at org.eclipse.jgit.transport.TransportHttp.openPush(TransportHttp.java:439)
          at org.eclipse.jgit.transport.PushProcess.execute(PushProcess.java:160)
          at org.eclipse.jgit.transport.Transport.push(Transport.java:1346)
          at org.eclipse.jgit.api.PushCommand.call(PushCommand.java:170)
          at org.eclipse.egit.core.op.PushOperation.run(PushOperation.java:217)
          at org.eclipse.egit.ui.internal.push.PushJob.performJob(PushJob.java:86)
          at org.eclipse.egit.ui.internal.jobs.RepositoryJob.run(RepositoryJob.java:59)
          at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

      So, working with GIT plugin in Eclipse becomes impossible for any remote tasks (like PULLing or PUSHing).

       

      Very strange issue, isn't it? So , I collected some screenshots while running Eclipse in debug mode and doing remote debugging in another Eclipse instance.

      Look to an attached screenshot IvyAuthenticator_1:   For some reason

       if (!(original instanceof IvyAuthenticator)) {

      is not working as you may expect!

      IvyAuthenticator is set second time in Authenticator.setDefault(..) which creates strange chain, I suppose.

      Making heapdump (screenshot IvyAuthenticator_2) you may see at least that there are 2 instances of IvyAuthenticator in JVM being created by different class loaders.

      The workflow that causes IvyAuthenticator to be set to JVM's Authenticator is a Maven running in Eclipse process, executing  ant-maven-plugin (acordingly pom.xml configuration) that runs Ant task (Ant's buil.xml) that uses Ivy to resolve some dependencies in order to build classpath for third-party Ant task to be executed later with that classpath...

       

      So, having Maven that runs Ant that runs Ivy to resolve deps and using this chain in Eclipse with m2e leads to broken logic , probably related to  multiple different classloaders created by m2e...

      And then other parts of Eclipse like GIT are not working with strange  exceptions about missing classes (which do exist).

      Any thoughts  on IvyAuthenticator?  Is it really needed this way or way to disable it or.. ? Revise code that  is not affected by described environment may be?..

       

       

       

      Attachments

        1. IvyAuthenticator_2.png
          128 kB
          Vitaly Dyachkov
        2. IvyAuthenticator_1.png
          202 kB
          Vitaly Dyachkov

        Activity

          People

            Unassigned Unassigned
            vitalus Vitaly Dyachkov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: