Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 77702 invoked from network); 30 May 2005 13:58:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 30 May 2005 13:58:25 -0000 Received: (qmail 97821 invoked by uid 500); 30 May 2005 13:58:18 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 97806 invoked by uid 500); 30 May 2005 13:58:18 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 97784 invoked by uid 99); 30 May 2005 13:58:18 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from firewall.porta.de (HELO application.porta.de) (62.153.151.106) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 30 May 2005 06:58:16 -0700 Received: from localhost (localhost [127.0.0.1]) by localhost (Postfix) with ESMTP id 9F537167653 for ; Mon, 30 May 2005 15:58:07 +0200 (CEST) Received: from application.porta.de ([127.0.0.1]) by localhost (application.porta.de [127.0.0.1]) (amavisd-new, port 10027) with LMTP id 04925-03-10 for ; Mon, 30 May 2005 15:57:56 +0200 (CEST) Received: from [172.16.228.142] (unknown [172.16.228.142]) by application.porta.de (Postfix) with ESMTP id 2C7F216762D for ; Mon, 30 May 2005 15:57:56 +0200 (CEST) From: Mihael Knezevic Reply-To: m.knezevic@porta.de Organization: Porta IT-Service To: "Jakarta Commons Users List" Subject: Re: [net] Date: Mon, 30 May 2005 15:57:07 +0200 User-Agent: KMail/1.7.2 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200505301557.08196.m.knezevic@porta.de> X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N hi, first of all: you should put something into the=20 =46TPClient connection =3D null; =20 try { int reply; connection =3D new FTPClient(); connection.connect("remotehost"); //put in your server // After connection attempt, you should=20 // check the reply code to verify success. reply =3D connection.getReplyCode(); if(!FTPReply.isPositiveCompletion(reply)) { connection.disconnect(); throw new IOException("Could not connect to Server: " +=20 connection.getReplyString()); } boolean success =3D connection.login("username", "password"); if (!success)=20 { // Error while trying to login // some reporting } else { // we are logged in } =2E =2E =2E =2E that is not exactly the code i'm using but it should point you in the right= =20 direction. first i would try to get the replycode. if it is an error than=20 check the reply string (FTPClient.getReplyString() method). mk Am Montag, 30. Mai 2005 16:51 schrieb Amihai Fuks: > Hi, >=20 > We are using commons-net-1.2.2.jar (happens also with 1.4.0). While runni= ng=20 the following code: > try > { > connection.connect(); > } > catch(FTPServiceException e) > { > e.printStackTrace(); > } > finally > { > try > { > connection.disconnect(); > } > catch(FTPServiceException e) > { > e.printStackTrace(); > } > } >=20 > We experience this error: >=20 > FTP server connection/login error > Exception in thread "Thread-6" java.lang.NullPointerException > =A0=A0=A0=A0=A0 at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:40= 4) > =A0=A0=A0=A0=A0 at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:43= 8) > =A0=A0=A0=A0=A0 at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:48= 7) > =A0=A0=A0=A0=A0 at org.apache.commons.net.ftp.FTP.quit(FTP.java:699) > =A0=A0=A0=A0=A0 at org.apache.commons.net.ftp.FTPClient.logout(FTPClient.= java:678) > =A0=A0=A0=A0=A0=20 > Does anyone have an idea what the problem might be? >=20 > Thanks >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org >=20 >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org