You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Vladislav Levitskiy <vl...@gmail.com> on 2012/05/26 20:24:58 UTC

Errors in FTP for java 7.4.

I have installed Java JDK 7.4. (jdk-7u4-windows-x64.exe).

I try to make small java program that will get file from local ftp server
on my computer.
But I get error.

In previous version of java it worked.

Is it problem of Java version ???

Reply that I have

c:\11\FTP5>test4

c:\11\FTP5>java -cp .;.\commons-net-3.1.jar;c:\11\
ftp5\commons-io-2.3.jar FtpTest 10.0.8.21 ftpftst
test
Connected to 10.0.8.21.
220 hp22.limousin.fr.grpleg.com FTP server (Version 1.1.214.4(PHNE_33412)
Mon Sep 19 18:45:21 GMT 20
05) ready.
230 User ftpftst logged in.  Access restrictions apply.
230 User ftpftst logged in.  Access restrictions apply.
200 Type set to I.
200 NOOP command successful.
250 CWD command successful.
/
java.net.SocketException: Permission denied: recv failed
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(Unknown Source)
        at java.net.SocketInputStream.read(Unknown Source)
        at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
        at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
        at sun.nio.cs.StreamDecoder.read(Unknown Source)
        at java.io.InputStreamReader.read(Unknown Source)
        at java.io.BufferedReader.fill(Unknown Source)
        at java.io.BufferedReader.read(Unknown Source)
        at
org.apache.commons.net.io.CRLFLineReader.readLine(CRLFLineReader.java:58)
        at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:310)
        at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:290)
        at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:479)
        at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:552)
        at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:601)
        at org.apache.commons.net.ftp.FTP.pasv(FTP.java:952)
        at
org.apache.commons.net.ftp.FTPClient._openDataConnection_(FTPClient.java:755)
        at
org.apache.commons.net.ftp.FTPClient._openDataConnection_(FTPClient.java:657)
        at
org.apache.commons.net.ftp.FTPClient.listNames(FTPClient.java:2633)
        at
org.apache.commons.net.ftp.FTPClient.listNames(FTPClient.java:2682)
        at FtpTest.main(FtpTest.java:63)
In attached files:
  FtpTest.java -- Java file
  FtpTest.class -- Java compiled file.

  test4.bat -- as I run it on my computer (i have added one t letter
because google restrict to send bat files).

Re: Errors in FTP for java 7.4.

Posted by Vladislav Levitskiy <vl...@gmail.com>.
Yes it is look very close to my problem.

But I setup passive mode at the begining of my program.

And after this I execute some commands. And get OK from the FTP server.
And as we see this problem was raised more than half year ago...

Some time ago I begun fogetting how deeply I should hate MS....
But now I will start to hate MS with new strength.

Re: Errors in FTP for java 7.4.

Posted by Vladislav Levitskiy <vl...@gmail.com>.
It helps!!!

I turned off Windows ftp filter as described here
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7077696



 Submitted On 10-MAR-2012
* ffvic *

To disable stateful FTP filtering so that Windows Firewall will not
block FTP traffic, type the following syntax then hit enter:

netsh advfirewall set global StatefulFtp disable


And program begun to work.

Re: Errors in FTP for java 7.4.

Posted by sebb <se...@gmail.com>.
On 26 May 2012 19:31, Vladislav Levitskiy <vl...@gmail.com> wrote:
> As You see -- system log me ok (so IP address is not filteret), but I can't
> make any
> ftp operations: file list, read file and etc.
>
>
> Also I use standard FTP client and all operations are ok.

Could be due to Windows firewall, see:

http://stackoverflow.com/questions/6990663/java-7-prevents-ftp-transfers-on-windows-vista-and-7-if-firewall-is-on-any-idea

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


Re: Errors in FTP for java 7.4.

Posted by Vladislav Levitskiy <vl...@gmail.com>.
As You see -- system log me ok (so IP address is not filteret), but I can't
make any
ftp operations: file list, read file and etc.


Also I use standard FTP client and all operations are ok.

Re: Errors in FTP for java 7.4.

Posted by romsok <ro...@gmail.com>.
Sounds like a credentials problem. Did you verify IP restrictions, 
login, pwd?

On 5/26/2012 11:24 AM, Vladislav Levitskiy wrote:
> I have installed Java JDK 7.4. (jdk-7u4-windows-x64.exe).
>
> I try to make small java program that will get file from local ftp 
> server on my computer.
> But I get error.
>
> In previous version of java it worked.
>
> Is it problem of Java version ???
>
> Reply that I have
>
> c:\11\FTP5>test4
>
> c:\11\FTP5>java -cp .;.\commons-net-3.1.jar;c:\11\
> ftp5\commons-io-2.3.jar FtpTest 10.0.8.21 ftpftst
> test
> Connected to 10.0.8.21.
> 220 hp22.limousin.fr.grpleg.com <http://hp22.limousin.fr.grpleg.com> 
> FTP server (Version 1.1.214.4(PHNE_33412) Mon Sep 19 18:45:21 GMT 20
> 05) ready.
> 230 User ftpftst logged in.  Access restrictions apply.
> 230 User ftpftst logged in.  Access restrictions apply.
> 200 Type set to I.
> 200 NOOP command successful.
> 250 CWD command successful.
> /
> java.net.SocketException: Permission denied: recv failed
>         at java.net.SocketInputStream.socketRead0(Native Method)
>         at java.net.SocketInputStream.read(Unknown Source)
>         at java.net.SocketInputStream.read(Unknown Source)
>         at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
>         at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
>         at sun.nio.cs.StreamDecoder.read(Unknown Source)
>         at java.io.InputStreamReader.read(Unknown Source)
>         at java.io.BufferedReader.fill(Unknown Source)
>         at java.io.BufferedReader.read(Unknown Source)
>         at 
> org.apache.commons.net.io.CRLFLineReader.readLine(CRLFLineReader.java:58)
>         at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:310)
>         at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:290)
>         at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:479)
>         at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:552)
>         at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:601)
>         at org.apache.commons.net.ftp.FTP.pasv(FTP.java:952)
>         at 
> org.apache.commons.net.ftp.FTPClient._openDataConnection_(FTPClient.java:755)
>         at 
> org.apache.commons.net.ftp.FTPClient._openDataConnection_(FTPClient.java:657)
>         at 
> org.apache.commons.net.ftp.FTPClient.listNames(FTPClient.java:2633)
>         at 
> org.apache.commons.net.ftp.FTPClient.listNames(FTPClient.java:2682)
>         at FtpTest.main(FtpTest.java:63)
> In attached files:
>   FtpTest.java -- Java file
>   FtpTest.class -- Java compiled file.
>
>   test4.bat -- as I run it on my computer (i have added one t letter 
> because google restrict to send bat files).
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org