Return-Path: X-Original-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 43E0211554 for ; Sun, 14 Sep 2014 19:14:34 +0000 (UTC) Received: (qmail 96391 invoked by uid 500); 14 Sep 2014 19:14:34 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 96352 invoked by uid 500); 14 Sep 2014 19:14:33 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 96340 invoked by uid 99); 14 Sep 2014 19:14:33 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 Sep 2014 19:14:33 +0000 Date: Sun, 14 Sep 2014 19:14:33 +0000 (UTC) From: "Allen Wittenauer (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-2565) hdfs command does not explicitely complain that the command I am trying to run is not valid MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HDFS-2565?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D14133= 353#comment-14133353 ]=20 Allen Wittenauer commented on HDFS-2565: ---------------------------------------- This breaks stuff. The big problem is that the patch assumes that every main method that one c= ould call in the java code is documented in the hdfs subcommand. This is d= efinitely incorrect. In fact, the code has in the usage section: {code} echo " or" echo " CLASSNAME run the class named CLASSNAME" {code} In other words, that catchall at the end is meant to be a class. Thus why = one throws a java error when one gives a broken subcommand. That said, what could be done here is that the code check for periods. If t= he catch-all doesn't contain a period, there is a 99% likelihood that it is= n't a class but a typo. =20 > hdfs command does not explicitely complain that the command I am trying t= o run is not valid > -------------------------------------------------------------------------= ------------------ > > Key: HDFS-2565 > URL: https://issues.apache.org/jira/browse/HDFS-2565 > Project: Hadoop HDFS > Issue Type: Bug > Components: scripts > Affects Versions: 0.23.0, 0.23.1 > Reporter: Bruno Mah=C3=A9 > Assignee: Chu Tong > Labels: bigtop, noob > Attachments: HDFS-2565.patch, HDFS-2565.patch > > > [root@bigtop-fedora-15 ~]# hdfs foobar > Exception in thread "main" java.lang.NoClassDefFoundError: foobar > Caused by: java.lang.ClassNotFoundException: foobar > at java.net.URLClassLoader$1.run(URLClassLoader.java:217) > at java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findClass(URLClassLoader.java:205) > at java.lang.ClassLoader.loadClass(ClassLoader.java:321) > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) > at java.lang.ClassLoader.loadClass(ClassLoader.java:266) > Could not find the main class: foobar. Program will exit. > Instead of loading any class, it would be nice to explain the command is = not valid and to call print_usage() -- This message was sent by Atlassian JIRA (v6.3.4#6332)