Return-Path: X-Original-To: apmail-hadoop-mapreduce-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-mapreduce-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 79D1EEFF0 for ; Wed, 5 Dec 2012 11:54:21 +0000 (UTC) Received: (qmail 68431 invoked by uid 500); 5 Dec 2012 11:54:16 -0000 Delivered-To: apmail-hadoop-mapreduce-user-archive@hadoop.apache.org Received: (qmail 68009 invoked by uid 500); 5 Dec 2012 11:54:13 -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 67978 invoked by uid 99); 5 Dec 2012 11:54:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Dec 2012 11:54:13 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of sampath06@gmail.com designates 209.85.210.182 as permitted sender) Received: from [209.85.210.182] (HELO mail-ia0-f182.google.com) (209.85.210.182) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Dec 2012 11:54:05 +0000 Received: by mail-ia0-f182.google.com with SMTP id x2so4624026iad.13 for ; Wed, 05 Dec 2012 03:53:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=LU4d1K1XOaFd64YSjGyv7ZKrERBqnzB0TsLxvfmD8J0=; b=Vkn+egM6ZMotxv9x3oZrlsOLFTHVJDc2OIyc+TmY2b5C/p9jUOrZ6T6B1cLsb3ffZa qSKN08bA1Loe7zYElwdlxZaGU4xscWA1CfQAtPQwdQSyHHwSjDt7Lgq/59JrwI1KlKDZ vlwnKV25Kr7Wqj7TQO517QV9yoxxwghXvN8B9JlzRid8gpgCWhxnOFoiSOld61uNLQVp hcHl5tZnJM8c3ec7zLvOfsvlnchGZJChyJZVaeabt7HwWVKEiFmIjAMBXpGBD9iMdxxp rz2vL2OBSw9xGeBVVbhix1o4FMXJxG5g1d4Lk/FOIaZGg1Bp2DAC2TNlSfDirlQpmxkB vCag== MIME-Version: 1.0 Received: by 10.50.173.106 with SMTP id bj10mr1602592igc.13.1354708422995; Wed, 05 Dec 2012 03:53:42 -0800 (PST) Received: by 10.231.26.203 with HTTP; Wed, 5 Dec 2012 03:53:42 -0800 (PST) Date: Wed, 5 Dec 2012 17:23:42 +0530 Message-ID: Subject: Issue with third party library From: Sampath Herga To: user@hadoop.apache.org Content-Type: multipart/alternative; boundary=e89a8f83a54f53b09504d019a2fd X-Virus-Checked: Checked by ClamAV on apache.org --e89a8f83a54f53b09504d019a2fd Content-Type: text/plain; charset=ISO-8859-1 Hi, I was just trying to setup hadoop and run some sample programs. I ran into some issues when trying to add a required library. I tried using the DistributedCache methods to try adding to the classpath. The basic code is: Path mysqlJar = new Path("target/classes/META-INF/mysql-connector-java-3.1.12-bin.jar"); fs.copyFromLocalFile(mysqlJar, mysqlJar); DistributedCache.addArchiveToClassPath(mysqlJar, jobConf, fs); I did a copyFromLocal since I wasnt sure where it would get picked from. I tried both addArchiveToClassPath and addFileToClassPath. But with both, I get a ClassNotFoundException. Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver at org.apache.hadoop.mapred.lib.db.DBInputFormat.configure(DBInputFormat.java:271) ... 16 more The job seems to have got the file added and also checked in the tasktracker local dir and the file seems to be present. mapred.job.classpath.archivestarget/classes/META-INF/mysql-connector-java-3.1.12-bin.jar Any clues would be helpful. I dont think I can use -libjars since I am trying to execute the hadoop jobs from within another application and not from the command line. Regards, Sampath. --e89a8f83a54f53b09504d019a2fd Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,

I was just trying to setup hadoop and run some sample programs. = I ran into some issues when trying to add a required library. I tried using= the DistributedCache methods to try adding to the classpath.

The b= asic code is:
=A0 Path mysqlJar =3D new Path("target/classes/META-INF/mysql-connecto= r-java-3.1.12-bin.jar");
=A0 fs.copyFromLocalFile(m= ysqlJar, mysqlJar);
=A0 DistributedCache.addArchiveToClassPath(mysqlJar,= jobConf, fs);

I did a copyFromLocal since I wasnt sure where it would get picked from= . I tried both addArchiveToClassPath and addFileToClassPath. But with both,= I get a ClassNotFoundException.

Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException= : com.mysql.jdbc.Driver
=A0=A0=A0 at org.apache.hadoop.mapred.lib.db.DBI= nputFormat.configure(DBInputFormat.java:271)
=A0=A0=A0 ... 16 more
The job seems to have got the file added and also checked in the tasktrac= ker local dir and the file seems to be present.

<property><name>mapred.job.classpath.archives</name>&= lt;value>target/classes/META-INF/mysql-connector-java-3.1.12-bin.jar<= /value></property>

Any clues would be helpful. I dont thi= nk I can use -libjars since I am trying to execute the hadoop jobs from wit= hin another application and not from the command line.

Regards,
Sampath.
--e89a8f83a54f53b09504d019a2fd--