[scalding] error in serialization

664 views
Skip to first unread message

Ittay Dror

unread,
Apr 30, 2014, 6:38:42 AM4/30/14
to cascadi...@googlegroups.com
java.lang.IllegalAccessException: Class com.twitter.chill.Instantiators$$anonfun$normalJava$1 can not access a member of class org.apache.avro.Schema$BytesSchema with modifiers "public"

My job class contains:
  override def ioSerializations =
    super.ioSerializations :+ classOf[cascading.avro.serialization.AvroSpecificRecordSerialization[GenericRecord]]

This appeared to have happened after mapping some values, which were ByteWritable (which is the values you get reading a byte array field) into String. When the pipe carried these values as is, the error did not manifest.

Regards,
Ittay


Christopher Severs

unread,
Apr 30, 2014, 1:52:27 PM4/30/14
to cascadi...@googlegroups.com
Hi Ittay,

Can you post a stripped down example where this happens so I can have a look at what is going on? I suspect the scalding-avro implicits are trying to serialize the byteswritable stuff when it shouldn't be.

Thanks,
Chris

Ittay Dror

unread,
May 1, 2014, 1:54:41 AM5/1/14
to cascadi...@googlegroups.com
i tried, but as i wrote, it manifested itself after an unrelated change, so once i changed things it went away.

the culprit was an inner object in my job that wrapped UnpackedAvroSource. Once I moved it to its own file, serialization worked


--
You received this message because you are subscribed to a topic in the Google Groups "cascading-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cascading-user/gFZ2KTSXLSU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cascading-use...@googlegroups.com.
To post to this group, send email to cascadi...@googlegroups.com.
Visit this group at http://groups.google.com/group/cascading-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/cascading-user/4f611bde-c8fe-4ab6-ac0b-af8c5f298e98%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

sourabh chaki

unread,
Sep 10, 2014, 11:52:11 AM9/10/14
to cascadi...@googlegroups.com

I am also getting similar error, but not at org.apache.avro.Schema$BytesSchema.Here it is trying to access sun.nio.cs.UTF_8.

Caused by: java.lang.IllegalAccessException: Class com.twitter.chill.Instantiators$$anonfun$normalJava$1 can not access a member of class sun.nio.cs.UTF_8 with modifiers "public"
	at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:109)
	at java.lang.reflect.AccessibleObject.slowCheckMemberAccess(AccessibleObject.java:261)
	at java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:253)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:517)
	at com.twitter.chill.Instantiators$$anonfun$normalJava$1.apply(KryoBase.scala:161)
	at com.twitter.chill.Instantiators$$anon$1.newInstance(KryoBase.scala:122)

When I execute the scalding job using hadoop jar in hdfs mode , it works. But if I use oozie to execute the job using java action, it throws this error.
Any pointers will be helpful.

Thanks
Sourabh

Oscar Boykin

unread,
Sep 10, 2014, 1:58:39 PM9/10/14
to cascadi...@googlegroups.com
We discussed this just yesterday on IRC:


you should put the avro serialization first, not last. Kryo is in front of that and will try to serialize anything it gets, which will break this.

Also note:

chill-avro.

We probably should make it easier to use avro in nested structures, so for that you want to add Avro to your default Kryo serializations.

Added this issue:

--
You received this message because you are subscribed to the Google Groups "cascading-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cascading-use...@googlegroups.com.

To post to this group, send email to cascadi...@googlegroups.com.
Visit this group at http://groups.google.com/group/cascading-user.

For more options, visit https://groups.google.com/d/optout.



--
Oscar Boykin :: @posco :: http://twitter.com/posco

sourabh chaki

unread,
Sep 10, 2014, 10:47:00 PM9/10/14
to cascadi...@googlegroups.com
Hi Oscar,

Thanks for your quick response. I am not using Kyro serialization directly from my code instead I am using using AvroPackedSource.
My code:
class MyJob(args: Args) extends Job(args) {
 val views = PackedAvroSource[AvroEntity](args(INPUT)).read
    .somemapper
    .groupby_on_some_field
    .write(Tsv(OUTPUT))
}

Is there any quick fix available to make this work?

Thanks
Sourabh

Simone Franzini

unread,
Sep 16, 2014, 4:00:13 PM9/16/14
to cascadi...@googlegroups.com
I am experiencing the same issues with Avro/Kryo and Scalding 0.11.0.
I cannot resolve the null pointer exception issue even by adding an Avro serializer to ioSerializations, as suggested in some other posts.
Regarding the posted IRC chat, could you clarify how chill-avro was wired in?
What is the AvroFriendlyKryo class?
In chill-avro I can only find an object but no class.

Thanks.
Reply all
Reply to author
Forward
0 new messages