*
The moose likes Ant, Maven and Other Build Tools and the fly likes Document root element is missing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Document root element is missing" Watch "Document root element is missing" New topic
Author

Document root element is missing

Srinivasa Kadiyala
Ranch Hand

Joined: Jun 10, 2004
Posts: 237
when I am running my build.xml file through MyEclipse 5.0, I am getting the following messge:
BUILD FAILED
C:\xyz\abc\build.xml:1: Document root element is missing.

Apprecaite some help.

FYI... Build is successful from command prompt.
Thanks in advance.


Srini
Srinivasa Kadiyala
Ranch Hand

Joined: Jun 10, 2004
Posts: 237
Can any expert give an answer?
Srinivasa Kadiyala
Ranch Hand

Joined: Jun 10, 2004
Posts: 237
Hi Tim Holloway

Do you have any answer to my issue?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15962
    
  19

Does your build.xml file have a <project> element at its root?


Customer surveys are for companies who didn't pay proper attention to begin with.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Hi Puthriah,
Please be patient. Remember that people helping are not here all time, or may be living in a different time zone than yours. And most of all, at the ranch Patience is a Virtue. Thank you


[My Blog]
All roads lead to JavaRanch
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Expanding on Tim's question, it sounds like your build.xml file is not a valid xml file. It has to have a single root tag (which in the case of an Ant build file has to be a project tag).


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Srinivasa Kadiyala
Ranch Hand

Joined: Jun 10, 2004
Posts: 237
yes build.xml has the <project> start and end tag.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
What happens if you use a build script that is empty besides the project tag?
Srinivasa Kadiyala
Ranch Hand

Joined: Jun 10, 2004
Posts: 237
Still the same problem.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Originally posted by Puthriah Sarma:
Still the same problem.


Can you post the *exact* content of the build.xml in this case?
Srinivasa Kadiyala
Ranch Hand

Joined: Jun 10, 2004
Posts: 237
Hi Ilja Preuss

This text box is not accepting the HTML tags to paste here. I tried code as well as quote and it did not allow me. SO I am sending an e-mail to you with the build.xml file. Pl review and suggest. Regret for any inconvenience.

Thanks
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Mhh, I was actually talking about the minimal build script, not the whole big one.

So I was thinking about something like



Was that the content you tried it with - and still got the same error?
[ July 12, 2007: Message edited by: Ilja Preuss ]
Srinivasa Kadiyala
Ranch Hand

Joined: Jun 10, 2004
Posts: 237
I tried with and with out project tag. it is stilling giving me the smae error.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15962
    
  19

There are 2 things that seem to give this message. One of them is a fundamental XML problem, which is what Ilja has been pursuing. The other one is uglier and one reason I've kept out of this - aside from waiting to see if maybe it was just a fundamental XML problem - is because I don't remember exactly how it worked.

I recall vaguely having a problem like this with either a sub-script or an AntCall or something that's essentially recursive. I also seem to recall that the defective file wasn't even the Ant script, it was some other XML file entirely.

Unfortunately, I can't remember anything useful.

However, since this is something that works from the command line but not in Eclipse, I recommend opening up Eclipse's Ant dialog and setting the '-v' command-line switch, then examining what Ant writes to the console. Maybe that will at least narrow things down.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
And if '-v' doesn't show anything helpful, try '-d'.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Document root element is missing
 
Similar Threads
Tomcat startup error
Root node
ant xmlcatalog
Child element fragment losing namespace
Problem in creating a jdom document