2017-09-04 106 views
1

我在我的Ubuntu 17 dekstop上运行了Intellij 2017.2.3和Checkstyle-IDEA 5.10.0。当我尝试添加的CheckStyle为我的Java项目(在设置 - >其他设置 - > Checkstyle的)我收到此错误信息:Intellij Checkstyle给出错误NoClassDefFoundError

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

您可能希望在https://github.com/checkstyle/checkstyle/issues报告此问题。 – CrazyCoder

+0

由于这发生在IDEA内部,因此它们应该是您的第一个联系人,因为Checkstyle的发布版本包含'commons-collections',可以毫无问题地工作。 https://github.com/jshiell/checkstyle-idea – rveach

+0

引发[Checkstyle-IDEA]问题(https://github.com/jshiell/checkstyle-idea/issues)。他们会想知道在命令行中运行Checkstyle时是否会发生这种情况。提供完整的配置文件。 –

回答

1

我在将项目从WAS 8迁移到WAS Liberty时遇到了同样的问题。 我没有将罐子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) 
+0

如何知道本地服务器在哪里?我使用Ubuntu 17.10。 – Solo