Dear Team,
I am new babie in ant please help me.
I have created war files using Apache Ant version 1.8.1, war files is generated successfully. I want to start tomcat 7.0.23 and place my project in webapps directory of tomcat but after creating war files build.xml not executing below bold lines. I donot know what is wrong, please look into this i am sending by build.xml files as well as build.properties files
build.xml file:
build.properties:
Akhilesh Trivedi
Ranch Hand
Joined: Jun 22, 2005
Posts: 1493
posted
0
arvind kushwaha wrote:I donot know what is wrong...
I am getting the below error.
I donot know which file is not found.
aa@aa-desktop:~/tempworkspace$ ant
Buildfile: /home/aa/tempworkspace/build.xml
init:
[echo] !!!Making directories !!!
compile:
[echo] !!!Compiling Java Files !!!
[javac] /home/aa/tempworkspace/build.xml:31: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
war:
[echo] !!!Creating War files !!!
[war] Building war: /home/aa/tempworkspace/dist/togle.war
deploy:
[echo] !!!deploy !!!
install:
[echo] !!!install Target!!!
BUILD FAILED
/home/aa/tempworkspace/build.xml:108: java.io.FileNotFoundException: togle (Is a directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:120)
at java.io.FileInputStream.<init>(FileInputStream.java:79)
at org.apache.catalina.ant.DeployTask.execute(DeployTask.java:170)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)
at org.apache.tools.ant.Project.executeTarget(Project.java:1366)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1249)
at org.apache.tools.ant.Main.runBuild(Main.java:801)
at org.apache.tools.ant.Main.startAnt(Main.java:218)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
The part in red is the file name, the part in blue is what Ant doesn't like. If you go back to the "install" target, you will note that the "war" property on line 106 is set to a directory, but it expects a file.
Thanks Peter for your's precious comment. The Problem is solved.
Thanks to all guys who help on this matter. I had make some changes and it worked. But on below bold line No: 29 want to pass dynamic file name instead of hard code. Can Any one Help on this. I am
attaching build. xml and build.properties file.
I assume, based on the file name, that the file is generated by some process somewhere and that process includes a date/time string in the filename, and what you want to do is set up the build.xml generically enough to handle whatever name was generated. This requires two steps:
1) First, change line 29 to be:
2) Set the sql.fileName property to the file's name. Exactly how that is done depends on who or what generated the file. Possibilities include updating the build.properties with the name and passing it using -D or setting an environment variable. There are probably other ways. But without knowing how the file gets generated, I can't be more specific.
arvind kushwaha
Ranch Hand
Joined: Aug 12, 2011
Posts: 32
posted
0
Dear Peter,
The file is given by user, i don't have to worried about that, thank you so much, but supposed above file run it created database, table and inserted all value. but i had updated some jsp again i have to run the build.xml file, in this scenario though table is created already it again try to do the same . I want to skip the database part when its run second time or all the data is already present in user machine. how would i achieve this in single build.xml file.