Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Getting exception org.xml.sax.SAXParseException while reading XML file.

Ajay SharmaJan 4 2013 — edited Jan 7 2013
Hi,

I have a following xml File:
<?xml version='1.0' encoding='UTF-8'?>
<Log
	><INFO
		>
		<TIME_STAMP>2013-Jan-01 11:01:547</TIME_STAMP>
		<DATABASE_NAME>test</DATABASE_NAME>
		<METHOD_NAME>validateUserConnection</METHOD_NAME>
		<MESSAGE>Connection established.</MESSAGE>
	</INFO>
</Log>
<Log
	><ERROR
		><USER_NAME></USER_NAME>
		<TIME_STAMP>2013-Jan-01 11:01:579</TIME_STAMP>
		<DATABASE_NAME>test</DATABASE_NAME>
		<METHOD_NAME>validateUserConnection</METHOD_NAME>
		<MESSAGE>Connection Failed.</MESSAGE>
	</ERROR>
</Log>
When I am trying to read this file I am getting following exception
[Fatal Error] log_2013-Jan-01.xml:14:2: The markup in the document following the root element must be well-formed.
Exception in thread "main" org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.
Reagrds,
Ajay
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 4 2013
Added on Jan 4 2013
8 comments
1,031 views