Uploaded image for project: 'IvyDE (Retired)'
  1. IvyDE (Retired)
  2. IVYDE-248

Reload settings will not try to re-read ivysettings.xml file after failure to find file at start-up (possibly due to Eclipse variable substitution)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.1.0
    • 2.2.0.beta1
    • classpath container
    • None
    • Windows XP SP3, Eclipse 3.4 + 3.5

    Description

      OVERVIEW
      =========
      In running through several outage cases in our group's use of Ivy, I ran into an interesting start-up case.

      Right now our common ivysettings.xml file is housed on a file share. If we have a network outage before the user starts up Eclipse, IvyDE will of course give an error. However, when the file share becomes accessible again a "Reload settings" from the ivy.xml container or a "Resolve" will still fail. I have also tested the much simpler case of simply renaming the ivysettings.xml file before starting Eclipse to simulate a file share disruption, which also results in the same issue.

      REPRO
      ======
      1)
      Have Eclipse setup with at least one project using Ivy/IvyDE and referencing an ivysettings.xml file on a file system. (i.e. file:/path/to/ivysettings.xml)

      2)
      Close Eclipse

      3)
      Rename the ivysettings.xml file to something else

      4)
      Launch Eclipse (now without access to the ivysettings.xml) and we get the error:
      Error while resolving the ivy instance for ivy.xml in 'MyIvyProject':
      Unrecognized variables in the Ivy settings file ${workspace_loc:MyIvyProject/P:/Ivy/common/ivysettings.xml}

      Make note that it's considering the absolute file path a VARIABLE for some reason.

      4)
      Rename the file back to ivysettings.xml

      5)
      Attempt a resolve, reload, refresh, etc., all result in the same error:
      Error while resolving the ivy instance for ivy.xml in 'MyIvyProject':
      Unrecognized variables in the Ivy settings file ${workspace_loc:MyIvyProject/P:/Ivy/common/ivysettings.xml}

      Here is the stack trace:
      org.apache.ivyde.eclipse.IvyDEException: Error while resolving the ivy instance for ivy.xml in 'MyIvyProject':
      Unrecognized variables in the Ivy settings file ${workspace_loc:MyIvyProject/P:/Ivy/common/ivysettings.xml}
      at org.apache.ivyde.eclipse.cpcontainer.IvySettingsSetup.getResolvedIvySettingsPath(IvySettingsSetup.java:64)
      at org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainerConfiguration.getInheritedIvySettingsPath(IvyClasspathContainerConfiguration.java:213)
      at org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainerState.doGetIvy(IvyClasspathContainerState.java:144)
      at org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainerState.getIvy(IvyClasspathContainerState.java:136)
      at org.apache.ivyde.eclipse.cpcontainer.IvyResolveJob.run(IvyResolveJob.java:69)
      at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
      Caused by: org.eclipse.core.runtime.CoreException: Variable references non-existent resource : ${workspace_loc:MyIvyProject/P:/Ivy/common/ivysettings.xml}
      at org.eclipse.debug.internal.core.variables.WorkspaceResolver.resolveValue(WorkspaceResolver.java:56)
      at org.eclipse.core.internal.variables.DynamicVariable.getValue(DynamicVariable.java:54)
      at org.eclipse.core.internal.variables.StringSubstitutionEngine.resolve(StringSubstitutionEngine.java:267)
      at org.eclipse.core.internal.variables.StringSubstitutionEngine.substitute(StringSubstitutionEngine.java:192)
      at org.eclipse.core.internal.variables.StringSubstitutionEngine.performStringSubstitution(StringSubstitutionEngine.java:86)
      at org.eclipse.core.internal.variables.StringVariableManager.performStringSubstitution(StringVariableManager.java:573)
      at org.apache.ivyde.eclipse.cpcontainer.IvySettingsSetup.getResolvedIvySettingsPath(IvySettingsSetup.java:62)
      ... 5 more

      NOTES
      ======

      • Why is the file URL changing to a variable substitution? I used the "File System" button to select the file in the Classpath Container settings window.
      • This issue DOESN'T occur if during an Eclipse session you lose access to the file, attempt to reload settings (fail), restore the file, and attempt to reload again.

      WORKAROUNDS
      ==============

      • Close Eclipse, restore ivysettings.xml file, start Eclipse
      • Go back in the Classpath Container settings window and press OK

      Attachments

        Activity

          People

            hibou Nicolas Lalevée
            adiloret Anthony Di Loreto
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: