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

NullPointerException in dual resolver without @name

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.2.0
    • Fix Version/s: None
    • Component/s: Core
    • Labels:

      Description

      A <dual> with no name attribute gets an NPE in resolve.

      <dual> says it uses common attributes. If so, it really should check and complain instead of blowing up cryptically.

      Here's a test-caseish description:

      <ivysettings>
      <settings defaultResolver="x" />
      <resolvers>
      <chain name="vendor-1">
      <dual >
      <filesystem name="vendor1-ivy" checkmodified="true" changingPattern=".*">
      <ivy pattern="${vendor.dir}/vendor1-ivy/[organization]-ivy.xml" />
      </filesystem>
      <filesystem name="vendor1-jars" checkmodified="true" changingPattern=".*">
      <artifact pattern="${vendor.dir}/vendor1/[artifact].[ext]" />
      </filesystem>
      </dual>
      </chain>
      <chain name="x"> ... </chain>
      </resolvers>
      <modules>
      <module organisation="com.vendor1" module="*" resolver="vendor1" />
      </modules>
      </ivysettings>

      vendor1's module object has a resolver with no name, and it gets an NPE trying to cache that name inside DefaultRepositoryCacheManager.saveResolvers.

      main[1] where
      [1] java.util.Hashtable.put (Hashtable.java:394)
      [2] java.util.Properties.setProperty (Properties.java:143)
      [3] org.apache.ivy.core.cache.DefaultRepositoryCacheManager.saveResolvers (DefaultRepositoryCacheManager.java:423)
      [4] org.apache.ivy.core.resolve.IvyNode.loadData (IvyNode.java:176)
      [5] org.apache.ivy.core.resolve.VisitNode.loadData (VisitNode.java:287)
      [6] org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies (ResolveEngine.java:696)
      [7] org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies (ResolveEngine.java:781)
      [8] org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies (ResolveEngine.java:704)
      [9] org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies (ResolveEngine.java:781)
      [10] org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies (ResolveEngine.java:704)
      [11] org.apache.ivy.core.resolve.ResolveEngine.getDependencies (ResolveEngine.java:576)
      [12] org.apache.ivy.core.resolve.ResolveEngine.resolve (ResolveEngine.java:237)
      [13] org.apache.ivy.core.resolve.ResolveEngine.resolve (ResolveEngine.java:195)
      [14] org.apache.ivy.Ivy.resolve (Ivy.java:502)
      [15] org.apache.ivy.ant.IvyResolve.doExecute (IvyResolve.java:244)
      [16] org.apache.ivy.ant.IvyTask.execute (IvyTask.java:277)
      [17] org.apache.tools.ant.UnknownElement.execute (UnknownElement.java:291)
      [18] sun.reflect.GeneratedMethodAccessor5.invoke (null)
      [19] sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25)
      [20] java.lang.reflect.Method.invoke (Method.java:597)
      [21] org.apache.tools.ant.dispatch.DispatchUtils.execute (DispatchUtils.java:106)
      [22] org.apache.tools.ant.Task.perform (Task.java:348)
      [23] org.apache.tools.ant.Target.execute (Target.java:390)
      [24] org.apache.tools.ant.Target.performTasks (Target.java:411)
      [25] org.apache.tools.ant.Project.executeSortedTargets (Project.java:1,360)
      [26] org.apache.tools.ant.Project.executeTarget (Project.java:1,329)
      [27] org.apache.tools.ant.helper.DefaultExecutor.executeTargets (DefaultExecutor.java:41)
      [28] org.apache.tools.ant.Project.executeTargets (Project.java:1,212)
      [29] org.apache.tools.ant.Main.runBuild (Main.java:801)
      [30] org.apache.tools.ant.Main.startAnt (Main.java:218)
      [31] org.apache.tools.ant.launch.Launcher.run (Launcher.java:280)
      [32] org.apache.tools.ant.launch.Launcher.main (Launcher.java:109)
      main[1]

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              klotz Leigh L. Klotz, Jr
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: