Return-Path: X-Original-To: apmail-hadoop-hdfs-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3B54418BCF for ; Thu, 8 Oct 2015 17:00:00 +0000 (UTC) Received: (qmail 5352 invoked by uid 500); 8 Oct 2015 16:59:33 -0000 Delivered-To: apmail-hadoop-hdfs-user-archive@hadoop.apache.org Received: (qmail 5213 invoked by uid 500); 8 Oct 2015 16:59:33 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hadoop.apache.org Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 5202 invoked by uid 99); 8 Oct 2015 16:59:33 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Oct 2015 16:59:33 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id CC9F21A252D for ; Thu, 8 Oct 2015 16:59:32 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.879 X-Spam-Level: ** X-Spam-Status: No, score=2.879 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id nmj_9ywBYQ0P for ; Thu, 8 Oct 2015 16:59:31 +0000 (UTC) Received: from mail-yk0-f179.google.com (mail-yk0-f179.google.com [209.85.160.179]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 4359722F1F for ; Thu, 8 Oct 2015 16:59:31 +0000 (UTC) Received: by ykba192 with SMTP id a192so50749907ykb.3 for ; Thu, 08 Oct 2015 09:59:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=mm6n8iXpR8/prZz6bOG9cZz5nEnWiOUKQL4bqQB9zNc=; b=lLFe3DSmcsPXDcrm1h/igOvRnybqH8DUTuAL09rwT2ghz/0VSUn850sd85Sznymmm9 LaRjC+ceZOBlvtYABlFTCyNb0HJ4BDUoduUkdoOGt5Zv/aaj6Dq1PWKfo/SjhOie2FDz iksq44404k6xORFp0qncamTyE4ZWKt8Z8SlgcVLcDV8DAIexTz8ON9r6ohyC1nt0k//U qdeguSzL2BL/3B3SmVnggNfAAcJzQ/nVftMtky5uFrAyZmcl6OJ18hPrlpWgmNiuqHiS 6OPUEaXl+tG4aR6+HQAvGq7OzkabpQWVo49s72fGrYfddcZS/7Ykm5/1px0kyaGdi07T G4zQ== MIME-Version: 1.0 X-Received: by 10.13.206.7 with SMTP id q7mr6660432ywd.47.1444323564393; Thu, 08 Oct 2015 09:59:24 -0700 (PDT) Received: by 10.37.210.197 with HTTP; Thu, 8 Oct 2015 09:59:24 -0700 (PDT) In-Reply-To: References: Date: Thu, 8 Oct 2015 09:59:24 -0700 Message-ID: Subject: Re: Hadoop Java exception From: Ted Yu To: "common-user@hadoop.apache.org" Content-Type: multipart/alternative; boundary=001a114da68aff1c2605219ac800 --001a114da68aff1c2605219ac800 Content-Type: text/plain; charset=UTF-8 Looks like htrace jar was missing from the classpath. jar tvf htrace-core-3.1.0-incubating.jar | grep Trace 1187 Thu Jan 15 11:36:52 UTC 2015 org/apache/htrace/HTraceConfiguration$MapConf.class 3195 Thu Jan 15 11:36:52 UTC 2015 org/apache/htrace/HTraceConfiguration.class 5247 Thu Jan 15 11:36:52 UTC 2015 org/apache/htrace/Trace.class FYI On Thu, Oct 8, 2015 at 9:09 AM, Odin Guillermo Caudillo Gallegos < odin.guillermo@gmail.com> wrote: > Hi. > I'm doing a code to write a file on HDFS, i tried a few ways to do it, but > i always get the following error: > Do i need another library? i include all the libraries in the > share/hadoop/common/lib folder and still getting it > > Exception in thread "main" java.lang.NoClassDefFoundError: org/htrace/Trace > at org.apache.hadoop.hdfs.DFSOutputStream.(DFSOutputStream.java:1703) > at > org.apache.hadoop.hdfs.DFSOutputStream.newStreamForCreate(DFSOutputStream.java:1756) > at org.apache.hadoop.hdfs.DFSClient.create(DFSClient.java:1668) > at org.apache.hadoop.hdfs.DFSClient.create(DFSClient.java:1593) > at > org.apache.hadoop.hdfs.DistributedFileSystem$6.doCall(DistributedFileSystem.java:397) > at > org.apache.hadoop.hdfs.DistributedFileSystem$6.doCall(DistributedFileSystem.java:393) > at > org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81) > at > org.apache.hadoop.hdfs.DistributedFileSystem.create(DistributedFileSystem.java:393) > at > org.apache.hadoop.hdfs.DistributedFileSystem.create(DistributedFileSystem.java:337) > at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:909) > at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:802) > at test.HDFSMain.main(HDFSMain.java:25) > Caused by: java.lang.ClassNotFoundException: org.htrace.Trace > at java.net.URLClassLoader$1.run(URLClassLoader.java:366) > at java.net.URLClassLoader$1.run(URLClassLoader.java:355) > at java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findClass(URLClassLoader.java:354) > at java.lang.ClassLoader.loadClass(ClassLoader.java:425) > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) > at java.lang.ClassLoader.loadClass(ClassLoader.java:358) > ... 12 more > > Thanks > --001a114da68aff1c2605219ac800 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Looks like htrace jar was missing from the classpath.
=
jar =C2=A0tvf htrace-core-3.1.0-incubating.jar | grep Trace
=C2=A0 1187 Thu Jan 15 11:36:52 UTC 2015 org/apache/htrace/HTraceC= onfiguration$MapConf.class
=C2=A0 3195 Thu Jan 15 11:36:52 UTC 20= 15 org/apache/htrace/HTraceConfiguration.class
=C2=A0 5247 Thu Ja= n 15 11:36:52 UTC 2015 org/apache/htrace/Trace.class
=
FYI

On Thu, Oct 8, 2015 at 9:09 AM, Odin Guillermo Caudillo Galleg= os <odin.guillermo@gmail.com> wrote:
Hi.
I'm doing a code to write a = file on HDFS, i tried a few ways to do it, but i always get the following e= rror:
Do i need another library? i include all the libraries in t= he share/hadoop/common/lib folder and still getting it

=
Exception in thread "main" java.lang.NoClassDefFoundErr= or: org/htrace/Trace
at org.apache.hadoop.hdfs.DFSOutputStream.<init>(DFSOutputStream.jav= a:1703)
at org.apach= e.hadoop.hdfs.DFSOutputStream.newStreamForCreate(DFSOutputStream.java:1756)=
at org.apache.hadoo= p.hdfs.DFSClient.create(DFSClient.java:1668)
at org.apache.hadoop.hdfs.DFSClient.create(DFSClie= nt.java:1593)
at org= .apache.hadoop.hdfs.DistributedFileSystem$6.doCall(DistributedFileSystem.ja= va:397)
at org.apach= e.hadoop.hdfs.DistributedFileSystem$6.doCall(DistributedFileSystem.java:393= )
at org.apache.hado= op.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)
<= div> at org.apache.hadoop.hdfs.= DistributedFileSystem.create(DistributedFileSystem.java:393)
at org.apache.hadoop.hdfs.Distribu= tedFileSystem.create(DistributedFileSystem.java:337)
at org.apache.hadoop.fs.FileSystem.create= (FileSystem.java:909)
at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:802)
= at test.HDFSMain.main(HDFSMain= .java:25)
Caused by: java.lang.ClassNotFoundException: org.htrace= .Trace
at java.net.U= RLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.ja= va:355)
at java.secu= rity.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClass= Loader.java:354)
at = java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadC= lass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 12 more

Thanks

--001a114da68aff1c2605219ac800--