You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Anuradha Weeraman <aw...@gmail.com> on 2006/07/21 09:37:54 UTC

Ant on z/OS

Hi All,

I'm having what appears to be some character set related issues when
running Ant on z/OS under USS. I have tracked down the issue to the
<property environment> tag which doesn't seem to be able to pick up
environment variables and spews ASCII text when the following
IBM_JAVA_OPTIONS variable is defined:

-Dfile.encoding=ISO8859-1 -Dconsole.encoding=IBM-1047 -Xnoargsconversion

The ASCII text, when converted to EBCDIC appears to be environment
variables, so I'm guessing that Ant internally expects the environment
variables in EBCDIC (possibly from the output of /bin/env) which
somehow gets converted to ISO8859-1 due to the file.encoding
parameter, leading to its confusion.

Ant 1.5.3-1 is bundled with the version of Maven that I use, and it
requires the IBM_JAVA_OPTIONS to be set.

Has anyone experienced this before? Does anyone know if Ant is capable
of handling custom file.encoding as in this case?

Regards,
Anuradha

PS. Apologies for cross posting, thought maybe the devs can shed some
light on the conversion aspects.

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


Re: Ant on z/OS

Posted by RobinFernandes <ro...@soal.org>.
Sorry to revive an old thread. I'm seeing the same problem as described
below: <property environment="env" /> is failing on z/OS when specifying a
non-EBCDIC encoding in -Dfile.encoding. Verbose output is:
...
 [property] Loading Environment env.
 [property] Ignoring:
 [property] <lots of garbage characters here...>
...

I'm using Ant 1.7.1 on IBM JDK 6 (IBM z/OS build pmz3160sr3-20081108_01
(SR3)).


I think I've tracked the issue down to this code in
org/apache/tools/ant/taskdefs/Execute.java, which forces the raw output of
the env var command to be treated as Cp1047 bytes, regardless of
-Dfile.encoding (this code is present in 1.7.1 and trunk):
[...]
    public static String toString(ByteArrayOutputStream bos) {
        if (Os.isFamily("z/os")) {
            try {
                return bos.toString("Cp1047");
            } catch (java.io.UnsupportedEncodingException e) {
                //noop default encoding used
            }
        }
[...]

If I remove this behaviour and simply return bos.toString(), <property
environment="env" /> loads correctly irrespective of whether -Dfile.encoding
is set to a non-ebcdic encoding.

Just a guess: perhaps that code was a work-around for older JDKs where
file.encoding didn't affect env, and should now be removed? 

Regards,
Robin


Anuradha Weeraman wrote:
> 
> Hi All,
> 
> I'm having what appears to be some character set related issues when
> running Ant on z/OS under USS. I have tracked down the issue to the
> <property environment> tag which doesn't seem to be able to pick up
> environment variables and spews ASCII text when the following
> IBM_JAVA_OPTIONS variable is defined:
> 
> -Dfile.encoding=ISO8859-1 -Dconsole.encoding=IBM-1047 -Xnoargsconversion
> 
> The ASCII text, when converted to EBCDIC appears to be environment
> variables, so I'm guessing that Ant internally expects the environment
> variables in EBCDIC (possibly from the output of /bin/env) which
> somehow gets converted to ISO8859-1 due to the file.encoding
> parameter, leading to its confusion.
> 
> Ant 1.5.3-1 is bundled with the version of Maven that I use, and it
> requires the IBM_JAVA_OPTIONS to be set.
> 
> Has anyone experienced this before? Does anyone know if Ant is capable
> of handling custom file.encoding as in this case?
> 
> Regards,
> Anuradha
> 
> 

-- 
View this message in context: http://www.nabble.com/Ant-on-z-OS-tp5429644p22832757.html
Sent from the Ant - Users mailing list archive at Nabble.com.


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


Re: Ant on z/OS

Posted by Anuradha Weeraman <aw...@gmail.com>.
On 7/22/06, jmaxwell <je...@gmail.com> wrote:
> I do not send any options to the JVM.
> All my build scripts and properties files are in EBCDIC.

Thanks for the info. I have tested Ant 1.5.3-1, 1.5.4 and 1.6.2
without any options as you have suggested and it works fine too. Its
only when the IBM_JAVA_OPTIONS is passed with custom encoding that it
seems to get confused. Unfortunately, IBM_JAVA_OPTIONS is needed by
maven and as a result I'm stuck with it :(

Regards,
Anuradha

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


Re: Ant on z/OS

Posted by jmaxwell <je...@gmail.com>.
I have not had a problem running Ant 1.6.5 on Z/OS 1.4 with JDK 1.4.2.
I also use the <property environment> without issue.

There is an issue with <echoproperties>.
It outputs fine to a file, but sends junk when sent to the screen.

I do not send any options to the JVM.
All my build scripts and properties files are in EBCDIC.

My build scripts use the following xml prolog:
<?xml version="1.0" encoding="Cp1047"?>

Your specific encoding might be different.

I have the Ant Tasks For Maven 2 working fine 
but some of the distributions xml files needed translation.

Cheers,

Jeff


Anuradha Weeraman wrote:
> 
> Hi All,
> 
> I'm having what appears to be some character set related issues when
> running Ant on z/OS under USS. I have tracked down the issue to the
> <property environment> tag which doesn't seem to be able to pick up
> environment variables and spews ASCII text when the following
> IBM_JAVA_OPTIONS variable is defined:
> 
> -Dfile.encoding=ISO8859-1 -Dconsole.encoding=IBM-1047 -Xnoargsconversion
> 
> The ASCII text, when converted to EBCDIC appears to be environment
> variables, so I'm guessing that Ant internally expects the environment
> variables in EBCDIC (possibly from the output of /bin/env) which
> somehow gets converted to ISO8859-1 due to the file.encoding
> parameter, leading to its confusion.
> 
> Ant 1.5.3-1 is bundled with the version of Maven that I use, and it
> requires the IBM_JAVA_OPTIONS to be set.
> 
> Has anyone experienced this before? Does anyone know if Ant is capable
> of handling custom file.encoding as in this case?
> 
> Regards,
> Anuradha
> 
> PS. Apologies for cross posting, thought maybe the devs can shed some
> light on the conversion aspects.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Ant-on-z-OS-tf1978859.html#a5439836
Sent from the Ant - Users forum at Nabble.com.


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