Problem while configuring a new custom check
KiranKumar <[email protected]> Tue, 8 Sep 2009 22:42:53 -0700 (PDT)
| Newsgroups | gmane.comp.java.audit.checkstyle.user |
|---|---|
| Message-ID | <[email protected]> |
Hi All,
I have one requirement to extend Checkstyle with custom checks for my
project.
I have tried to run / configure one example and it didn't get through.
Please find the details below.
Please find the Java source file which has been attached.
Configuration file is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<!-- <!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration
1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd"> -->
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
"D:/configuration_1_2.dtd">
<module name="Checker">
<module name="TreeWalker">
<module name="ThrowsRException"/>
</module>
</module>
The command i have used to run the example is:
java -classpath D:\checkstyle-5.0\checkstyle-all-5.0.jar
com.puppycrawl.tools.checkstyle.Main -c
D:\PluginsWorkspace\Plugin\src\com\abc\plugin\custom_check.xml
D:\PluginsWorkspace\Plugin\src\com\abc\plugin\TestCaseException.java
And finally the error log is:
Unable to create Checker: cannot initialize module TreeWalker - Unable to
instan
tiate com.abc.plugin.ThrowsRException
com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot initialize
modul
e TreeWalker - Unable to instantiate com.abc.plugin.ThrowsRException
at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:177)
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(Automatic
Bean.java:207)
at com.puppycrawl.tools.checkstyle.Main.createChecker(Main.java:138)
at com.puppycrawl.tools.checkstyle.Main.main(Main.java:115)
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Unable
to in
stantiate com.abc.plugin.ThrowsRException
at com.puppycrawl.tools.checkstyle.PackageObjectFactory.createModule(Pac
kageObjectFactory.java:156)
at com.puppycrawl.tools.checkstyle.TreeWalker.setupChild(TreeWalker.java
:159)
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(Automatic
Bean.java:207)
at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:156)
... 3 more
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Unable
to in
stantiate com.abc.plugin.ThrowsRExceptionCheck
at com.puppycrawl.tools.checkstyle.PackageObjectFactory.doMakeObject(Pac
kageObjectFactory.java:99)
at com.puppycrawl.tools.checkstyle.PackageObjectFactory.createModule(Pac
kageObjectFactory.java:153)
... 6 more
Please let me know if anyone has any clue.
http://www.nabble.com/file/p25358516/ThrowsRException.java
ThrowsRException.java
P.S. I hope that it is a configuration problem OR the way i have been trying
to run the Check is a problem.
Thanks and Regards
Kiran
--
View this message in context: http://www.nabble.com/Problem-while-configuring-a-new-custom-check-tp25358516p25358516.html
Sent from the CheckStyle - User mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july