XML - Markup following root element must be well-formed

1.9k views Asked by At

I keep getting errors with my xml file when trying to run a build... this is the error:

lineNumber: 68; columnNumber: 12; The markup in the document following the root element must be well-formed.

Here's the code:

  <module name="Checker">
 <module name="LineLength">
    <property name="max" value="150"/>
</module>

   <module name="BeforeExecutionExclusionFileFilter">
        <property name="fileNamePattern" value="module\-info\.java$"/>
    </module>
    <property name="fileExtensions" value="java, properties, xml"/>

    <!-- General file conventions -->
    <module name="NewlineAtEndOfFile">
        <property name="lineSeparator" value="lf_cr_crlf" />
    </module>
    <module name="FileTabCharacter"/>
    <module name="RegexpSingleline">
        <property name="format" value="\s+$"/>
        <property name="minimum" value="0"/>
        <property name="maximum" value="0"/>
        <property name="message" value="Line has trailing spaces."/>
    </module>

    <module name="TreeWalker">
        <!-- Naming conventions -->
        <module name="ConstantName"/>
        <module name="LocalFinalVariableName"/>
        <module name="LocalVariableName"/>
        <module name="MemberName"/>
        <module name="MethodName"/>
        <module name="PackageName"/>
        <module name="ParameterName"/>
        <module name="StaticVariableName"/>
        <module name="TypeName"/>
     </module>

        <!-- Checks for imports -->
      <module name="AvoidStarImport"/>
          <property name="excludes" value="java.io,java.net,java.lang.Math"/>
     </module>
          <module name="IllegalImport"/>
          <module name="RedundantImport"/>
          <module name="UnusedImports"/>
             <property name="processJavadoc" value="false"/>
     </module>

        <!-- Checks for Size Violations -->
        <module name="MethodLength"/>
        <module name="ParameterNumber"/>

        <!-- Checks for whitespace -->
            <module name="EmptyForIteratorPad"/>
        <module name="GenericWhitespace"/>
        <module name="MethodParamPad"/>
        <module name="NoWhitespaceAfter"/>
        <module name="NoWhitespaceBefore"/>
        <module name="OperatorWrap"/>
        <module name="SeparatorWrap">
            <property name="tokens"
                      value="COMMA,LPAREN,RPAREN,RBRACK,ARRAY_DECLARATOR"/>
            <property name="option" value="eol"/>
        </module>
        <module name="SeparatorWrap">
            <property name="tokens" value="DOT,METHOD_REF,ELLIPSIS,AT"/>
            <property name="option" value="nl"/>
        </module>
        <module name="ParenPad"/>
        <module name="TypecastParenPad"/>
        <module name="WhitespaceAfter"/>
        <module name="WhitespaceAround"/>
        <module name="SingleSpaceSeparator"/>

        <!-- Modifier Checks -->
            <module name="ModifierOrder"/>
        <module name="RedundantModifier"/>

        <!-- Checks for blocks. You know, those {}'s -->
            <module name="AvoidNestedBlocks"/>
        <module name="EmptyBlock"/>
        <module name="LeftCurly"/>
        <module name="NeedBraces"/>
        <module name="RightCurly"/>

        <!-- Checks for common coding problems -->
            <module name="EmptyStatement"/>
        <module name="EqualsHashCode"/>
        <module name="IllegalInstantiation"/>
        <module name="InnerAssignment"/>
        <module name="MultipleVariableDeclarations"/>
        <module name="SimplifyBooleanExpression"/>
        <module name="SimplifyBooleanReturn"/>

        <!-- Checks for class design -->
            <module name="DesignForExtension"/>
        <module name="FinalClass"/>
        <module name="HideUtilityClassConstructor"/>
        <module name="InterfaceIsType"/>
        <module name="VisibilityModifier"/>

        <!-- Miscellaneous other checks -->
            <module name="ArrayTypeStyle"/>
        <module name="UpperEll"/>
        <module name="Indentation">
            <property name="caseIndent" value="0"/>
            <property name="lineWrappingIndentation" value="8"/>
        </module>

        <!-- Checks for annotations -->
            <module name="MissingOverride"/>
        </module>

The line that's having problems is:

         <module name="IllegalImport"/>

Any help would be appreciated! I have tried adding an end tag name but to no avail.

1

There are 1 answers

3
Daniel Haley On

Looks like you need to remove the self-closing / from:

<module name="AvoidStarImport"/>

and

<module name="UnusedImports"/>