ANT SSHEXEC failing with Algorithm negotitation fail error - ant

I am just trying to connect to a remote host using the ant sshexec task . I have the required jar in the ant lib directory and able to connect to the remote host using putty.
This is the way i am running the ssh
<sshexec host="host"
username="username"
password="password"
trust="yes"
command="ls"/>
There seems to be encryption algorith mismatch with the server. How can i specify the algorith as I don't see any attribute for this task [Ant doc][1]. This is the error log i am getting:
com.jcraft.jsch.JSchException: Algorithm negotiation fail
at com.jcraft.jsch.Session.receive_kexinit(Session.java:540)
at com.jcraft.jsch.Session.connect(Session.java:288)
at com.jcraft.jsch.Session.connect(Session.java:145)
at org.apache.tools.ant.taskdefs.optional.ssh.SSHBase.openSession(SSHBase.java:212)
at org.apache.tools.ant.taskdefs.optional.ssh.SSHExec.execute(SSHExec.java:158)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
at org.apache.tools.ant.Main.runBuild(Main.java:758)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

TL;DR edit your sshd_config and enable support for diffie-hellman-group-exchange-sha1 and diffie-hellman-group1-sha1 in KexAlgorithms:
KexAlgorithms curve25519-sha256#libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
KexAlgorithms curve25519-sha256#libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
I suspect that the problem appeared after the following change in OpenSSH 6.7: "The default set of ciphers and MACs has been altered to remove unsafe algorithms.". (see changelog). This version was released on Oct, 6, and made it on Oct, 21 to Debian testing (see Debian changelog).
OpenSSH enables only the following key exchange algorithms by default:
curve25519-sha256#libssh.org
ecdh-sha2-nistp256
ecdh-sha2-nistp384
ecdh-sha2-nistp521
diffie-hellman-group-exchange-sha256
diffie-hellman-group14-sha1
Whereas JSch claims to support these algorithms (see under "features") for key exchange:
diffie-hellman-group-exchange-sha1
diffie-hellman-group1-sha1
So indeed, they cannot agree on a common key exchange algorithm. Updating sshd_config (and restarting the SSH server) does the trick. Apparently JSch is supposed to support the "diffie-hellman-group-exchange-sha256" method since version 0.1.50 (see changelog).

I had the same error trying to connect to OS X 10.11.6 and could fix it by replacing ~/.ant/lib/jsch-0.1.51.jar with the latest ~/.ant/lib/jsch-0.1.54.jar.

Related

Connecting to a database outside the docker container gives TLS version error

I have a Spring Boot app where it connects to the database which is not inside the container. After I build the image and run I get following exception:
Caused by: javax.net.ssl.SSLHandshakeException: The server selected protocol version TLS10 is not accepted by client preferences [TLS13, TLS12]
at java.base/sun.security.ssl.Alert.createSSLException(Unknown Source) ~[na:na]
at java.base/sun.security.ssl.Alert.createSSLException(Unknown Source) ~[na:na]
at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source) ~[na:na]
at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source) ~[na:na]
at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source) ~[na:na]
at java.base/sun.security.ssl.ServerHello$ServerHelloConsumer.onServerHello(Unknown Source) ~[na:na]
at java.base/sun.security.ssl.ServerHello$ServerHelloConsumer.consume(Unknown Source) ~[na:na]
In my docker file I tired to updated the https.protocols to TLSv1.2 like below, but is not working as expected:
FROM adoptopenjdk/openjdk11:alpine-jre
ARG JAR_FILE=target/portal-0.0.1-SNAPSHOT.jar
WORKDIR /appPortal
COPY ${JAR_FILE} portal.jar
ENTRYPOINT ["java","-Dcom.ibm.jsse2.overrideDefaultTLS = true","-Djdk.tls.client.protocols =
TLSv1.2","-Dhttps.protocols = TLSv1.2","-jar","portal.jar"]
maybe I'm trying to set tls versions incorrectly, any advice on this?
I think the problem is that the server is using TLS 1.0 but your jvm is not supporting by default.
Note: You might encounter such issue if you're using openjdk 11.0.11 (since mid-Apr 2021) which has make TLS 1.0 disabled by default.
If you're having no way to setup the db server to support newer TLS version, you
may workaround the issue by overriding the default:
find properties file /security/java.security
find the line with "jdk.tls.disabledAlgorithms" property
take out TLSv1
you changed the TLS/SSL protocol in Entrypoint as option but protocol should support at OS(containers level).
If there is no attachment with the image, you can try official openjdk to give a test.
https://hub.docker.com/_/openjdk
Just thought of adding a straight forward answer here for future reference. I used the base image as "adoptopenjdk/openjdk11:alpine-jre" for the docker file and it seems the TLS version defaults to TLS10. So as suggested by #Vinod and some other thread different types of openjdk 11 I used openjdk:11.0.6-jre-slim which helped me to omit extra entrypoint options to set TLS versions.

SonarQube cannot blame file

During a code check with SonarQube, I am getting this sort of error
java.lang.IllegalStateException: Error when executing blame for file some/file/in/project/file.hpp
at org.sonar.plugins.scm.svn.SvnBlameCommand.blame(SvnBlameCommand.java:85)
at org.sonar.plugins.scm.svn.SvnBlameCommand.blame(SvnBlameCommand.java:58)
at org.sonar.scanner.scm.ScmPublisher.publish(ScmPublisher.java:85)
at org.sonar.scanner.phases.PublishPhaseExecutor.afterSensors(PublishPhaseExecutor.java:60)
at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:90)
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:180)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:288)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:283)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:261)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)
at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:84)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:121)
at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:111)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:233)
at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:123)
at org.sonarsource.scanner.cli.Main.execute(Main.java:77)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: org.tmatesoft.svn.core.SVNException: svn: E204899: Cannot delete file 'C:\Path\to\project\.svn\tmp\annotate.3.tmp\annotate.tmp'
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:70)
at org.tmatesoft.svn.core.internal.wc.SVNFileUtil.deleteFile(SVNFileUtil.java:1342)
at org.tmatesoft.svn.core.internal.wc.SVNFileUtil.deleteAll(SVNFileUtil.java:1314)
at org.tmatesoft.svn.core.internal.wc.SVNFileUtil.deleteAll(SVNFileUtil.java:1305)
at org.tmatesoft.svn.core.internal.wc2.remote.SvnRemoteAnnotate.run(SvnRemoteAnnotate.java:143)
at org.tmatesoft.svn.core.internal.wc2.remote.SvnRemoteAnnotate.run(SvnRemoteAnnotate.java:30)
at org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner.run(SvnOperationRunner.java:21)
at org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java:1235)
at org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:294)
at org.tmatesoft.svn.core.wc.SVNLogClient.doAnnotate(SVNLogClient.java:295)
at org.sonar.plugins.scm.svn.SvnBlameCommand.blame(SvnBlameCommand.java:83)
... 31 more
Some additional information
This project is checked out in a Jenkins job.
No other project checked the same way have this sort of error.
This project is a big project, so code checking takes several hours.
I can blame this file in the error message (some/file/in/project/file.hpp) without problems with TortoiseSVN.
I am using SonarQube 6.7.1 LTS
SonarQube Plugin for SVN has this version 1.6.0.860
svn --version gives me this output, so it seems up to date:
svn, version 1.9.7 (r1800392)
compiled Aug 8 2017, 22:14:48 on x86-microsoft-windows
Copyright (C) 2017 The Apache Software Foundation.
This software consists of contributions made by many people;
see the NOTICE file for more information.
Subversion is open source software, see http://subversion.apache.org/
The following repository access (RA) modules are available:
* ra_svn : Module for accessing a repository using the svn network protocol.
- with Cyrus SASL authentication
- handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
- handles 'file' scheme
* ra_serf : Module for accessing a repository via WebDAV protocol using serf.
- using serf 1.3.9 (compiled with 1.3.9)
- handles 'http' scheme
- handles 'https' scheme
The following authentication credential caches are available:
* Wincrypt cache in C:\Users\User\AppData\Roaming\Subversion
What I did
On the SonarQube Server, under Administration -> SCM, I added credentials.
Before doing a SonarQube check, I am now doing a svn upgrade. The same error came up when I was not doing a svn upgrade.
Does anyone have an idea, what I can do to solve this problem?
In jenkins, "Execute SonarQube scanner " plugin, can you give scm disabled parameter ?
-Dsonar.scm.disabled=True
if that does not work, in sonarqube you must disable the scm parameter.
From Project -> General Settings -> SCM -> Disable the SCM Sensor. You must disable soarqube to look for source code.

Error while compile code with Xseed tool in Jenkins

I have issue while compiling the code using Xseed tool. Tool runs fine for datadef generation but i get below error prompted on window. I have not done any change with tools configuration.
Problem signature:
Problem Event Name: APPCRASH
Application Name: XseedGenerate.exe
Application Version: 1.0.0.0
Application Timestamp: 546cadf6
Fault Module Name: XseedJAccessRoutine.DLL
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 51dc06cf
Exception Code: c0000005
Exception Offset: 000c2004
OS Version: 6.1.7601.2.1.0.256.48
Locale ID: 5129
Additional Information 1: 42aa
Additional Information 2: 42aaa4d06451b11724a68d4202e08a6f
Additional Information 3: 6550
Additional Information 4: 6550caa965b0941d4062d69a476a1a06
Read our privacy statement online: http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409
If the online privacy statement is not available, please read our privacy statement offline: C:\Windows\system32\en-US\erofflps.txt
I suspect build failure on jenkins is also because of this. I have different error message in log in Jenkins.
F:\Jenkins\jobs\Dev_754_FeatureConsolidation01_Clean01\workspace\src\Build\generate.xml:82: exec returned: 255
at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:551)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:401)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:809)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: F:\Jenkins\jobs\Dev_754_FeatureConsolidation01_Clean01\workspace\src\Build\generate.xml:130: The following error occurred while executing this line:
F:\Jenkins\jobs\Dev_754_FeatureConsolidation01_Clean01\workspace\src\Build\generate.xml:147: The following error occurred while executing this line:
F:\Jenkins\jobs\Dev_754_FeatureConsolidation01_Clean01\workspace\src\Build\generate.xml:82: exec returned: 255
at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:551)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:401)
at net.sf.antcontrib.logic.ForTask.doSequentialIteration(ForTask.java:259)
at net.sf.antcontrib.logic.ForTask.doToken(ForTask.java:268)
at net.sf.antcontrib.logic.ForTask.doTheTasks(ForTask.java:324)
Any one have any idea ?
Jenkins was not able to recognize the long name. I think there is limit set for the naming conventions for jobs on Jenkins. After all the hard work on Configuration etc. When i configured new job with shorter and meaningful name problem was resolved. Hope this helps someone.

UnsatisfiedLinkError & no such method (jogl, gluegen, jogamp)

I wrote a program using Processing(which uses jogl and gluegen), and am using PApplet to run it in a java application in NetBeans.
I am unable to run my program (by running the jar) outside the IDE - neither on my local windows 64-bit machine using command line, nor on a external linux server (which is where I would like to run the program) using X11 forwarding
I previously was able to run the program via command line on my windows machine, but ran into trouble after testing on the linux server. I think there may have been some issues with paths or something after I downloaded the linux versions of the same jars
This is the error I receive from the linux machine:
Exception in thread "Animation Thread" java.lang.UnsatisfiedLinkError: jogamp.common.jvm.JVMUtil.initialize(Ljava/nio/ByteBuffer;)Z
at jogamp.common.jvm.JVMUtil.initialize(Native Method)
at jogamp.common.jvm.JVMUtil.<clinit>(JVMUtil.java:58)
at com.jogamp.common.os.Platform$1.run(Platform.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at com.jogamp.common.os.Platform.<clinit>(Platform.java:179)
at javax.media.opengl.GLProfile.<clinit>(GLProfile.java:82)
at processing.opengl.PJOGL.initSurface(PJOGL.java:250)
at processing.opengl.PGraphicsOpenGL.initPrimary(PGraphicsOpenGL.java:6310)
at processing.opengl.PGraphicsOpenGL.requestDraw(PGraphicsOpenGL.java:1653)
at processing.core.PApplet.run(PApplet.java:2256)
at java.lang.Thread.run(Thread.java:724)
this is the error I get from trying to run the jar on my machine using command line:
java.lang.NoSuchMethodError: com.jogamp.common.nio.Buffers.slice2Float(Ljava/nio
/Buffer;[FII)Ljava/nio/FloatBuffer;
at jogamp.opengl.ProjectFloat.<init>(ProjectFloat.java:181)
at jogamp.opengl.ProjectFloat.<init>(ProjectFloat.java:167)
at jogamp.opengl.ProjectFloat.<init>(ProjectFloat.java:163)
at javax.media.opengl.glu.GLU.<init>(GLU.java:164)
at processing.opengl.PJOGL.<init>(PJOGL.java:218)
at processing.opengl.PGraphicsOpenGL.createPGL(PGraphicsOpenGL.java:1744
)
at processing.opengl.PGraphicsOpenGL.<init>(PGraphicsOpenGL.java:518)
at processing.opengl.PGraphics3D.<init>(PGraphics3D.java:37)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at processing.core.PApplet.makeGraphics(PApplet.java:1919)
at processing.core.PApplet.size(PApplet.java:1771)
at processing.core.PApplet.size(PApplet.java:1742)
at noblis.farag.MySketch.setup(MySketch.java:132)
at processing.core.PApplet.handleDraw(PApplet.java:2361)
at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:240)
at processing.core.PApplet.run(PApplet.java:2256)
at java.lang.Thread.run(Unknown Source)
Exception in thread "Animation Thread" java.lang.RuntimeException: com.jogamp.co
mmon.nio.Buffers.slice2Float(Ljava/nio/Buffer;[FII)Ljava/nio/FloatBuffer;
at processing.core.PApplet.makeGraphics(PApplet.java:1944)
at processing.core.PApplet.size(PApplet.java:1771)
at processing.core.PApplet.size(PApplet.java:1742)
at noblis.farag.MySketch.setup(MySketch.java:132)
at processing.core.PApplet.handleDraw(PApplet.java:2361)
at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:240)
at processing.core.PApplet.run(PApplet.java:2256)
at java.lang.Thread.run(Unknown Source)
Any idea about why I can run it in the IDE but not outside? or any way to package it so that it can run outside the IDE?
thanks

Ant FTP task fails: java.net.SocketException

I am trying to, with Ant, upload a zip-file via FTP to a Windows Server 2008 R2 FTP server (if it matters). I have a similar task to create the directory /Release, which works, yet somehow uploading via FTP gives me problems.
<ftp action="put"
userid="${adapter.ftp.username}"
password="${adapter.ftp.password}"
server="${ftp.hostname}"
retriesAllowed="5"
verbose="true"
systemTypeKey="WINDOWS"
remotedir="/Release" >
<fileset dir=".">
<include name="Adapter.zip"/>
</fileset>
</ftp>
The Ant debug log:
[ftp] Opening FTP connection to 192.168.2.120
[ftp] custom configuration
[ftp] custom config: system key = WINDOWS
[ftp] custom config: server language code =
[ftp] connected
[ftp] logging in to FTP server
[ftp] login succeeded
[ftp] changing the remote directory to /Release
[ftp] sending files
fileset: Setup scanner in dir C:\dir with patternSet{ includes: [adapter.zip] excludes: [] }
[ftp] transferring C:\dir\adapter.zip
[ftp] try #1: IO error (adapter.zip), retrying
/.../
[ftp] try #6: IO error (adapter.zip), number of maximum retries reached (5), giving up
[ftp] disconnecting
build.xml:165: error during FTP transfer: java.net.SocketException: Software caused connection abort: socket write error
at org.apache.tools.ant.taskdefs.optional.net.FTP.execute(FTP.java:2538)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:424)
at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:138)
Caused by: java.net.SocketException: Software caused connection abort: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(Unknown Source)
at java.net.SocketOutputStream.write(Unknown Source)
at sun.nio.cs.StreamEncoder.writeBytes(Unknown Source)
at sun.nio.cs.StreamEncoder.implFlushBuffer(Unknown Source)
at sun.nio.cs.StreamEncoder.implFlush(Unknown Source)
at sun.nio.cs.StreamEncoder.flush(Unknown Source)
at java.io.OutputStreamWriter.flush(Unknown Source)
at java.io.BufferedWriter.flush(Unknown Source)
at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:472)
at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:534)
at org.apache.commons.net.ftp.FTP.port(FTP.java:862)
at org.apache.commons.net.ftp.FTPClient._openDataConnection_(FTPClient.java:463)
at org.apache.commons.net.ftp.FTPClient.__storeFile(FTPClient.java:374)
at org.apache.commons.net.ftp.FTPClient.storeFile(FTPClient.java:1379)
at org.apache.tools.ant.taskdefs.optional.net.FTP.sendFile(FTP.java:2149)
at org.apache.tools.ant.taskdefs.optional.net.FTP$2.execute(FTP.java:1792)
at org.apache.tools.ant.util.RetryHandler.execute(RetryHandler.java:57)
at org.apache.tools.ant.taskdefs.optional.net.FTP.executeRetryable(FTP.java:1709)
at org.apache.tools.ant.taskdefs.optional.net.FTP.transferFiles(FTP.java:1788)
at org.apache.tools.ant.taskdefs.optional.net.FTP.transferFiles(FTP.java:1845)
at org.apache.tools.ant.taskdefs.optional.net.FTP.execute(FTP.java:2534)
... 15 more
What am I doing wrong?
Turning off the Windows firewall resolved the issue.
One thing worth trying is passive ftp. The Ant ftp task has a passive attribute for this:
selects passive-mode ("yes") transfers, for better through-firewall
connectivity, at the price of performance. Defaults to "no"
There's a write up of the difference between active and passive mode here. The key point is that for ftp commands (including mkdir and the chdir that works in the OP question) a single open port - usually port 21 - is used. But for data transfers a different, possibly firewall-blocked port is used. Firewall-related problems with ftp can sometimes show the symptoms mentioned above.

Resources