You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@avro.apache.org by Jakob Homan <jg...@gmail.com> on 2012/03/16 20:51:05 UTC

Re: Avro and Hive contd

> java.lang.NoClassDefFoundError: Could not initialize class
> org.apache.avro.Schema
This is a classpath problem, not a Haivvreo problem.
Is Avro on the classpath of Hive and on the nodes? The easiest way to
do this is to point to HIVE_AUX_JARS_PATH, as covered in the building
and deploying section...


On Fri, Feb 24, 2012 at 11:20 AM, snikhil0 <sn...@telenav.com> wrote:
> Has some one successfully used the SerDe for Avro provided by Jakob
> (https://github.com/jghoman/haivvreo)?
>
> I am using the exact versions of avro and hive recommended by the authors
> but running into all kinds of problems just in running their examples...
>
> Can someone please help me out?
>
> create table test row format serde 'com.linkedin.haivvreo.AvroSerDe' with
> serdeproperties ('schema.literal'='{"namespace": "com.linkedin.haivvreo",
> "name": "test_schema", "type":"record", "fields":[{"name":"string1",
> "type":"string"} ] }') stored as inputformat
> 'com.linkedin.haivvreo.AvroContainerInputFormat' outputformat
> 'com.linkedin.haivvreo.AvroContainerOutputFormat';
> java.lang.NoClassDefFoundError: Could not initialize class
> org.apache.avro.Schema
>        at
> com.linkedin.haivvreo.HaivvreoUtils.determineSchemaOrThrowException(HaivvreoUtils.java:50)
>        at
> com.linkedin.haivvreo.HaivvreoUtils.determineSchemaOrReturnErrorSchema(HaivvreoUtils.java:76)
>        at com.linkedin.haivvreo.AvroSerDe.initialize(AvroSerDe.java:51)
>        at
> org.apache.hadoop.hive.metastore.MetaStoreUtils.getDeserializer(MetaStoreUtils.java:199)
>        at org.apache.hadoop.hive.ql.metadata.Table.getDeserializer(Table.java:253)
>        at org.apache.hadoop.hive.ql.metadata.Table.getCols(Table.java:484)
>        at org.apache.hadoop.hive.ql.metadata.Hive.createTable(Hive.java:450)
>        at org.apache.hadoop.hive.ql.exec.DDLTask.createTable(DDLTask.java:3146)
>        at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:213)
>        at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:130)
>        at
> org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:57)
>        at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1063)
>        at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:900)
>        at org.apache.hadoop.hive.ql.Driver.run(Driver.java:748)
>        at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:164)
>        at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:241)
>        at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:456)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:597)
>        at org.apache.hadoop.util.RunJar.main(RunJar.java:156)
> FAILED: Execution Error, return code -101 from
> org.apache.hadoop.hive.ql.exec.DDLTask
>
> My setup:
> hive: 0.7.1
> avro: 1.4.1
> hadoop: 1.0.0
> added the jackson jars as recommended using add jar on hive cli.
>
> Thanks,
>
>
> --
> View this message in context: http://apache-avro.679487.n3.nabble.com/Avro-and-Hive-contd-tp3773468p3773468.html
> Sent from the Avro - Users mailing list archive at Nabble.com.

Re: Avro and Hive contd

Posted by Appan Thirumaligai <ao...@gmail.com>.
Nikhil,

Something like this should work:

/<mypath>/hive-0.7.1-cdh3u2/bin/hive --auxpath
/usr/share/java/mysql-connector-java.jar:/<mypath>/hive/lib/avro-1.5.4.jar:/<mypath>/hive/lib/avro-ipc-1.5.4.jar:
/<mypath>/hive/lib/avro-mapred-1.5.4.jar:/<mypath>
/hive/lib/haivvreo-1.0.7-cdh-2.jar:/<mypath>
/hive/lib/snappy-java-1.0.3.2.jar

If you pass the path to all the JARs that you are using it should work. In
our case we use haivvreo, snappy, mysql...


On Fri, Mar 16, 2012 at 3:27 PM, snikhil0 <sn...@telenav.com> wrote:

> Hello Jakob,
>
> I tried both options:
>
> 1. copied the jars (jackson*, avro*, haivvero*) to $HIVE_HOME/lib
> 2. pointed the HIVE_AUX_JARS_PATH to a folder that contained all the above
> jars.
>
> Started hive.
>
> list jars; does not show me the above jars?
> Only if I add the jars manually using add jar do I get the desired jars as
> an output on list jars;
>
> However, I tried all cases and I still get the same error...Schema_init..
> java.lang.NoClassDefFoundError
>
> What am I doing wrong?
>
> System:
> Hive 0-7.1-bin also tried 0.8.1-bin
> avro 1.4.2 (also tried 1.5.3 and 1.6.2)
> jackson (corresponding versions)
> hadoop-0.20.205 (also tried running local without hadoop)
>
> Thanks,
> Nikhil
>
> --
> View this message in context:
> http://apache-avro.679487.n3.nabble.com/Avro-and-Hive-contd-tp3773468p3833357.html
> Sent from the Avro - Users mailing list archive at Nabble.com.
>

Re: Avro and Hive contd

Posted by snikhil0 <sn...@telenav.com>.
Hello Jakob,

I tried both options:

1. copied the jars (jackson*, avro*, haivvero*) to $HIVE_HOME/lib
2. pointed the HIVE_AUX_JARS_PATH to a folder that contained all the above
jars.

Started hive.

list jars; does not show me the above jars?
Only if I add the jars manually using add jar do I get the desired jars as
an output on list jars;

However, I tried all cases and I still get the same error...Schema_init..
java.lang.NoClassDefFoundError

What am I doing wrong?

System:
Hive 0-7.1-bin also tried 0.8.1-bin
avro 1.4.2 (also tried 1.5.3 and 1.6.2)
jackson (corresponding versions)
hadoop-0.20.205 (also tried running local without hadoop)

Thanks,
Nikhil

--
View this message in context: http://apache-avro.679487.n3.nabble.com/Avro-and-Hive-contd-tp3773468p3833357.html
Sent from the Avro - Users mailing list archive at Nabble.com.