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

Cryptic NPE due to spelling error in ivy.xml

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.3-RC2
    • 1.3-RC3
    • Ant
    • None
    • JDK 6, Linux.

    Description

      If you run Ivy on this ivy.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <ivy-module version="1.0">
      <info organisation="myself" module="ivytest"/>
      <dependencies>
      <dependency org="apache" name="dom4j" rev="1.6"/>
      </dependencies>
      </ivy-module>

      All is fine. But I am American and I accidentally wrote

      <?xml version="1.0" encoding="UTF-8"?>
      <ivy-module version="1.0">
      <info organization="myself" module="ivytest"/>
      <dependencies>
      <dependency org="apache" name="dom4j" rev="1.6"/>
      </dependencies>
      </ivy-module>

      (Note s/isa/iza/.) Ivy handles this as follows under normal logging level:

      exception while parsing: null in file:/tmp/ivytest/ivy.xml

      BUILD FAILED
      /tmp/ivytest/build.xml:22: syntax errors in ivy file

      Hmm. Using ant -v:

      using ivy parser to parse file:/tmp/ivytest/ivy.xml
      exception while parsing: null in file:/tmp/ivytest/ivy.xml

      BUILD FAILED
      /tmp/ivytest/build.xml:22: syntax errors in ivy file
      at fr.jayasoft.ivy.ant.IvyResolve.execute(IvyResolve.java:137)
      at fr.jayasoft.ivy.ant.IvyTask.ensureResolved(IvyTask.java:105)
      at fr.jayasoft.ivy.ant.IvyRetrieve.execute(IvyRetrieve.java:70)
      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
      at org.apache.tools.ant.Task.perform(Task.java:364)
      at org.apache.tools.ant.Target.execute(Target.java:341)
      at org.apache.tools.ant.Target.performTasks(Target.java:369)
      at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
      at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
      at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
      at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
      at org.apache.tools.ant.Main.runBuild(Main.java:668)
      at org.apache.tools.ant.Main.startAnt(Main.java:187)
      at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
      at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
      Caused by: java.text.ParseException: exception while parsing: null in file:/tmp/ivytest/ivy.xml
      at fr.jayasoft.ivy.xml.XmlModuleDescriptorParser$Parser.parse(XmlModuleDescriptorParser.java:147)
      at fr.jayasoft.ivy.xml.XmlModuleDescriptorParser$Parser.access$000(XmlModuleDescriptorParser.java:106)
      at fr.jayasoft.ivy.xml.XmlModuleDescriptorParser.parseDescriptor(XmlModuleDescriptorParser.java:74)
      at fr.jayasoft.ivy.parser.AbstractModuleDescriptorParser.parseDescriptor(AbstractModuleDescriptorParser.java:32)
      at fr.jayasoft.ivy.Ivy.resolve(Ivy.java:744)
      at fr.jayasoft.ivy.ant.IvyResolve.execute(IvyResolve.java:100)
      ... 14 more
      Caused by: java.lang.NullPointerException
      at fr.jayasoft.ivy.xml.XmlModuleDescriptorParser$Parser.startElement(XmlModuleDescriptorParser.java:386)
      at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
      at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
      at org.apache.xerces.impl.xs.XMLSchemaValidator.emptyElement(Unknown Source)
      at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
      at javax.xml.parsers.SAXParser.parse(SAXParser.java:176)
      at fr.jayasoft.ivy.util.XMLHelper.parse(XMLHelper.java:68)
      at fr.jayasoft.ivy.xml.XmlModuleDescriptorParser$Parser.parse(XmlModuleDescriptorParser.java:138)
      ... 19 more
      — Nested Exception —
      java.text.ParseException: exception while parsing: null in file:/tmp/ivytest/ivy.xml
      at fr.jayasoft.ivy.xml.XmlModuleDescriptorParser$Parser.parse(XmlModuleDescriptorParser.java:147)
      at fr.jayasoft.ivy.xml.XmlModuleDescriptorParser$Parser.access$000(XmlModuleDescriptorParser.java:106)
      at fr.jayasoft.ivy.xml.XmlModuleDescriptorParser.parseDescriptor(XmlModuleDescriptorParser.java:74)
      at fr.jayasoft.ivy.parser.AbstractModuleDescriptorParser.parseDescriptor(AbstractModuleDescriptorParser.java:32)
      at fr.jayasoft.ivy.Ivy.resolve(Ivy.java:744)
      at fr.jayasoft.ivy.ant.IvyResolve.execute(IvyResolve.java:100)
      at fr.jayasoft.ivy.ant.IvyTask.ensureResolved(IvyTask.java:105)
      at fr.jayasoft.ivy.ant.IvyRetrieve.execute(IvyRetrieve.java:70)
      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
      at org.apache.tools.ant.Task.perform(Task.java:364)
      at org.apache.tools.ant.Target.execute(Target.java:341)
      at org.apache.tools.ant.Target.performTasks(Target.java:369)
      at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
      at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
      at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
      at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
      at org.apache.tools.ant.Main.runBuild(Main.java:668)
      at org.apache.tools.ant.Main.startAnt(Main.java:187)
      at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
      at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
      Caused by: java.lang.NullPointerException
      at fr.jayasoft.ivy.xml.XmlModuleDescriptorParser$Parser.startElement(XmlModuleDescriptorParser.java:386)
      at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
      at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
      at org.apache.xerces.impl.xs.XMLSchemaValidator.emptyElement(Unknown Source)
      at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
      at javax.xml.parsers.SAXParser.parse(SAXParser.java:176)
      at fr.jayasoft.ivy.util.XMLHelper.parse(XMLHelper.java:68)
      at fr.jayasoft.ivy.xml.XmlModuleDescriptorParser$Parser.parse(XmlModuleDescriptorParser.java:138)
      ... 19 more

      Not very helpful message, is it?

      Attachments

        Activity

          People

            xavier Xavier Hanin
            jglick Jesse N. Glick
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: