Return-Path: Delivered-To: apmail-lucene-mahout-dev-archive@locus.apache.org Received: (qmail 21324 invoked from network); 7 Mar 2008 08:38:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Mar 2008 08:38:51 -0000 Received: (qmail 34248 invoked by uid 500); 7 Mar 2008 08:38:47 -0000 Delivered-To: apmail-lucene-mahout-dev-archive@lucene.apache.org Received: (qmail 34220 invoked by uid 500); 7 Mar 2008 08:38:47 -0000 Mailing-List: contact mahout-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: mahout-dev@lucene.apache.org Delivered-To: mailing list mahout-dev@lucene.apache.org Received: (qmail 34211 invoked by uid 99); 7 Mar 2008 08:38:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Mar 2008 00:38:47 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [150.254.30.30] (HELO libra.cs.put.poznan.pl) (150.254.30.30) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Mar 2008 08:37:59 +0000 Received: from kas30pipe.localhost (unknown [127.0.0.1]) by libra.cs.put.poznan.pl (Postfix on VMS) with ESMTP id 122DF89 for ; Fri, 7 Mar 2008 08:38:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at cs.put.poznan.pl Received: from libra.cs.put.poznan.pl ([127.0.0.1]) by localhost (libra.cs.put.poznan.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id x4lFWa34QiPq for ; Fri, 7 Mar 2008 09:38:19 +0100 (CET) Received: from [150.254.130.25] (idss-dw-2.cs.put.poznan.pl [150.254.130.25]) by libra.cs.put.poznan.pl (Postfix on VMS) with ESMTP id CECD886 for ; Fri, 7 Mar 2008 09:38:19 +0100 (CET) Message-ID: <47D0FEE1.7080406@cs.put.poznan.pl> Date: Fri, 07 Mar 2008 09:37:53 +0100 From: Dawid Weiss User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: mahout-dev@lucene.apache.org Subject: Re: Class Loader Problem References: <47CFB07A.8000400@cs.put.poznan.pl> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0278], KAS30/Release X-SpamTest-Info: Not protected X-Virus-Checked: Checked by ClamAV on apache.org Ok, I'll look into it through the weekend -- there is a JIRA task for this (and the JAR hint issues), so keep an eye on it. D. Jeff Eastman wrote: > Hi Dawid, > > I figured somebody who really understands class loaders would be able to > improve on my initial implementation. I don't have a small test case for > this at the moment, but you should be able to duplicate it easily by > creating a new DistanceMeasure in a test project and then calling the > CanopyClusteringJob as in the code fragment below. You can reuse some of > the Canopy test case code to populate your initial dataset. > > BTW, the original code worked fine when running locally from Eclipse, > and I only saw the failures when running on a remote cluster. Evidently, > Eclipse's classpath environment is different than that of a deployed map > task. > > Jeff > > -----Original Message----- > From: Dawid Weiss [mailto:dawid.weiss@cs.put.poznan.pl] > Sent: Thursday, March 06, 2008 12:51 AM > To: mahout-dev@lucene.apache.org > Subject: Re: Class Loader Problem > > > Hi guys, > > I just looked at the code and noticed you use Class-relative > classloader: > > Class cl = Class.forName(job.get(DISTANCE_MEASURE_KEY)); > > This is effectively an attempt to load a class using the caller's class > class > loader (the class loader is loaded via > ClassLoader.getCallerClassLoader()).Usually it makes more sense to use > thread's > context class loader (they may be different), so: > > Thread.currentThread().getContextClassLoader().loadClass(...); > > I teach classes today, but I'll review the code and see if I can fix it. > Jeff, > would you by any chance have an assembled-and-ready test case or example > that > causes this problem? > > Dawid > > > Ted Dunning wrote: >> Hmmm... >> >> Is there a more elegant way to go here? Is there a way for the >> CanopyClusteringJob to infer which jar by looking at the class? I > think >> that Hadoop does something like this via the class loader. >> >> This current method looks ripe for very obscure bugs. >> >> >> On 3/5/08 4:49 PM, "Grant Ingersoll" wrote: >> >>> I changed the main's to pass in the location of the jar, since the > ANT >>> task puts the jar in basedir/dist. I made a comment about it on >>> Mahout-3. The Canopy driver should do the right thing????? I also >>> did the same thing w/ the k-means. >>> >>> >>> On Mar 5, 2008, at 2:52 PM, Jeff Eastman wrote: >>> >>>> Here's my job driver, it works fine with ManhattanDistanceMeasure > but >>>> not SystemLoadDistanceMeasure. >>>> >>>> Jeff >>>> >>>> public static void main(String[] args) { >>>> String input = args[0]; >>>> String output = args[1]; >>>> int t1 = new Integer(args[2]); >>>> int t2 = new Integer(args[3]); >>>> JobConf conf = new JobConf( >>>> com.collabnet.hadoop.systemload.access.DriverA.class); >>>> Path outPath = new Path(output); >>>> try { >>>> FileSystem dfs = FileSystem.get(conf); >>>> if (dfs.exists(outPath)) >>>> dfs.delete(outPath); >>>> DriverA.runJob(input, output); >>>> DriverP.runJob(input, output); >>>> DriverC.runJob(output, output); >>>> CanopyClusteringJob.runJob(output + "/combined", output, >>>> SystemLoadDistanceMeasure.class.getName(), t1, t2, >>>> "apache-mahout-0.1-dev.jar"); >>>> DriverS.runJob(output + "/clusters", output); >>>> } catch (IOException e) { >>>> e.printStackTrace(); >>>> } >>>> } >>>> >>>> -----Original Message----- >>>> From: Ted Dunning [mailto:tdunning@veoh.com] >>>> Sent: Wednesday, March 05, 2008 11:44 AM >>>> To: mahout-dev@lucene.apache.org >>>> Subject: Re: Class Loader Problem >>>> >>>> >>>> Where is your code? >>>> >>>> >>>> On 3/5/08 11:28 AM, "Jeff Eastman" wrote: >>>> >>>>> I'm wondering if you can see anything >>>>> wrong with my packaging or, perhaps, how the Canopy class is going >>>> about >>>>> instantiating it.