ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 5837] New: - Unable to build when project file contains double-byte characters
Date Mon, 14 Jan 2002 14:46:28 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5837>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5837

Unable to build when project file contains double-byte characters

           Summary: Unable to build when project file contains double-byte
                    characters
           Product: Ant
           Version: 1.3
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Build Process
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: sean.pritchard@ncr.com


When I attempt to use ant to build with the following project file:

<project name="TestĂě┼" default="CompileDBO" 
basedir="C://Teradata/TPS/generated/collaterals/TestĂě┼">
	<property name="dest" value="C://Teradata/TPS/generated/classes"/>
	<property name="classpath"  
value="${dest};C://Teradata/TPS/generated/classes;C://Teradata/TPS/classes;C:/jb
uilder5/jdk1.3/lib/tools.jar;;C://Teradata/TPS/lib/TPS.jar"/>

	<target name="CompileDBO">
		<javac srcdir="." destdir="${dest}" classpath="${classpath}" 
includes="**/*DBO*"/>
	</target>
</project>


I get the following error:

Element type "project" must be followed by either attribute specifications, ">" 
or "/>".


I invoke ant with the following code:

public static void callAnt (String command, String bFile, String lFile) throws 
CallAntException {
        try {
            System.setProperty
("javax.xml.parsers.SAXParserFactory", "org.apache.xerces.jaxp.SAXParserFactoryI
mpl");
            File buildFile = new File(bFile);
            File lgFile = new File(lFile);
            Project project = new Project();
            project.init();
            project.addBuildListener(createLogger(lgFile));
            project.setUserProperty("ant.file", buildFile.getAbsolutePath());
            Class.forName("javax.xml.parsers.SAXParserFactory");
            ProjectHelper.configureProject(project, buildFile);
            Vector targets = new Vector();
            // make sure that we have a target to execute
            if ((command != null) && (!command.equals(""))) {
                targets.addElement(command);
            }
            else {
                targets.addElement(project.getDefaultTarget());
            }
            // actually do some work
            project.executeTargets(targets); //exception occurs here
        } catch (BuildException e) { //error handling here}
}

When I avoid using double-byte characters in the project file, everything works 
without problem.

I have modified the ant code on my system as follows to correct the problem.

Original code in org.apache.tools.ant.ProjectHelper (parse() method)

inputStream = new FileInputStream(buildFile);
inputSource = new InputSource(inputStream);
inputSource.setSystemId(uri);

modified code:

inputStream = new FileInputStream(buildFile);
inputSource = new InputSource(new InputStreamReader(inputStream));
inputSource.setSystemId(uri);

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message