Return-Path: X-Original-To: apmail-incubator-giraph-user-archive@minotaur.apache.org Delivered-To: apmail-incubator-giraph-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 7E5829709 for ; Sat, 3 Mar 2012 13:56:09 +0000 (UTC) Received: (qmail 98102 invoked by uid 500); 3 Mar 2012 13:56:09 -0000 Delivered-To: apmail-incubator-giraph-user-archive@incubator.apache.org Received: (qmail 97988 invoked by uid 500); 3 Mar 2012 13:56:09 -0000 Mailing-List: contact giraph-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: giraph-user@incubator.apache.org Delivered-To: mailing list giraph-user@incubator.apache.org Received: (qmail 97978 invoked by uid 99); 3 Mar 2012 13:56:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Mar 2012 13:56:09 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of claudio.martella@gmail.com designates 209.85.210.175 as permitted sender) Received: from [209.85.210.175] (HELO mail-iy0-f175.google.com) (209.85.210.175) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Mar 2012 13:56:01 +0000 Received: by iaag37 with SMTP id g37so3381659iaa.6 for ; Sat, 03 Mar 2012 05:55:40 -0800 (PST) Received-SPF: pass (google.com: domain of claudio.martella@gmail.com designates 10.50.42.132 as permitted sender) client-ip=10.50.42.132; Authentication-Results: mr.google.com; spf=pass (google.com: domain of claudio.martella@gmail.com designates 10.50.42.132 as permitted sender) smtp.mail=claudio.martella@gmail.com; dkim=pass header.i=claudio.martella@gmail.com Received: from mr.google.com ([10.50.42.132]) by 10.50.42.132 with SMTP id o4mr1667949igl.58.1330782940245 (num_hops = 1); Sat, 03 Mar 2012 05:55:40 -0800 (PST) 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=V8aanAyE4L8VzNQ3/pKek3T5ko2gDihzJcvbR0vC1wg=; b=C0L5Bhehgxupp/eNKHerdzPf4GRxVGkuzN5ZqJw16l+EEjZ2lozjEH2kN+sIDL2NPe NXVb9dAt2y1JsyksbIUX9Q5xSVMZJW6uk5B7xsmu9fooBtey44BpIVkUrFuSKCn8+aBT 3fwtcT//IY8YBGURSsMibCZIwX0+1gUivhQVbKowj3vaT8bn3MEdzZUeV5+Ou+AZmsz6 VBwRpsdjH5asQME1jQ+C81Y/IOUds9oucUUPKVM5z08UO6HdFjC3qeG/pF5wi4zSpeu9 p8UT2ARCUVz8+ITnvmxtrMb7t+eWoNqRDWoboM8yaeomvYcyrn+l1z1UCmihP0Vf6iVF rJ9Q== MIME-Version: 1.0 Received: by 10.50.42.132 with SMTP id o4mr1380561igl.58.1330782940161; Sat, 03 Mar 2012 05:55:40 -0800 (PST) Received: by 10.50.99.10 with HTTP; Sat, 3 Mar 2012 05:55:39 -0800 (PST) In-Reply-To: <4F52215C.3090704@apache.org> References: <4F52215C.3090704@apache.org> Date: Sat, 3 Mar 2012 14:55:39 +0100 Message-ID: Subject: Re: Error in instantiating custom Vertex class via InternalVertexRunner.run From: Claudio Martella To: "giraph-user@incubator.apache.org" , "ssc@apache.org" Content-Type: multipart/alternative; boundary=14dae9340a416be6ee04ba570c58 X-Virus-Checked: Checked by ClamAV on apache.org --14dae9340a416be6ee04ba570c58 Content-Type: text/plain; charset=ISO-8859-1 A part of your issues, I am looking forward to see who you are going to attack this problem. Please keep us posted on your progress. On Saturday, March 3, 2012, Sebastian Schelter wrote: > Hi Benjamin, > > Does your vertex class have a publicly accessible no-arg constructor? > That's implicitly required because each Vertex class implements Writable. > > If you want to use to have a look at your code, you could maybe put it > on github? > > Best, > Sebastian > > On 02.03.2012 20:51, Benjamin Heitmann wrote: >> Hello, >> >> in the last week I started working with Apache Giraph. My goal is to implement a version of the >> spreading activation algorithm (as described on Wikipedia [1] and in this article [2] ). >> Using Giraph will hopefully allow scaling for Linked Data/RDF from DBPedia. >> >> I used the ConnectedComponentsVertex Example (and its UnitTest) as the >> starting point for my own Vertex, TextInputFormat, TextOutputFormat and UnitTest (and a class for VertexData/State). >> In addition, I ensured that the ConnectedComponentsVertexTest runs successfully, both from the giraph source tree >> and from my own project. >> >> My Vertex class is called SpreadingActivationVertex, and it directly extends BasicVertex, and it has the following signature: >> public abstract class SpreadingActivationVertex extends >> BasicVertex >> As you can see, I need to maintain more then one variable for the state of the vertex, >> and I need to pass doubles as messages. >> >> When I execute my UnitTest, I get the following error: >> >> 59820 [Thread-4] WARN org.apache.hadoop.mapred.LocalJobRunner - job_local_0001 >> java.lang.RuntimeException: java.lang.InstantiationException >> at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:115) >> at org.apache.giraph.graph.BspUtils.createVertex(BspUtils.java:365) >> at ie.deri.uimr.ld_sa.prototyping.giraph.SpreadingActivationTextInputFormat$SpreadingActivationVertexReader.getCurrentVertex(SpreadingActivationTextInputFormat.java:53) >> at org.apache.giraph.graph.BspServiceWorker.readVerticesFromInputSplit(BspServiceWorker.java:440) >> at org.apache.giraph.graph.BspServiceWorker.loadVerticesFromInputSplit(BspServiceWorker.java:371) >> at org.apache.giraph.graph.BspServiceWorker.loadVertices(BspServiceWorker.java:305) >> at org.apache.giraph.graph.BspServiceWorker.setup(BspServiceWorker.java:583) >> at org.apache.giraph.graph.GraphMapper.setup(GraphMapper.java:474) >> at org.apache.giraph.graph.GraphMapper.run(GraphMapper.java:646) >> at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:763) >> at org.apache.hadoop.mapred.MapTask.run(MapTask.java:369) >> at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:210) >> Caused by: java.lang.InstantiationException >> at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:30) >> at java.lang.reflect.Constructor.newInstance(Constructor.java:513) >> at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:113) >> ... 11 more >> >> >> Using the eclipse debugger, I traced it to these lines of code in Hadoop: >> >> org.apache.hadoop.util.ReflectionUtils, line 113 in newInstance(): >> >> try { >> Constructor meth = (Constructor) CONSTRUCTOR_CACHE.get(theClass); >> if (meth == null) { >> meth = theClass.getDeclaredConstructor(EMPTY_ARRAY); >> meth.setAccessible(true); >> CONSTRUCTOR_CACHE.put(theClass, meth); >> } >> result = meth.newInstance(); // <<<------------ this is the line causing the error >> } catch (Exception e) { >> throw new RuntimeException(e); >> } >> >> The constructor cache does not contain my vertex class, however the next lines successfully find the right constructor and put it into "meth". >> However, the invocation of meth.newInstance() fails with the above error. >> >> >> Did somebody have this error before ? >> What did I miss ? >> The class itself is successfully found, so it is not an issue of setting some paths. >> How -- Claudio Martella claudio.martella@gmail.com --14dae9340a416be6ee04ba570c58 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable A part of your issues, I am looking forward to see who you are going to att= ack this problem.
Please keep us posted on your progress.

On Sa= turday, March 3, 2012, Sebastian Schelter <ssc@apache.org> wrote:
> Hi Benjamin,
>
> Does your vertex class have a publicly ac= cessible no-arg constructor?
> That's implicitly required because= each Vertex class implements Writable.
>
> If you want to use = to have a look at your code, you could maybe put it
> on github?
>
> Best,
> Sebastian
>
> On = 02.03.2012 20:51, Benjamin Heitmann wrote:
>> Hello,
>>>> in the last week I started working with Apache Giraph. My goal i= s to implement a version of the
>> spreading activation algorithm (as described on Wikipedia [1] and = in this article [2] ).
>> Using Giraph will hopefully allow scalin= g for Linked Data/RDF from DBPedia.
>>
>> I used the Conn= ectedComponentsVertex Example (and its UnitTest) as the
>> starting point for my own Vertex, TextInputFormat, TextOutputForma= t and UnitTest (and a class for VertexData/State).
>> In addition,= I ensured that the ConnectedComponentsVertexTest runs successfully, both f= rom the giraph source tree
>> and from my own project.
>>
>> My Vertex class i= s called SpreadingActivationVertex, and it directly extends BasicVertex, an= d it has the following <I, V, E, M> signature:
>> public abs= tract class SpreadingActivationVertex extends
>> BasicVertex<IntWritable, SpreadingActivationStateWritable, Null= Writable, DoubleWritable>
>> As you can see, I need to maintain= more then one variable for the state of the vertex,
>> and I need= to pass doubles as messages.
>>
>> When I execute my UnitTest, I get the following error:=
>>
>> 59820 [Thread-4] WARN =A0org.apache.hadoop.mapred.= LocalJobRunner =A0- job_local_0001
>> java.lang.RuntimeException: = java.lang.InstantiationException
>> =A0 =A0 =A0 at org.apache.hadoop.util.ReflectionUtils.newInstance(= ReflectionUtils.java:115)
>> =A0 =A0 =A0 at org.apache.giraph.grap= h.BspUtils.createVertex(BspUtils.java:365)
>> =A0 =A0 =A0 at ie.de= ri.uimr.ld_sa.prototyping.giraph.SpreadingActivationTextInputFormat$Spreadi= ngActivationVertexReader.getCurrentVertex(SpreadingActivationTextInputForma= t.java:53)
>> =A0 =A0 =A0 at org.apache.giraph.graph.BspServiceWorker.readVertic= esFromInputSplit(BspServiceWorker.java:440)
>> =A0 =A0 =A0 at org.= apache.giraph.graph.BspServiceWorker.loadVerticesFromInputSplit(BspServiceW= orker.java:371)
>> =A0 =A0 =A0 at org.apache.giraph.graph.BspServiceWorker.loadVertic= es(BspServiceWorker.java:305)
>> =A0 =A0 =A0 at org.apache.giraph.= graph.BspServiceWorker.setup(BspServiceWorker.java:583)
>> =A0 =A0= =A0 at org.apache.giraph.graph.GraphMapper.setup(GraphMapper.java:474)
>> =A0 =A0 =A0 at org.apache.giraph.graph.GraphMapper.run(GraphMapper= .java:646)
>> =A0 =A0 =A0 at org.apache.hadoop.mapred.MapTask.runN= ewMapper(MapTask.java:763)
>> =A0 =A0 =A0 at org.apache.hadoop.map= red.MapTask.run(MapTask.java:369)
>> =A0 =A0 =A0 at org.apache.hadoop.mapred.LocalJobRunner$Job.run(Loc= alJobRunner.java:210)
>> Caused by: java.lang.InstantiationExcepti= on
>> =A0 =A0 =A0 at sun.reflect.InstantiationExceptionConstructor= AccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java= :30)
>> =A0 =A0 =A0 at java.lang.reflect.Constructor.newInstance(Construct= or.java:513)
>> =A0 =A0 =A0 at org.apache.hadoop.util.ReflectionUt= ils.newInstance(ReflectionUtils.java:113)
>> =A0 =A0 =A0 ... 11 mo= re
>>
>>
>> Using the eclipse debugger, I traced it to these lines= of code in Hadoop:
>>
>> org.apache.hadoop.util.Reflecti= onUtils, line 113 in newInstance():
>>
>> =A0 =A0 try { >> =A0 =A0 =A0 Constructor<T> meth =3D (Constructor<T>) C= ONSTRUCTOR_CACHE.get(theClass);
>> =A0 =A0 =A0 if (meth =3D=3D nul= l) {
>> =A0 =A0 =A0 =A0 meth =3D theClass.getDeclaredConstructor(E= MPTY_ARRAY);
>> =A0 =A0 =A0 =A0 meth.setAccessible(true);
>> =A0 =A0 =A0 =A0 CONSTRUCTOR_CACHE.put(theClass, meth);
>>= =A0 =A0 =A0 }
>> =A0 =A0 =A0 result =3D meth.newInstance(); =A0 = =A0// <<<------------ this is the line causing the error
>&g= t; =A0 =A0 } catch (Exception e) {
>> =A0 =A0 =A0 throw new RuntimeException(e);
>> =A0 =A0 }>>
>> The constructor cache does not contain my vertex cla= ss, however the next lines successfully find the right constructor and put = it into "meth".
>> However, the invocation of meth.newInstance() fails with the above= error.
>>
>>
>> Did somebody have this error be= fore ?
>> What did I miss ?
>> The class itself is succes= sfully found, so it is not an issue of setting some paths.
>> How

--
=A0 =A0Claudio Martella
=A0 =A0claudio.martella@gmail.= com=A0 =A0
--14dae9340a416be6ee04ba570c58--