奇怪的错误1006:%函数名%不是一个函数函数、奇怪、错误、一个函数

2023-09-08 15:09:52 作者:心里的忧伤谁懂

我遇到以下错误:

错误1006:%函数名%不是一个函数

Error 1006: %function_name% is not a function

我们在命名为 ArrayUtils 出项目2 UTIL类。在他们的所有功能的公共静态。另一名开发者加入功能%函数名% ArrayUtils 之一。我在code使用此方法。我重新编译整个应用程序。它编译OK和IDE(IntelliJ IDEA的)检测这种方法通常(进口是正确的)。但在运行时我得到了上面提到的错误。最奇怪的是,这个code的工作,因为它应该对其他开发人员的机器。

We have 2 util classes in out project named as ArrayUtils. All functions in them are public static. Another developer added function %function_name% to one of ArrayUtils. I use this method in my code. I recompiled whole application. It compiles OK and IDE (IntelliJ IDEA) detects this method normally (imports are correct). But at runtime I got mentioned above error. The most strange thing is that this code works as it should on other developer's machine.

P.S。浏览器缓存,IntelliJ IDEA的高速缓存和Maven(我们使用的是作为构建工具)的本地仓库被清除,没有任何帮助。

P.S. Browser cache, IntelliJ IDEA cache and maven (we use is as build tool) local repository were cleared, nothing helped.

推荐答案

有此错误的原因有二:

您有ArrayUtils类另一个precompiled库,你有机会获得通过连接ArrayUtils你试图用旧版本类的链接库。 您有其他库,现在包含ArrayUtils的依赖和您的联系被替换了这一点。所以,结果有2 ArrayUtils在你的项目范围。试图找到它,并删除一个。