You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2011/02/26 03:53:22 UTC
[jira] Resolved: (NET-347) FTPClient.listFiles throw exception when
connect to an IPv6 FTP server
[ https://issues.apache.org/jira/browse/NET-347?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sebb resolved NET-347.
----------------------
Resolution: Invalid
Appears to be invalid.
If the suggested fix does not work, please re-open with new details.
> FTPClient.listFiles throw exception when connect to an IPv6 FTP server
> ----------------------------------------------------------------------
>
> Key: NET-347
> URL: https://issues.apache.org/jira/browse/NET-347
> Project: Commons Net
> Issue Type: Test
> Components: FTP
> Environment: jdk 1.6, commons-net-2.2.jar
> Reporter: jones wen
>
> If i setup the IPv6 FTP server on localhost, it is OK.
> If the IPv6 FTP server is on saloris 10(external host), FTPClient.listFiles() will throw below exception,
> java.net.BindException: Cannot assign requested address: JVM_Bind
> at java.net.PlainSocketImpl.socketBind(Native Method)
> at java.net.PlainSocketImpl.bind(Unknown Source)
> at java.net.ServerSocket.bind(Unknown Source)
> at java.net.ServerSocket.<init>(Unknown Source)
> at javax.net.DefaultServerSocketFactory.createServerSocket(Unknown Source)
> at org.apache.commons.net.ftp.FTPClient._openDataConnection_(FTPClient.java:515)
> at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2545)
> at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2519)
> at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2276)
> at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2322)
> at FtpTest.main(FtpTest.java:29)
> the test code is,
> FTPClient client = new FTPClient();
> try {
> client.connect(Inet6Address.getByName("2010::214:4fff:fe4d:2c4b"), 21);
> client.login("abc", "abc");
> client.enterLocalActiveMode();
> client.setActiveExternalIPAddress("2010::214:4fff:fe4d:2c4b");
>
> FTPFile[] list = client.listFiles();
> if(list != null && list.length > 0) {
> for(int i=0; i<list.length; i++) {
> System.out.println(list[i].getName());
> }
> }
> } catch (SocketException e) {
> e.printStackTrace();
> } catch (UnknownHostException e) {
> e.printStackTrace();
> } catch (IOException e) {
> e.printStackTrace();
> }
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira