ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Petar Tahchiev" <paranoia...@gmail.com>
Subject Re: error while using project helper
Date Thu, 20 Apr 2006 07:02:45 GMT
On 20/04/06, shree vinayakh <bvinayakh@gmail.com> wrote:
> hi,
>
> Im able to view the generated ANT file. Also that im able to execute the ant
> file using eclipse or from command line. but executing it from my java
> program is the only problem.
>
> contents of the xml ant file
>
> <?xml version="1.0"?>
> <project name="OrderBO" basedir="E:\SOAPApp" default="deltemp">
> <target name="create">
> <mkdir dir="temp_src" />
> </target>
> <target name="copytotemp" depends="create">
> <copy todir="temp_src" verbose="false" overwrite="true">
> <fileset file="OrderBO.java" />
> </copy>
> </target>
> <target name="compile" depends="copytotemp">
> <javac srcdir="temp_src" destdir="." />
> </target>
> <target name="deltemp" depends="compile">
> <delete dir="temp_src"/>
> </target>
> </project>
>
> regards,
> shreevinayakh
>
> On 4/20/06, Stephen McConnell <mcconnell@dpml.net> wrote:
> >
> >
> >
> > > -----Original Message-----
> > > From: shree vinayakh [mailto:bvinayakh@gmail.com]
> > > Sent: Thursday, 20 April 2006 2:43 PM
> > > To: user@ant.apache.org
> > > Subject: error while using project helper
> > >
> > > hi,
> > >
> > > im using a java standalone app to write another java source
> > > file and ant build file.... when i try to execute the ant
> > > build file from the same standalone java app i get error
> > > "Content is not allowed in prolog."
> >
> > <snip>
> >
> > > Caused by: org.xml.sax.SAXParseException: Content is not
> > > allowed in prolog.
> >
> > This is an issue to do with parsing the XML file you created (i.e. not an
> > Ant issue).  I recommend you review the generated build file and once you
> > have identified and resolved the issue at the XML level then try things
> > with
> > Ant.
> >
> > Cheers, Steve.
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
> >
>
>

I think your problem is the so called Byte-Order-Mark(BOM).
I've also found that some text editors will add a BOM (Byte-Order
Mark) to UTF-8 files. Java expects the BOM on files with other
encoding, but can get confused when it finds the UTF-8 BOM, and
reports unknown content in the prolog. Switching to UTF-16 is one way
to avoid the problem.
Also try saving your file as utf-16 encoding and place this at the
beginning of your xml file:
<?xml version='1.0' encoding='utf-16'?>

and finally take a look at these links:

http://forum.java.sun.com/thread.jspa?forumID=34&threadID=491010
http://www.i18ngurus.com/encyclopedia/byte_order_mark.html
--
Regards, Petar!

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message