Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 71096 invoked from network); 15 Mar 2011 19:52:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 Mar 2011 19:52:57 -0000 Received: (qmail 10957 invoked by uid 500); 15 Mar 2011 19:52:56 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 10892 invoked by uid 500); 15 Mar 2011 19:52:56 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 10884 invoked by uid 99); 15 Mar 2011 19:52:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Mar 2011 19:52:56 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_FRT_STOCK2,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Mar 2011 19:52:52 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id B890C3AB914 for ; Tue, 15 Mar 2011 19:52:29 +0000 (UTC) Date: Tue, 15 Mar 2011 19:52:29 +0000 (UTC) From: "Bas (JIRA)" To: issues@commons.apache.org Message-ID: <1022039226.4665.1300218749752.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <68719579.2090.1300137629573.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] Updated: (NET-373) NNTP Listgroups not working as expected with payserver envronment MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/NET-373?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bas updated NET-373: -------------------- Attachment: listing.txt Output of renewed Bar.java program. This gives e all the groups which I also receive when I telnet to the server > NNTP Listgroups not working as expected with payserver envronment > ----------------------------------------------------------------- > > Key: NET-373 > URL: https://issues.apache.org/jira/browse/NET-373 > Project: Commons Net > Issue Type: Bug > Components: NNTP > Affects Versions: 3.0 > Environment: Eclipse Build id: 20110218-0911 > Reporter: Bas > Labels: ioexception, java, listnewsgroups, nntp, nntpclient > Attachments: Bar.java, listing.txt > > > In addition to NET-276 I tried to get all newsgroups from my server with the example script. Unfortunately I got with underneath code the following error: > As can be imagined this is a pay server so it has more than 31 groups. Unfortunately I have no idea how to get those printed underneath, probably also a bug! > {noformat:title=Output| borderStyle=dashed| borderColor=#ccc| titleBGColor=#F7D6C1| bgColor=#FFFFCE} > 201 reader.xsnews.nl (frontend-F04-05) Server Ready - support@xsnews.nl > AUTHINFO USER ******* > 381 PASS required > AUTHINFO PASS ********* > 281 Ok > Authentication succeeded > LIST ACTIVE alt.fan.* > 215 Newsgroups in form "group high low flags". > 000000000000000 000000000000000 y > ! 000000000000023 000000000000001 y > !!! 000000000000001 000000000000001 y > !vaux23 000000000000001 000000000000001 y > " 000000000000001 000000000000001 y > "0.test 000000000000001 000000000000001 y > ": 000000000000001 000000000000001 y > "Phyllis 000000000000001 000000000000001 y > "alt.binaries.boneless 000000000001053 000000000001002 y > "alt.binaries.multimedia 000000000002422 000000000000004 y > "alt.binaries.multimedia.erotica 000000000000001 000000000000001 y > "alt.binaries.multimedia.erotica.lesbians 000000000000002 000000000000001 y > "alt.binaries.multimedia.scifi; 000000000000001 000000000000001 y > "alt.binaries.sounds.mp3.lounge 000000000000001 000000000000001 y > "alt.binaries.sounds.mp3.reggae 000000000000001 000000000000001 y > "alt.binaries.tv.canadian 000000000000002 000000000000001 y > "alt.internet 000000000000001 000000000000001 y > "alt.politics 000000000000002 000000000000001 y > "alt.religion.christian.east 000000000000001 000000000000001 y > "webstump+urcm-noack@chiark.greenend.org.uk" 000000000000001 000000000000001 y > #alt.binaries.department.pron 000000022885781 000000000000001 y > ( 000000000000007 000000000000005 y > (analog-island@t-online.de 000000000000001 000000000000001 y > (cross 000000000000001 000000000000001 y > * 000000000000006 000000000000006 y > *.binaries.* 000000000000001 000000000000001 y > +a.uninarch 000000000000353 000000000000353 y > - 000000000000002 000000000000002 y > -- 000000000000005 000000000000001 y > ------------------ 000000000000004 000000000000002 y > -adams 000000000000001 000000000000001 y > 31 > LIST ACTIVE alt.fan.* > 00000000000000 000000000000000 y > java.io.IOException: 00000000000000 000000000000000 y > at org.apache.commons.net.nntp.NNTPClient.iterateNewsgroupListing(NNTPClient.java:1043) > at org.apache.commons.net.nntp.NNTPClient.iterateNewsgroups(NNTPClient.java:1059) > at ListNewsgroups_1.main(ListNewsgroups_1.java:89) > at Testing_NNTP.main(Testing_NNTP.java:25){panel} > {noformat} > Code: > {code:title=Bar.java|borderStyle=solid} > // Some comments here > /* > * Licensed to the Apache Software Foundation (ASF) under one or more > * contributor license agreements. See the NOTICE file distributed with > * this work for additional information regarding copyright ownership. > * The ASF licenses this file to You under the Apache License, Version 2.0 > * (the "License"); you may not use this file except in compliance with > * the License. You may obtain a copy of the License at > * > * http://www.apache.org/licenses/LICENSE-2.0 > * > * Unless required by applicable law or agreed to in writing, software > * distributed under the License is distributed on an "AS IS" BASIS, > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. > */ > //package examples.nntp; > import java.io.IOException; > import java.io.PrintWriter; > import org.apache.commons.net.PrintCommandListener; > import org.apache.commons.net.nntp.NNTPClient; > import org.apache.commons.net.nntp.NewsgroupInfo; > import javax.net.ssl.SSLSocketFactory; > /*** > * This is a trivial example using the NNTP package to approximate the > * Unix newsgroups command. It merely connects to the specified news > * server and issues fetches the list of newsgroups stored by the server. > * On servers that store a lot of newsgroups, this command can take a very > * long time (listing upwards of 30,000 groups). > *

> ***/ > public final class ListNewsgroups_1 > { > public final static void main(String[] args) > { > if (args.length < 1) > { > System.err.println("Usage: newsgroups newsserver [pattern]"); > return; > } > NNTPClient client = new NNTPClient(); > client.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out))); > //String pattern = args.length >= 2 ? args[1] : ""; > //String pattern = ""; > String pattern = "alt.fan.*"; > try > { > > if (args[4] == "SSL") > { > client.setSocketFactory(SSLSocketFactory.getDefault()); > } > else > { > //factory = createSocket(host, port); > } > client.connect(args[0],Integer.parseInt(args[3])); > // AUTHINFO USER/AUTHINFO PASS > boolean success = client.authenticate(args[1], args[2]); > if (success) { > System.out.println("Authentication succeeded"); > } else { > System.out.println("Authentication failed, error =" + client.getReplyString()); > } > int j = 0; > try { > for(String s : client.iterateNewsgroupListing(pattern)) { > j++; > System.out.println(s); > } > } catch (IOException e1) { > e1.printStackTrace(); > } > System.out.println(j); > j = 0; > for(NewsgroupInfo n : client.iterateNewsgroups(pattern)) { > j++; > System.out.println(n.getNewsgroup()); > } > System.out.println(j); > } > catch (IOException e) > { > e.printStackTrace(); > } > finally > { > try > { > if (client.isConnected()) > client.disconnect(); > } > catch (IOException e) > { > System.err.println("Error disconnecting from server."); > e.printStackTrace(); > System.exit(1); > } > } > } > } > {code} > If I missed something let me know and I will try to supply you with necessary data -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira