ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "shree vinayakh" <bvinay...@gmail.com>
Subject error while using project helper
Date Thu, 20 Apr 2006 05:13:28 GMT
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."

stack trace:

E:\SOAPApp\OrderBO.java:1: Content is not allowed in prolog.
    at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java
:233)
    at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java
:140)
    at ExecuteAnt.doAnt(ExecuteAnt.java:18)
    at SOAPApp.main(SOAPApp.java:120)
Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
    at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown
Source)
    at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown
Source)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown
Source)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown
Source)
    at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown
Source)
    at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(Unknown
Source)
    at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown
Source)
    at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java
:217)
    ... 3 more
--- Nested Exception ---
org.xml.sax.SAXParseException: Content is not allowed in prolog.
    at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown
Source)
    at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown
Source)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown
Source)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown
Source)
    at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown
Source)
    at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(Unknown
Source)
    at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown
Source)
    at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java
:217)
    at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java
:140)
    at ExecuteAnt.doAnt(ExecuteAnt.java:18)
    at SOAPApp.main(SOAPApp.java:120)


why is this exception happening... im able to execute the ant script
externally from command line or using eclipse. unable to run the ant script
using my java application.

code snippet that i use:

try
        {
            Project project=new Project();
            project.init();
             ProjectHelper helper=ProjectHelper.getProjectHelper();
             helper.parse(project,servicefile);
             project.executeTarget("deltemp");
        }
        catch (BuildException e)
        {
            e.getStackTrace();
            System.out.println(e);
            e.printStackTrace();

        }



regards,
vinayakh
**

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message