You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by James Newhaven <ja...@gmail.com> on 2012/05/18 18:17:37 UTC

Jackson problem in custom Pig Eval function

I am trying to use the Jackson JSON mapper in a custom Eval Pig function
like this:

mapper.writeValueAsString(cityChartData);

However, when I use my custom function in a pig script, pig errors out with
this:

java.lang.NoSuchMethodError:
org.codehaus.jackson.map.ObjectMapper.writeValueAsString(Ljava/lang/Object;)Ljava/lang/String;

I am using Pig 0.9.2 and looking at the source I can see it is being built
with Jackson 1.7.3, which definitely has this method. Can anyone suggest
what could be the problem?

Thanks,

James

Re: Jackson problem in custom Pig Eval function

Posted by Russell Jurney <ru...@gmail.com>.
I have this problem too - whenever HADOOP_HOME is set, I can't use
AvroStorage because there is a Jackson problem.

Thanks for explaining it!

On Fri, May 18, 2012 at 9:27 AM, Erik Hetzner <er...@ucop.edu> wrote:

> At Fri, 18 May 2012 17:17:37 +0100,
> James Newhaven wrote:
> >
> > I am trying to use the Jackson JSON mapper in a custom Eval Pig function
> > like this:
> >
> > mapper.writeValueAsString(cityChartData);
> >
> > However, when I use my custom function in a pig script, pig errors out
> with
> > this:
> >
> > java.lang.NoSuchMethodError:
> >
> org.codehaus.jackson.map.ObjectMapper.writeValueAsString(Ljava/lang/Object;)Ljava/lang/String;
> >
> > I am using Pig 0.9.2 and looking at the source I can see it is being
> built
> > with Jackson 1.7.3, which definitely has this method. Can anyone suggest
> > what could be the problem?
>
> Hi James,
>
> Hadoop ships with jackson as well. I was able to solve a similar
> problem by removing the jackson jars from the hadoop lib/ dir.
>
> best, Erik
>
> Sent from my free software system <http://fsf.org/>.
>
>


-- 
Russell Jurney twitter.com/rjurney russell.jurney@gmail.com datasyndrome.com

Re: Jackson problem in custom Pig Eval function

Posted by Erik Hetzner <er...@ucop.edu>.
At Fri, 18 May 2012 17:17:37 +0100,
James Newhaven wrote:
>
> I am trying to use the Jackson JSON mapper in a custom Eval Pig function
> like this:
>
> mapper.writeValueAsString(cityChartData);
>
> However, when I use my custom function in a pig script, pig errors out with
> this:
>
> java.lang.NoSuchMethodError:
> org.codehaus.jackson.map.ObjectMapper.writeValueAsString(Ljava/lang/Object;)Ljava/lang/String;
>
> I am using Pig 0.9.2 and looking at the source I can see it is being built
> with Jackson 1.7.3, which definitely has this method. Can anyone suggest
> what could be the problem?

Hi James,

Hadoop ships with jackson as well. I was able to solve a similar
problem by removing the jackson jars from the hadoop lib/ dir.

best, Erik