我在我的Ubuntu 17 dekstop上运行了Intellij 2017.2.3和Checkstyle-IDEA 5.10.0。当我尝试为我的Java项目添加checkstyle时(在Settings-> Other settings-> Checkstyle),我收到以下错误消息:
java.lang.NoClassDefFoundError: org/apache/commons/collections/FastHashMap
at org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptor(PropertyUtilsBean.java:963)
at org.apache.commons.beanutils.BeanUtilsBean.copyProperty(BeanUtilsBean.java:391)
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.tryCopyProperty(AutomaticBean.java:217)
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.contextualize(AutomaticBean.java:249)
at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:455)
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:186)
at org.infernus.idea.checkstyle.service.cmd.OpCreateChecker.execute(OpCreateChecker.java:58)
at org.infernus.idea.checkstyle.service.cmd.OpCreateChecker.execute(OpCreateChecker.java:26)
at org.infernus.idea.checkstyle.service.CheckstyleActionsImpl.executeCommand(CheckstyleActionsImpl.java:126)
at org.infernus.idea.checkstyle.service.CheckstyleActionsImpl.createChecker(CheckstyleActionsImpl.java:56)
at org.infernus.idea.checkstyle.service.CheckstyleActionsImpl.createChecker(CheckstyleActionsImpl.java:47)
at org.infernus.idea.checkstyle.checker.CheckerFactoryWorker.run(CheckerFactoryWorker.java:44)
对任何人都熟悉吗?
答案 0 :(得分:1)
我在将项目从WAS 8
迁移到WAS Liberty
时遇到了同样的问题。
我确实将jar commons-collections.jar
复制到服务器位置/servers/<server_name>/lib/global
并解决了它。
因此,请尝试将jar放在IntelliJ本地服务器上。
java.lang.NoClassDefFoundError: org.apache.commons.collections.FastHashMap
at org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptor(PropertyUtilsBean.java:963)
at org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.java:935)
at org.apache.commons.beanutils.BeanUtilsBean.populate(BeanUtilsBean.java:823)
at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:431)
at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252)