Win a copy of Svelte and Sapper in Action this week in the JavaScript 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

build failed due to restriction of target matching instruction

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hye everyone. I am a new bee in ant. i am using ant 1.6.5. i wrote a build file for my project(jspbook) from the book - " servlets and jsp " by jayson falkner.I exactly copied the build file from the book and placed it in my jspbook folder inside webapps under tomcat 5.5.9.

i got the message in cmd as:
"D:\Tomcat 5.5.9\webapps\jspbook\build.xml:2: The processing instruction target matching "[xX][mM][lL]" is not allowed."

here is my build.xml file:
<?xml version="1.0" ?>
<project name="jspbook" default="build" basedir=".">
<target name="build">
<echo>Starting Build [JSP BOOK - http://www.jspbook.com] </echo>
<!-- Turn Tomcat Off -->
<antcall target="tomcatOff"/>
<!--compile Everything -->
<antcall target ="compile"/>
<!--Turn Tomcat on -->
<antcall target="tomcatOn"/>
<echo>Build Finished [JSP BOOK - http://www.jspbook.com] </echo>
</target>

<target name="tomcatOff">
<echo>Turning Off Tomcat [http://www.jspbook.com]</echo>
<exec executable="bash" os="Windows">
<arg value="../../bin/shutdown.bat"/>
</exec>
<exec executable="bash" os="Linux">
<arg value="../../bin/shutdown.sh"/>
</exec>
</target>

<target name="tomcatOn">
<echo>starting Tomcat [http://www.jspbook.com]</echo>
<exec executable="bash" os="Windows">
<arg value="../../bin/startup.bat"/>
</exec>
<exec executable="bash" os="Linux">
<arg value="../../bin/startup.sh"/>
</exec>
</target>

<target name="compile">
<echo>Compiling Book's Examples [http://www.jspbook.com] </echo>
<javac
srcdir="WEB-INF/classes"
extdirs="WEB-INF/lib:../../common/lib"
classpath="../../common/lib/servlet.jar"
depreciation="yes"
verbose="no">
<include name="com/jspbook/**"/>
</javac>
</target>
</project>

Kindly tell me what is wrong and how can i trouble shoot it. thanks fo reading.
 
drifter
Posts: 1364
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can google on the error message and find a bunch of suggestions.

Make sure you don't have any spaces or blank lines before "<?xml version="1.0" ?>"

I pasted your build.xml into a new file and it works fine for me with ant 1.6.5. If I put a space or a blank line before "<?xml version="1.0" ?>"
I get the error you got.

If that doesn't work, you could try removing that line completely.
 
riyaz udeen
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hye carol. thank you bravo.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Carol Enderlin , It is true, when copying from text book or any online tutorial some special characters may be copied (which may be used for formatting in books or tutorials blogs), but we need to make sure these characters are trimmed off before pasting it into our project. some IDE's will do this automatically.
 
The happiness of your life depends upon the quality of your thoughts -Marcus Aurelius ... think about this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic