unable to instantiate 'CatchParameterName' class

1,592 views
Skip to first unread message

Greg Tomkins

unread,
Dec 4, 2015, 7:05:17 PM12/4/15
to checkstyle
I'm brand new to checkstyle, just trying to get a basic command line example working. I tried both the 6.12 and 6.13 jar's. I am following the instructions from here: http://checkstyle.sourceforge.net/cmdline.html. The files google_style.xml and MyClass.java both exist and are readable. I assume the '-all' jar includes all required dependencies, isn't that what '-all' means?. If so, what's wrong?

command:

java -jar /tmp/checkstyle-6.12-all.jar -c google_style.xml MyClass.java

result:

com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot initialize module TreeWalker - Unable to instantiate 'CatchParameterName' class, it is also not possible to instantiate it as com.puppycrawl.tools.checkstyle.checks.annotation.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.blocks.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.coding.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.design.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.header.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.imports.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.indentation.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.javadoc.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.metrics.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.modifier.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.naming.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.regexp.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.sizes.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.whitespace.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.CatchParameterName, com.puppycrawl.tools.checkstyle.filters.CatchParameterName, com.puppycrawl.tools.checkstyle.CatchParameterName. Please recheck that class name is specified as canonical name or read how to configure short name usage http://checkstyle.sourceforge.net/config.html#Packages. Please also recheck that provided ClassLoader to Checker is configured correctly.
        at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:168)
        at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:138)
        at com.puppycrawl.tools.checkstyle.Main.runCheckstyle(Main.java:263)
        at com.puppycrawl.tools.checkstyle.Main.main(Main.java:119)
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Unable to instantiate 'CatchParameterName' class, it is also not possible to instantiate it as com.puppycrawl.tools.checkstyle.checks.annotation.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.blocks.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.coding.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.design.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.header.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.imports.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.indentation.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.javadoc.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.metrics.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.modifier.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.naming.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.regexp.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.sizes.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.whitespace.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.CatchParameterName, com.puppycrawl.tools.checkstyle.filters.CatchParameterName, com.puppycrawl.tools.checkstyle.CatchParameterName. Please recheck that class name is specified as canonical name or read how to configure short name usage http://checkstyle.sourceforge.net/config.html#Packages. Please also recheck that provided ClassLoader to Checker is configured correctly.
        at com.puppycrawl.tools.checkstyle.PackageObjectFactory.createModule(PackageObjectFactory.java:163)
        at com.puppycrawl.tools.checkstyle.TreeWalker.setupChild(TreeWalker.java:171)
        at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:138)
        at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:163)
        ... 3 more
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Unable to instantiate 'CatchParameterNameCheck' class, it is also not possible to instantiate it as com.puppycrawl.tools.checkstyle.checks.annotation.CatchParameterNameCheck, com.puppycrawl.tools.checkstyle.checks.blocks.CatchParameterNameCheck, com.puppycrawl.tools.checkstyle.checks.coding.CatchParameterNameCheck, com.puppycrawl.tools.checkstyle.checks.design.CatchParameterNameCheck, com.puppycrawl.tools.checkstyle.checks.header.CatchParameterNameCheck, com.puppycrawl.tools.checkstyle.checks.imports.CatchParameterNameCheck, com.puppycrawl.tools.checkstyle.checks.indentation.CatchParameterNameCheck, com.puppycrawl.tools.checkstyle.checks.javadoc.CatchParameterNameCheck, com.puppycrawl.tools.checkstyle.checks.metrics.CatchParameterNameCheck, com.puppycrawl.tools.checkstyle.checks.modifier.CatchParameterNameCheck, com.puppycrawl.tools.checkstyle.checks.naming.CatchParameterNameCheck, com.puppycrawl.tools.checkstyle.checks.regexp.CatchParameterNameCheck, com.puppycrawl.tools.checkstyle.checks.sizes.CatchParameterNameCheck, com.puppycrawl.tools.checkstyle.checks.whitespace.CatchParameterNameCheck, com.puppycrawl.tools.checkstyle.checks.CatchParameterNameCheck, com.puppycrawl.tools.checkstyle.filters.CatchParameterNameCheck, com.puppycrawl.tools.checkstyle.CatchParameterNameCheck. Please recheck that class name is specified as canonical name or read how to configure short name usage http://checkstyle.sourceforge.net/config.html#Packages. Please also recheck that provided ClassLoader to Checker is configured correctly.
        at com.puppycrawl.tools.checkstyle.PackageObjectFactory.doMakeObject(PackageObjectFactory.java:115)
        at com.puppycrawl.tools.checkstyle.PackageObjectFactory.createModule(PackageObjectFactory.java:156)
        ... 6 more
Checkstyle ends with 1 errors.
 

R Veach

unread,
Dec 4, 2015, 7:28:04 PM12/4/15
to checkstyle
The module 'CatchParameterName' is brand new (2 weeks old) and hasn't been released yet in any of the jars.
I assume you must have downloaded google_style.xml from our github?
Try running with the google_style that comes with the jar.

java -jar /tmp/checkstyle-6.12-all.jar -c /google_checks.xml MyClass.java

Roman Ivanov

unread,
Dec 5, 2015, 7:45:07 AM12/5/15
to R Veach, checkstyle
Please use(attention to the slash):

java -jar /tmp/checkstyle-6.12-all.jar -c /google_style.xml MyClass.java

it will use config that is embedded to the jar, and it is tested to works fine with version of Checkstyle that you use. We already have 6.12.1 and 6.13.


--
You received this message because you are subscribed to the Google Groups "checkstyle" group.
To unsubscribe from this group and stop receiving emails from it, send an email to checkstyle+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages