Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to import AB3 checkstyle.xml #111

Closed
shawnkoh opened this issue Oct 3, 2019 · 3 comments
Closed

Unable to import AB3 checkstyle.xml #111

shawnkoh opened this issue Oct 3, 2019 · 3 comments

Comments

@shawnkoh
Copy link

shawnkoh commented Oct 3, 2019

Environment

Describe your development environment

  • IntelliJ version:
IntelliJ IDEA 2019.2.3 (Ultimate Edition)
Build #IU-192.6817.14, built on September 24, 2019
Non-Bundled Plugins: CheckStyle-IDEA
  • Java version:
openjdk 11.0.2 2019-01-15
OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)
  • Operating system version: macOS Mojave 10.14.6

Issue

Attempted but unable to import checkstyle.xml using CheckStyle-IDEA, through Preferences --> Checkstyle --> +

Code/Log Trace

com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot initialize module TreeWalker - cannot initialize module FileContentsHolder - Unable to instantiate 'FileContentsHolder' class, it is also not possible to instantiate it as .FileContentsHolder, FileContentsHolderCheck, .FileContentsHolderCheck. Please recheck that class name is specified as canonical name or read how to configure short name usage https://checkstyle.org/config.html#Packages. Please also recheck that provided ClassLoader to Checker is configured correctly.
	at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:477)
	at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:198)
	at org.infernus.idea.checkstyle.service.cmd.OpCreateChecker.execute(OpCreateChecker.java:61)
	at org.infernus.idea.checkstyle.service.cmd.OpCreateChecker.execute(OpCreateChecker.java:26)
	at org.infernus.idea.checkstyle.service.CheckstyleActionsImpl.executeCommand(CheckstyleActionsImpl.java:130)
	at org.infernus.idea.checkstyle.service.CheckstyleActionsImpl.createChecker(CheckstyleActionsImpl.java:60)
	at org.infernus.idea.checkstyle.service.CheckstyleActionsImpl.createChecker(CheckstyleActionsImpl.java:51)
	at org.infernus.idea.checkstyle.checker.CheckerFactoryWorker.run(CheckerFactoryWorker.java:46)
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot initialize module FileContentsHolder - Unable to instantiate 'FileContentsHolder' class, it is also not possible to instantiate it as .FileContentsHolder, FileContentsHolderCheck, .FileContentsHolderCheck. Please recheck that class name is specified as canonical name or read how to configure short name usage https://checkstyle.org/config.html#Packages. Please also recheck that provided ClassLoader to Checker is configured correctly.
	at com.puppycrawl.tools.checkstyle.TreeWalker.setupChild(TreeWalker.java:136)
	at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:198)
	at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:472)
	... 7 more
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Unable to instantiate 'FileContentsHolder' class, it is also not possible to instantiate it as .FileContentsHolder, FileContentsHolderCheck, .FileContentsHolderCheck. Please recheck that class name is specified as canonical name or read how to configure short name usage https://checkstyle.org/config.html#Packages. Please also recheck that provided ClassLoader to Checker is configured correctly.
	at com.puppycrawl.tools.checkstyle.PackageObjectFactory.createModule(PackageObjectFactory.java:210)
	at com.puppycrawl.tools.checkstyle.TreeWalker.setupChild(TreeWalker.java:127)
	... 9 more

@shaoyi1997
Copy link

shaoyi1997 commented Oct 4, 2019

Is your Checkstyle version in your settings set to 8.1?

image

I looked through the release notes for Checkstyle and found that version 8.2 removed the FileContentsHolder module, which would explain the failure to instantiate the module and thereby, the exception thrown since Gradle uses version 8.1.

I changed my checkstyle version to 8.24 and received the same error that you received as well.

@damithc damithc added the week.7 label Oct 4, 2019
@damithc
Copy link
Collaborator

damithc commented Oct 4, 2019

I looked through the release notes for Checkstyle and found that version 8.2 removed the FileContentsHolder module, which would explain the failure to instantiate the module and thereby, the exception thrown since Gradle uses version 8.1.

I changed my checkstyle version to 8.24 and received the same error that you received as well.

Kudos for the taking extra effort to look into the problem @shaoyi1997 👍

@damithc
Copy link
Collaborator

damithc commented Oct 10, 2019

@shawnkoh the problem resolved? If yes, go ahead and close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants