Menu

#1518 [xml] Error while processing xml file with ".webapp" in the file or directory name

PMD-5.4.4
closed
XML (1)
PMD
3-Major
Bug
5.5.1
2016-11-20
2016-08-31
No

Here is the ant eample output for such files. If the files or the directory is renamed and only ".webapp" is removed there, the error goes away

 [echo] PMD is running on directory X:\DS\java\kreda
  [pmd] X:\DS\java\kreda\kreda.abw\src\META-INF\plan.webapp.abnahmetest.ohne_sso.xml    -   Error while processing X:\DS\java\kreda\kreda.abw\src\META-INF\plan.webapp.abnahmetest.ohne_sso.xml
  [pmd] X:\DS\java\kreda\kreda.webapp\src\META-INF\plan.abnahmetest.ohne_sso.xml    -   Error while processing X:\DS\java\kreda\kreda.webapp\src\META-INF\plan.abnahmetest.ohne_sso.xml

Discussion

  • Andreas Dangel

    Andreas Dangel - 2016-11-04
    • status: open --> more-info-needed
     
  • Andreas Dangel

    Andreas Dangel - 2016-11-04

    Hi Torsten,
    I'm having difficulties reproducing the problem.
    Could you please post:

    • the output, if you run ant with the -v flag (e.g. ant -v pmd)
    • your pmd task of your ant file
    • one of the files plan.abnahmetest.ohne_sso.xml

    I don't think, it's a syntax error in the XML file, as this would result in an "Error while parsing...". Please note, that officially, there is only one rule for XML files: MistypedCDATASection.
    Do you have maybe additional rules? "Error while processing" usually means, that something bad happend during rule execution...

    Regards,
    Andreas

     
  • Torsten Kleiber

    Torsten Kleiber - 2016-11-09

    Sorry for the delay, but I have stripped down a test case a little bit.
    I attach all requested files.
    Altova XML spy shows, that the xml file is valid, but ant verbose error shows a parse error in pmd xml parser.
    We have additional rules, but the error is reproducable in this testcase with the standard rule.

     

    Last edit: Torsten Kleiber 2016-11-09
  • Andreas Dangel

    Andreas Dangel - 2016-11-09
    • summary: Error while processing xml file with ".webapp" in the file or directory name --> [xml] Error while processing xml file with ".webapp" in the file or directory name
    • status: more-info-needed --> accepted
     
  • Andreas Dangel

    Andreas Dangel - 2016-11-09

    Thanks for the files - I can reproduce it now.

    For the records, this is the exception:

    Error while processing file: /home/andreas/PMD/source/pmd-it/bug-1518/plan.special.ikb.adf.kreda.abw.webapp.abnahmetest.ohne_sso.xml
    java.lang.ArrayIndexOutOfBoundsException: -1
        at net.sourceforge.pmd.lang.ast.SourceCodePositioner.columnFromOffset(SourceCodePositioner.java:55)
        at net.sourceforge.pmd.lang.xml.ast.DOMLineNumbers.setBeginLocation(DOMLineNumbers.java:126)
        at net.sourceforge.pmd.lang.xml.ast.DOMLineNumbers.determineLocation(DOMLineNumbers.java:57)
        at net.sourceforge.pmd.lang.xml.ast.DOMLineNumbers.determineLocation(DOMLineNumbers.java:61)
        at net.sourceforge.pmd.lang.xml.ast.DOMLineNumbers.determineLocation(DOMLineNumbers.java:61)
        at net.sourceforge.pmd.lang.xml.ast.DOMLineNumbers.determineLocation(DOMLineNumbers.java:61)
        at net.sourceforge.pmd.lang.xml.ast.DOMLineNumbers.determineLocation(DOMLineNumbers.java:61)
        at net.sourceforge.pmd.lang.xml.ast.DOMLineNumbers.determineLocation(DOMLineNumbers.java:61)
        at net.sourceforge.pmd.lang.xml.ast.DOMLineNumbers.determine(DOMLineNumbers.java:33)
        at net.sourceforge.pmd.lang.xml.ast.XmlParser.parseDocument(XmlParser.java:57)
        at net.sourceforge.pmd.lang.xml.ast.XmlParser.parse(XmlParser.java:69)
        at net.sourceforge.pmd.lang.xml.XmlParser.parse(XmlParser.java:35)
        at net.sourceforge.pmd.SourceCodeProcessor.parse(SourceCodeProcessor.java:91)
    
     
  • Andreas Dangel

    Andreas Dangel - 2016-11-20
    • status: accepted --> closed
    • assigned_to: Andreas Dangel
    • Milestone: New Tickets --> PMD-5.4.4
     
  • Andreas Dangel

    Andreas Dangel - 2016-11-20

    This bug will be fixed with PMD 5.4.4, 5.5.3 and later.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.