在 Worklight 应用程序的“全部构建并部署”期间,我收到以下错误。
An internal error occurred during: "Worklight application builder".
loader constraint violation: when resolving method "org.apache.commons.io.FileUtils.iterateFiles(Ljava/io/File;Lorg/apache/commons/io/filefilter/IOFileFilter;Lorg/apache/commons/io/filefilter/IOFileFilter;)Ljava/util/Iterator;"
the class loader (instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader)
of the current class, com/worklight/builder/skins/impl/SkinBuilderImpl,
and the class loader (instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader)
for resolved class, org/apache/commons/io/FileUtils,
have different Class objects for the type leUtils.iterateFiles(Ljava/io/File;Lorg/apache/commons/io/filefilter/IOFileFilter;Lorg/apache/commons/io/filefilter/IOFileFilter;)Ljava/util/Iterator;
used in the signature
控制台输出是
[2013-03-26 15:30:13] Worklight Server started successfully on localhost:8080
[2013-03-26 15:30:13] Activating Worklight project: AA...
[2013-03-26 15:30:28] FWLSE3005I: Application raw reports are disabled.
[2013-03-26 15:30:28] FWLST0010I: ====== Started server for project AA-project-customization; Worklight version=5.0.5.20130115-0926-developer-edition
[2013-03-26 15:30:28] Activation done.
[2013-03-26 15:30:28] Starting build process: application 'ap', all environments
我相信这个错误也在https://www.ibm.com/developerworks/forums/thread.jspa?threadID=465649(只读)中讨论过
对我来说,这个错误似乎可以很好地重现。每次安装另一个包含/使用 org.apache.commons.io 包的插件时都会发生这种情况
就我而言,我的插件文件夹中有一个 org.apache.commons.io_2.0.1.v201105210651.jar(由 Sonar 2.4.0 提供)。它包含与 plugins\com.worklight.worklight-3rd-parties_5.0.5.20130115-0926\target\dependency 相同的 java 类。
这也是一个排序问题,因为只有在安装了另一个 org.apache.commons.io-using 包之后安装了 Worklight 时才会出现错误。
所以我坚信问题是因为有不同的类具有相同的(包)名称(为什么??)我考虑过设置类加载器首选项(父优先等)。但我不知道如何设置,也不知道在哪里设置。
仅删除 3rd 方 .jar 只会导致其他错误...
非常感谢任何提示。非常感谢 !