1

i'm working a spark app (language > scala) ,

and using okhttp3 3.6.0 ver.

An error occurs when calling the below method.

val client = new OkHttpClient()
....
val response = client.newCall(request).execute()
response.body().string()

Exception :

Exception in thread "main" java.lang.NoSuchMethodError: okio.BufferedSource.rangeEquals(JLokio/ByteString;)Z
    at okhttp3.internal.Util.bomAwareCharset(Util.java:412)
    at okhttp3.ResponseBody.string(ResponseBody.java:173)

please help me :'(

ps.

scala version : 2.10.6 
spark version : 1.6.3
okhttp version : 3.6.0
Alper t. Turker
  • 34,230
  • 9
  • 83
  • 115
hyeyoung
  • 87
  • 10

1 Answers1

2

You’re using an obsolete version of Okio. Configure it to be 1.13.0 and you’ll be good.

Jesse Wilson
  • 39,078
  • 8
  • 121
  • 128