hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Armstrong <john.armstr...@ccri.com>
Subject Re: Class loading problem
Date Thu, 28 Jul 2011 14:48:09 GMT
On Thu, 28 Jul 2011 10:05:57 -0400, "Kumar, Ranjan"
<Ranjan.Kumar1@morganstanleysmithbarney.com> wrote:
> I have a class to define data I am reading from a MySQL database.
> According to online tutorials I created a class called MyRecord and
> extended it from Writable, DBWritable. While running it with hadoop I
get a
> NoSuchMethodException: dataTest$MyRecord.<init>()

Hadoop needs a noargs constructor to build the object, which it then fills
in by using readFields().  Many classes come with a default noargs
constructor, which basically defers to the noargs contructor from Object,
or another ancestor class.

HOWEVER

If you defined another constructor that takes arguments, you've implicitly
removed the default noargs constructor on your class.  You need to define
one explicitly, which Hadoop can use to build your objects.

hth

Mime
View raw message