[Fatal Error] countries.xml:8:6:
The markup in the document following the root element must be well-formed.
Exception in thread "main" org.xml.sax.SAXParseException;
systemId: file:/C:/Users/eclipse-workspace/Test/sample.xml;
lineNumber: 8; columnNumber: 6;
The markup in the document following the root element must be well-formed.
at java.xml/com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:261)
at java.xml/com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
at java.xml/javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:206)
at com.code2care.tutorials.MyXmlDomParserExample.main(MyXmlDomParserExample.java:35)
If you are using Java SAX or DOM parsers and you get the above error, then your XML file is not well-formed while parsing such a file will give you SAXParseException.
Solution:Go to your XML file a check the line number and column number provided in the stack-trace. You can also try using tools like Notepad++ to validate your XML document.
- Error: Can not find the tag library descriptor for
- Create a Database Table using JDBC PreparedStatement
- Java JDBC Select Multiple Records from table as List using PreparedStatement
- Java Jackson with Maven Example
- [fix] Java JDBC ConnectException: Connection refused
- Spring Boot: Transactions Management with JDBCTemplate Example
- Java Get Current Date for a Specific Time Zone
- What are the 8 Primitive Data Types in Java
- Java JDBC: Insert Java 8 LocalDate and Time using PreparedStatement
- Maven Eclipse (M2e) No archetypes currently available
- How to Sort a LinkedList in Java
- [Fatal Error] XML The markup in the document following the root element must be well-formed.
- Split a String in Java with Examples
- Struts 2 : There is no Action mapped for namespace [/] and action name [form] associated with context path [/proj]
- Truncate table using Java JDBC Example
- Java: Generate random numbers within a range
- Parse XML file in Java using DOM Parser
- How to get Client IP address using Java Code Example
- JDBCTemplate Querying Examples with Spring Boot 3
- [Java Threads] Should we extend Thread Class or implement Runnable interface
- String Boot + Redis - SET and GET String Commands Examples
- Setting up Spring Boot 3 + Maven + MySQL + JDBC Example
- Spring Boot: JdbcTemplate Update Query With Parameters Example
- Java Split String by Spaces
- Unbound classpath container: JRE System Library [JavaSE-1.7]
- How to comment code in Python - Python
- How to Open Calculator using Mac Terminal - MacOS
- say command macOS terminal examples - MacOS
- Robinhood unexpected server error - Android
- How to delete all text after a character or string in Notepad++ - NotepadPlusPlus
- Implementing Merge Sort Algorithm in Java Program - Java
- How to create MD5 digest in Notepad++ - NotepadPlusPlus
- SharePoint installation - Appfabric installation failed because installer MSI returned with error code:1603 - SharePoint