Ivy
  1. Ivy
  2. IVY-1335

NullPointer in IvyAuthenticator; null credentials

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.3.0-RC1
    • Component/s: Core
    • Labels:
      None

      Description

      Trying to build using an https address with basic auth:

      [ivy:resolve] problem occurred while resolving dependency: commons-daemon#commons-daemon;1.0.1

      {common=[default]}

      with iadbuild: java.lang.RuntimeException: java.lang.NullPointerException
      [ivy:resolve] at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1137)
      [ivy:resolve] at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:2346)
      [ivy:resolve] at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:388)
      [ivy:resolve] at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:318)
      [ivy:resolve] at org.apache.ivy.util.url.BasicURLHandler.checkStatusCode(BasicURLHandler.java:97)
      [ivy:resolve] at org.apache.ivy.util.url.BasicURLHandler.getURLInfo(BasicURLHandler.java:73)
      [ivy:resolve] at org.apache.ivy.util.url.BasicURLHandler.getURLInfo(BasicURLHandler.java:54)
      [ivy:resolve] at org.apache.ivy.util.url.URLHandlerDispatcher.getURLInfo(URLHandlerDispatcher.java:66)
      [ivy:resolve] at org.apache.ivy.plugins.repository.url.URLResource.init(URLResource.java:65)
      [ivy:resolve] at org.apache.ivy.plugins.repository.url.URLResource.exists(URLResource.java:81)
      [ivy:resolve] at org.apache.ivy.plugins.resolver.RepositoryResolver.findResourceUsingPattern(RepositoryResolver.java:97)
      [ivy:resolve] at org.apache.ivy.plugins.resolver.AbstractPatternsBasedResolver.findResourceUsingPatterns(AbstractPatternsBasedResolver.java:93)
      [ivy:resolve] at org.apache.ivy.plugins.resolver.IBiblioResolver.findIvyFileRef(IBiblioResolver.java:102)
      [ivy:resolve] at org.apache.ivy.plugins.resolver.BasicResolver.getDependency(BasicResolver.java:223)
      [ivy:resolve] at org.apache.ivy.plugins.resolver.IBiblioResolver.getDependency(IBiblioResolver.java:503)
      [ivy:resolve] at org.apache.ivy.plugins.resolver.ChainResolver.getDependency(ChainResolver.java:104)
      [ivy:resolve] at org.apache.ivy.core.resolve.IvyNode.loadData(IvyNode.java:169)
      [ivy:resolve] at org.apache.ivy.core.resolve.VisitNode.loadData(VisitNode.java:287)
      [ivy:resolve] at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:696)
      [ivy:resolve] at org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies(ResolveEngine.java:781)
      [ivy:resolve] at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:704)
      [ivy:resolve] at org.apache.ivy.core.resolve.ResolveEngine.getDependencies(ResolveEngine.java:576)
      [ivy:resolve] at org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:237)
      [ivy:resolve] at org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:195)
      [ivy:resolve] at org.apache.ivy.Ivy.resolve(Ivy.java:502)
      [ivy:resolve] at org.apache.ivy.ant.IvyResolve.doExecute(IvyResolve.java:244)
      [ivy:resolve] at org.apache.ivy.ant.IvyTask.execute(IvyTask.java:277)
      [ivy:resolve] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
      [ivy:resolve] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
      [ivy:resolve] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [ivy:resolve] at java.lang.reflect.Method.invoke(Method.java:597)
      [ivy:resolve] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
      [ivy:resolve] at org.apache.tools.ant.Task.perform(Task.java:348)
      [ivy:resolve] at org.apache.tools.ant.Target.execute(Target.java:390)
      [ivy:resolve] at org.apache.tools.ant.Target.performTasks(Target.java:411)
      [ivy:resolve] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
      [ivy:resolve] at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
      [ivy:resolve] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
      [ivy:resolve] at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
      [ivy:resolve] at org.apache.tools.ant.Main.runBuild(Main.java:809)
      [ivy:resolve] at org.apache.tools.ant.Main.startAnt(Main.java:217)
      [ivy:resolve] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
      [ivy:resolve] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
      [ivy:resolve] Caused by: java.lang.NullPointerException
      [ivy:resolve] at org.apache.ivy.util.url.IvyAuthenticator.getPasswordAuthentication(IvyAuthenticator.java:97)
      [ivy:resolve] at java.net.Authenticator.requestPasswordAuthentication(Authenticator.java:300)
      [ivy:resolve] at sun.net.www.protocol.http.HttpURLConnection$1.run(HttpURLConnection.java:359)
      [ivy:resolve] at java.security.AccessController.doPrivileged(Native Method)
      [ivy:resolve] at sun.net.www.protocol.http.HttpURLConnection.privilegedRequestPasswordAuthentication(HttpURLConnection.java:355)
      [ivy:resolve] at sun.net.www.protocol.http.HttpURLConnection.getServerAuthentication(HttpURLConnection.java:1922)
      [ivy:resolve] at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1282)
      [ivy:resolve] at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:379)

      I have this in my ivysettings.xml file:

      <credentials host="iadbuild.apple.com" username="$

      {username}

      " password="$

      {password}

      " realm="Artifactory Realm"/>

      It's unclear if the username/password is being used or not. I pass these on the command line using -D.

      Anyway, the NPE isn't too helpful.

      It would be nice if the docs explained this <credentials> thing a bit better as well. Not going to file that one.

        Activity

        Hide
        Maarten Coene added a comment -

        The NullPointerException should be fixed in SVN trunk.
        Thanks for reporting!

        Show
        Maarten Coene added a comment - The NullPointerException should be fixed in SVN trunk. Thanks for reporting!

          People

          • Assignee:
            Maarten Coene
            Reporter:
            Elias Ross
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development