ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Burdairon <t.burdai...@gmail.com>
Subject Problems with telnet task during an ant migration
Date Thu, 15 Apr 2010 14:51:14 GMT
We are in a migration from ant 1.6.2 to 1.8.0 and are encountering troubles
using telnet task :


<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="testtelnet" default="compile" basedir=".">

<target name="telnet">
    <telnet userid="XXX" password="YYY" server="ZZZ">
       <read>></read>
       <write>ls</write>
       <read string="/home/bob"/>
    </telnet>
</target>
</project>

throws an OOM

Distant server is Sun OS 5.8 (Solaris 8)

This simple script is OK with 1.6.2, but not with 1.8.0 :

java.lang.OutOfMemoryError: Java heap space

     [java] 	at java.util.Arrays.copyOf(Arrays.java:2882)
     [java] 	at
java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
     [java] 	at
java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:572)


     [java] 	at java.lang.StringBuffer.append(StringBuffer.java:320)
     [java] 	at
org.apache.tools.ant.taskdefs.optional.net.TelnetTask$AntTelnetClient.waitForString(TelnetTask.java:347)
     [java] 	at
org.apache.tools.ant.taskdefs.optional.net.TelnetTask$AntTelnetClient.waitForString(TelnetTask.java:330)


     [java] 	at
org.apache.tools.ant.taskdefs.optional.net.TelnetTask.login(TelnetTask.java:140)
     [java] 	at
org.apache.tools.ant.taskdefs.optional.net.TelnetTask.execute(TelnetTask.java:109)



We replaced TelnetTask with the old one from 1.6.2 as a workaround.
After a quick look to the source, it seems that the change
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java?r1=677886&r2=677887&is
wrong, especially the replacement of a String.indexOf by a
String.substring


Greetings

Tom

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