Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-4205

Model importer can silently fail and report importSuccessful when given badly formed XML

    Details

    • Bugzilla Id:
      4187

      Description

      I've recently re-based to the latest OpenNMS stable (1.8 series) and was having with the model importer. Although the events seem to imply the import had started and succeeded new nodes where not being added. After enabling diagnostics on the importer and seeing nothing I saw that output.log was throwing up exceptions in the parsing.

      The script I was using generate my model-importer file was based on the old 1.6 era and generated a bad header referencing example.org:

      <this:model-import xmlns:this="http://www.example.org/model-import"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemalLocation="http://www.example.org/model-import model-import.xsd"
      date-stamp="2008-08-20T00:03:09"
      foreign-source="vnms">

      As result this was causing a failure when the file was loaded:

      Caused by: org.opennms.netmgt.provision.persist.ForeignSourceRepositoryException: unable to import requisition resource URL file:/export/csrc/opennms/opennms.git/broken-import.xml; nested exception is javax.xml.bind.UnmarshalException: unexpected element (uri:"http://www.example.org/model-import", local:"model-import"). Expected elements are <

      {http://xmlns.opennms.org/xsd/config/model-import}

      asset>,<

      {http://xmlns.opennms.org/xsd/config/model-import}

      category>,<

      {http://xmlns.opennms.org/xsd/config/model-import}

      interface>,<

      {http://xmlns.opennms.org/xsd/config/model-import}

      model-import>,<

      {http://xmlns.opennms.org/xsd/config/model-import}

      monitored-service>,<

      {http://xmlns.opennms.org/xsd/config/model-import}

      node>

      However I was still seeing importSuccessful events which seemed to imply there where no problems.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ranger Benjamin Reed
                Reporter:
                bugzilla@bennee.com Alex Bennee
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: