尝试将 java 隐式转换为 Scala 集合时出现 NoSuchMethodError [英] NoSuchMethodError when attempting to implicitly convert a java to scala collection

查看:42
本文介绍了尝试将 java 隐式转换为 Scala 集合时出现 NoSuchMethodError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始在我的代码中收到这种错误:

I started to receive this kind of error in my code:

Message:
java.lang.NoSuchMethodError:scala.collection.JavaConversions
$.asScalaSet(Ljava/util/Set;)Lscala/collection/mutable/Set

然后我看到一个长屏幕的无趣的堆栈跟踪,这是在这段代码上触发的:

and then I see a long screen of stacktrace of uninteresting nature, which is triggered on this piece of code:

edited.authors.toSeq

其中 authorsjava.lang.Set.有人知道为什么会这样吗?这是运行时失败,而不是编译失败.

where authors is a java.lang.Set. Does anybody know why is this happening? It's a runtime failure and not a compile one.

推荐答案

您使用的库是用 2.8.12.8.0 运行时编译的

You are using a library which has been compiled with 2.8.1 from the 2.8.0 runtime

这篇关于尝试将 java 隐式转换为 Scala 集合时出现 NoSuchMethodError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆