File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Buildfile: build.xml does not exist! Build failed

 
preethi Ayyappan
Ranch Hand
Posts: 518
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I need to develop application using spring.For this i need to install ant.I have installed ant in the path c: . but when i type ant in the cmd prompt, the following error exist:

Buildfile: build.xml does not exist!
Build failed


Please assist me to solve this

Thanks
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So where is the build.xml file? If it's not in the directory where you're executing the command, then you need to tell Ant where to find it using the "-file" switch.
 
preethi Ayyappan
Ranch Hand
Posts: 518
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is build.xml in many places.But if i give the command ant -find file,the following error occurs

C:\Documents and Settings\peopleTech>ant -find build.xml
Searching for build.xml ...
Could not locate a build file!
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is build.xml in many places.

You can run only one of them at any given time. So you need to pass the path to whichever one you want to run as argument to the "-file" parameter.

C:\Documents and Settings\peopleTech>ant -find build.xml

The parameter is called "-file", not "-find". This only works if the build.xml file is in the current directory. If it's in a subdirectory, then you need to specify that, for instance: "ant -file someSubDirectory/build.xml"

I think this would be a good time for you to read the extensive Ant documentation that comes with the download; look in the "docs" directory. It covers all this.
 
preethi Ayyappan
Ranch Hand
Posts: 518
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.Now i can able to successfully build the file.But i tried to build the file inside eclipse and i right click on the build.xml and clicked run as Ant build file.I found the following error in the eclipse console:


Buildfile: D:\eclipse\workspace\Springdemo\war\WEB-INF\build.xml

BUILD FAILED
D:\eclipse\workspace\Springdemo\war\WEB-INF\build.xml:85: C:\Documents and Settings\peopleTech\apache-tomcat-5.5\lib not found.

Total time: 234 milliseconds

 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does that directory exist? If not, you'll need to change the build file to reflect its proper location.
 
preethi Ayyappan
Ranch Hand
Posts: 518
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for the delay.I have made the tomcat installation in the path mentioned in the build.xml.Now I am getting the following error:

Buildfile: D:\eclipse\workspace\Springdemo\war\WEB-INF\build.xml

BUILD FAILED
D:\eclipse\workspace\Springdemo\war\WEB-INF\build.xml:85: taskdef class org.apache.catalina.ant.InstallTask cannot be found

Total time: 375 milliseconds



 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The error message mentions a class that can't be found. Look around in the Ant and Tomcat jar files for that class, and make sure it's in the classpath when you run Ant.
 
preethi Ayyappan
Ranch Hand
Posts: 518
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.Now it is working.In build.properties I have changed the

appserver.lib=${appserver.home}/lib
to
appserver.lib=${appserver.home}/server/lib
 
preethi Ayyappan
Ranch Hand
Posts: 518
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When i try to list ant via eclipse i am getting the following error:

Buildfile: D:\eclipse\workspace\Springdemo\war\WEB-INF\build.xml
usage:
[echo] springapp build file
[echo] -----------------------------------
[echo] Available targets are:
[echo] build --> Build the application
[echo] deploy --> Deploy application as directory
[echo] deploywar --> Deploy application as a WAR file
[echo] install --> Install application in Tomcat
[echo] reload --> Reload application in Tomcat
[echo] start --> Start Tomcat application
[echo] stop --> Stop Tomcat application
[echo] list --> List Tomcat applications
build:
deploy:
list:

BUILD FAILED
D:\eclipse\workspace\Springdemo\war\WEB-INF\build.xml:133: java.io.FileNotFoundException: http://localhost:8080/manager/list

Total time: 375 milliseconds

 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Without knowing what the build file is trying to do at that moment, we can't guess what's going on. But the error message is rather specific - it should allow you to start investigating what's going wrong. What have you found out so far?
 
Jan Cumps
Bartender
Posts: 2577
11
C++ Linux Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to run the start target first. Tomcat is not running.
 
racha rumbola
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have my java -version running
all the environmental variables are set correctly
ant -version command is also working
but when i enter ant command

c:\>;ant
Buildfile: build.xml does not exist!
Build failed


with this command

C:\>ant -find build.xml
Searching for build.xml ...
Could not locate a build file!


it is asking for a build.xml file
i dont see build.xml file in any of the folders in the unzipped ant-apache-1.8.1 folder
i do not have a build.xml file
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Praveen and welcome top Javaranch! Can you start a new topic with your specific problem? And please TellTheDetails
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic