ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim Showalter" <jim.showal...@verizon.net>
Subject RE: Problem with <classconstants/> -- resolved
Date Fri, 22 Aug 2008 18:24:40 GMT
This has been resolved.  I needed to set the encoding on the loadproperties
task.

Jim


-----Original Message-----
From: Jim Showalter [mailto:jim.showalter@verizon.net]
Sent: Friday, August 22, 2008 10:04 AM
To: Ant Developers List
Subject: Problem with <classconstants/>


I posted this to Ant Users several weeks ago and have not received any
responses
so now I am trying the developers.  I have searched some of the archives to
no avail.

I am having problems getting this to work as described.  I am using Ant
1.7.1 with bcel-5.2 and java 1.6.  The OS platform is Solaris 10 Unix.  The
only related
environment variables set are ANT_HOME and JAVA_HOME.  The
bcel classParser throws a ClassFormatException when I run a very simple ant
file.  I put a print statement in the org.apache.bcel.classfile.ClassParser
code and the problem appears to be that the readID method returns a
0x3F3F3F3F instead of the expected 0xCAFEBABE value.  I have verified (using
od -x) that the Foo.class file begins with 0xCAFEBABE.
The files are below.


//Foo.java
public class Foo {
   public static final String TESTIT = "hello";
}

<!-- build.xml  -->
<?xml version="1.0" encoding="UTF-8"?>
<project name="project" default="cool">
     <target name="cool">
        <loadproperties srcfile="Foo.class">
            <filterchain>
                <classconstants/>
                <prefixlines prefix="Foo."/>
            </filterchain>
        </loadproperties>
        <echo>${Foo.TESTIT}</echo>
    </target>
</project>


Any help would be appreciated.

Thanks
Jim


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



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


Mime
View raw message