Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Buildfile: build.xml does not exist! Build failed

 
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Bartender
Posts: 2661
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have to run the start target first. Tomcat is not running.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Praveen and welcome top Javaranch! Can you start a new topic with your specific problem? And please TellTheDetails
 
There's a way to do it better - find it. -Edison. A better tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic