You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Poulter, Toby" <tp...@kpmg.co.nz> on 2001/09/08 13:33:38 UTC

Weird XML Error

I am having trouble with a strange error that occurs when I try to run a
build.

I use a valid buildfile (as far as I can work out):

<?xml version="1.0" encoding="utf-8" ?>
<project name="integration" default="info" basedir=".."
description="integrate and test application on a single machine">
	<target name="init" description="initialisation routines and
properties">
		<tstamp />
	</target>
	<target name="info" depends="init" description="print info about
your build environment">
		<echo message="OS Name:                ${os.name}" />
		<echo message="OS Version:             ${os.version}" />
		<echo message="" />
	</target>
</project>

The error returned is "Document root element is missing" and the full -v
output is:

D:\temp\build\buildfiles>ant -buildfile test2.xml -v
Ant version 1.4 compiled on September 3 2001
Buildfile: test2.xml
Detected Java version: 1.3 in: c:\jdk1.3.1\jre
Detected OS: Windows 2000
parsing buildfile D:\temp\build\buildfiles\test2.xml with URI =
file:D:/temp/bui
ld/buildfiles/test2.xml

BUILD FAILED

D:\temp\build\buildfiles\test2.xml:1: Document root element is missing.
        at org.apache.tools.ant.ProjectHelper.parse(ProjectHelper.java:135)
        at
org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.jav
a:85)
        at org.apache.tools.ant.Main.runBuild(Main.java:439)
        at org.apache.tools.ant.Main.start(Main.java:153)
        at org.apache.tools.ant.Main.main(Main.java:176)

Total time: 1 second

I am finding this rather baffling, so any help is warmly received!

Thanks,

Toby.




Disclaimer: 
The information in this electronic mail message is confidential and may be legally privileged. It is intended solely for the addressee. Access to this Internet electronic mail message by anyone else is unauthorised.  
If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it is prohibited and may be unlawful.
When addressed to our clients any opinions or advice contained in this Internet electronic mail message are subject to the terms and conditions expressed in the governing KPMG client engagement letter.

KPMG accepts no responsibility for any effects this email message or attachments has on the recipient network or computer system.

RE: Weird XML Error

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
> -----Original Message-----
> From: Poulter, Toby [mailto:tpoulter@kpmg.co.nz]
> Sent: Saturday, 8 September 2001 9:34 PM
> To: ant-user@jakarta.apache.org
> Subject: Weird XML Error
>
>
> I am having trouble with a strange error that occurs when I try to run a
> build.
>
> I use a valid buildfile (as far as I can work out):

Not quite. Try this
<?xml version="1.0" encoding="utf-8" ?>
<project name="integration" default="info" basedir="..">
  <description>integrate and test application on a single
machine</description>
	<target name="init" description="initialisation routines and properties">
		<tstamp />
	</target>

	<target name="info" depends="init" description="print info about your build
environment">
		<echo message="OS Name:                ${os.name}" />
		<echo message="OS Version:             ${os.version}" />
		<echo message="" />
	</target>
</project>

The project element does not have a description attribute. However, I'm
doubtful that this will solev your problem as it seems to be an XML parser
issue. Are you using the standard Ant parser (crimson) or another. What JDK
are you running? Can you please run ant -debug if this still occurs and let
us know of anything interesting.

Conor