Product: Aqua Data Studio
Version: 12.0.5
Build #: 30032
Build Date: 2012-Nov-03 03:47:16 PM
I used the below command to copy from remote host and got Null Pointer Exception
I specified custom identity file which works fine with the ssh -i commandSecure Copy
tmp directory does not exist
scp -i ~/.ssh/id_rsa username@ip:/home/aquaclusters/* /tmp/todirectory
java.lang.NullPointerException
at org.apache.tools.ant.taskdefs.optional.ssh.Scp.execute(Scp.java:245)
at \\...\\ .\\हिñçêČάй語简�?한\\.Yꀂᚼꃲ⣽.a(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.iꃡꍱ⢨ᝎ 6.a(Unknown Source)
at com.aquafold.datastudio.tools.shell.bꊎ⠰ꆦ⣫ enum protected.execute(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.rꐄ̥ꐽꁟ.run(Unknown Source)
at com.aquafold.datastudio.tools.shell.Xꍳᚦꌔꀐ.cF(Unknown Source)
at com.aquafold.datastudio.tools.shell.vꇄꇖ⣖⡺.execute(Unknown Source)
at com.aquafold.datastudio.tools.shell.Mꆽ⠸ꋧᡂ 1 public.a(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.Yꇣꎟꉮꀪ while.a(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.Cꉗꄵꐧꌬ case.a(Unknown Source)
at \\...\\ .\\हिñçêČάй語简�?한\\.wꃥꏠᡷꋯ long.a(Unknown Source)
at com.aquafold.datastudio.tools.shell.Dꑋ⢎ꃋꈢ.cF(Unknown Source)
at com.aquafold.datastudio.tools.shell.vꇄꇖ⣖⡺.execute(Unknown Source)
at com.aquafold.datastudio.tools.shell.tꅐᡶᛢꆨ switch.loop(Unknown Source)
at com.aquafold.datastudio.tools.shell.CLILoopThread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at org.apache.tools.ant.taskdefs.optional.ssh.ScpFromMessage.parseAndCreateDirectory(ScpFromMessage.java:200)
at org.apache.tools.ant.taskdefs.optional.ssh.ScpFromMessage.startRemoteCpProtocol(ScpFromMessage.java:180)
at org.apache.tools.ant.taskdefs.optional.ssh.ScpFromMessage.execute(ScpFromMessage.java:143)
at org.apache.tools.ant.taskdefs.optional.ssh.Scp.download(Scp.java:276)
at org.apache.tools.ant.taskdefs.optional.ssh.Scp.execute(Scp.java:221)
... 14 more
\scp is built upon Apache Ant library, the NPE is generated from Ant library. See stack trace below for details.
I did some tests, Ant scp behaves differently when copying directory from remote to local; depends on whether the specified local directory exists or not. If the local directory does not exist, Ant sometimes creates it as a file, sometimes generates a NPE as your test case did.
I added some check so that when copy remote file(s) to local, if any of the specified remote file is a directory pattern (i.e. ends with /*), then the local file needs to be a directory and should be created beforehand. SVN trunk/r30040.
<2012-11-05 16:59:24,875> ERROR [AWT-EventQueue-0] <com.aquafold.datastudio.tools.shell.FluidEditor>
java.lang.NullPointerException
at org.apache.tools.ant.taskdefs.optional.ssh.Scp.execute(Scp.java:245)
at com.aquafold.aquacore.open.net.CoreAntScp.scpFrom(CoreAntScp.java:43)
at com.aquafold.datastudio.tools.shell.cmd.ScpCommand.execute(ScpCommand.java:259)
at com.aquafold.datastudio.tools.shell.ShellCommand.execute(ShellCommand.java:572)
at com.aquafold.datastudio.tools.shell.bash.shell.CommandRunner.run(CommandRunner.java:50)
at com.aquafold.datastudio.tools.shell.CommandContext.executeCommand(CommandContext.java:16)
at com.aquafold.datastudio.tools.shell.AbstractCommandContext.execute(AbstractCommandContext.java:158)
at com.aquafold.datastudio.tools.shell.BashShellImplementation.invoke(BashShellImplementation.java:69)
at com.aquafold.datastudio.tools.shell.bash.BashInterpreter.executeCommand(BashInterpreter.java:231)
at com.aquafold.datastudio.tools.shell.bash.BashContext.execute(BashContext.java:1192)
at com.aquafold.datastudio.tools.shell.bash.execution.SimpleCmdExecutionNode.execute(SimpleCmdExecutionNode.java:82)
at com.aquafold.datastudio.tools.shell.CommandLineInterpreter$24.executeCommand(CommandLineInterpreter.java:1798)
at com.aquafold.datastudio.tools.shell.AbstractCommandContext.execute(AbstractCommandContext.java:158)
at com.aquafold.datastudio.tools.shell.CommandLineInterpreter.loop(CommandLineInterpreter.java:1536)
at com.aquafold.datastudio.tools.shell.CLILoopThread.run(CLILoopThread.java:21)
Caused by: java.lang.NullPointerException
at org.apache.tools.ant.taskdefs.optional.ssh.ScpFromMessage.parseAndFetchFile(ScpFromMessage.java:221)
at org.apache.tools.ant.taskdefs.optional.ssh.ScpFromMessage.startRemoteCpProtocol(ScpFromMessage.java:178)
at org.apache.tools.ant.taskdefs.optional.ssh.ScpFromMessage.execute(ScpFromMessage.java:143)
at org.apache.tools.ant.taskdefs.optional.ssh.Scp.download(Scp.java:276)
at org.apache.tools.ant.taskdefs.optional.ssh.Scp.execute(Scp.java:221)
Issue #7921 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build trunk/30040 |
No time estimate |
\scp is built upon Apache Ant library, the NPE is generated from Ant library. See stack trace below for details.
I did some tests, Ant scp behaves differently when copying directory from remote to local; depends on whether the specified local directory exists or not. If the local directory does not exist, Ant sometimes creates it as a file, sometimes generates a NPE as your test case did.
I added some check so that when copy remote file(s) to local, if any of the specified remote file is a directory pattern (i.e. ends with /*), then the local file needs to be a directory and should be created beforehand. SVN trunk/r30040.
<2012-11-05 16:59:24,875> ERROR [AWT-EventQueue-0] <com.aquafold.datastudio.tools.shell.FluidEditor>
java.lang.NullPointerException
at org.apache.tools.ant.taskdefs.optional.ssh.Scp.execute(Scp.java:245)
at com.aquafold.aquacore.open.net.CoreAntScp.scpFrom(CoreAntScp.java:43)
at com.aquafold.datastudio.tools.shell.cmd.ScpCommand.execute(ScpCommand.java:259)
at com.aquafold.datastudio.tools.shell.ShellCommand.execute(ShellCommand.java:572)
at com.aquafold.datastudio.tools.shell.bash.shell.CommandRunner.run(CommandRunner.java:50)
at com.aquafold.datastudio.tools.shell.CommandContext.executeCommand(CommandContext.java:16)
at com.aquafold.datastudio.tools.shell.AbstractCommandContext.execute(AbstractCommandContext.java:158)
at com.aquafold.datastudio.tools.shell.BashShellImplementation.invoke(BashShellImplementation.java:69)
at com.aquafold.datastudio.tools.shell.bash.BashInterpreter.executeCommand(BashInterpreter.java:231)
at com.aquafold.datastudio.tools.shell.bash.BashContext.execute(BashContext.java:1192)
at com.aquafold.datastudio.tools.shell.bash.execution.SimpleCmdExecutionNode.execute(SimpleCmdExecutionNode.java:82)
at com.aquafold.datastudio.tools.shell.CommandLineInterpreter$24.executeCommand(CommandLineInterpreter.java:1798)
at com.aquafold.datastudio.tools.shell.AbstractCommandContext.execute(AbstractCommandContext.java:158)
at com.aquafold.datastudio.tools.shell.CommandLineInterpreter.loop(CommandLineInterpreter.java:1536)
at com.aquafold.datastudio.tools.shell.CLILoopThread.run(CLILoopThread.java:21)
Caused by: java.lang.NullPointerException
at org.apache.tools.ant.taskdefs.optional.ssh.ScpFromMessage.parseAndFetchFile(ScpFromMessage.java:221)
at org.apache.tools.ant.taskdefs.optional.ssh.ScpFromMessage.startRemoteCpProtocol(ScpFromMessage.java:178)
at org.apache.tools.ant.taskdefs.optional.ssh.ScpFromMessage.execute(ScpFromMessage.java:143)
at org.apache.tools.ant.taskdefs.optional.ssh.Scp.download(Scp.java:276)
at org.apache.tools.ant.taskdefs.optional.ssh.Scp.execute(Scp.java:221)