Re: custom check

"Oliver Burn" <[email protected]>
Newsgroups gmane.comp.java.audit.checkstyle.user
Message-ID <[email protected]>
Have you tried using the fully qualified class name. For example "
com.puppycrawl.tools.checkstyle.checks.imports.ImportControlCheck"

If that works, the class if definitely in your classpath.

On 8/28/07, George Smith <[email protected]> wrote:
>
> I created a custom check called TestNGTestHasGroup. When I try to use
> it, I keep getting an error that says:
>
> Embedded error: Error rendering Maven report: Failed during checkstyle
> configuration
> Unable to instantiate TestNGTestHasGroupCheck
>
> I get the following stack trace:
>
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Trace
> org.apache.maven.lifecycle.LifecycleExecutionException: Error during
> page generation
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
> DefaultLifecycleExecutor.java:564)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle
> (DefaultLifecycleExecutor.java:480)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
> (DefaultLifecycleExecutor.java:459)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
> (DefaultLifecycleExecutor.java:311)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
> DefaultLifecycleExecutor.java:278)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(
> DefaultLifecycleExecutor.java:143)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java
> :315)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>         at org.codehaus.classworlds.Launcher.mainWithExitCode(
> Launcher.java:430)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.plugin.MojoExecutionException: Error
> during page generation
>         at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java
> :97)
>         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(
> DefaultPluginManager.java:443)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
> DefaultLifecycleExecutor.java:539)
>         ... 16 more
> Caused by: org.apache.maven.doxia.siterenderer.RendererException:
> Error rendering Maven report: Failed during checkstyle configuration
>         at
> org.apache.maven.plugins.site.ReportDocumentRenderer.renderDocument(
> ReportDocumentRenderer.java:71)
>         at
> org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderModule(
> DefaultSiteRenderer.java:239)
>         at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render(
> DefaultSiteRenderer.java:115)
>         at org.apache.maven.plugins.site.SiteMojo.renderLocale(
> SiteMojo.java:124)
>         at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java
> :92)
>         ... 18 more
> Caused by: org.apache.maven.reporting.MavenReportException: Failed
> during checkstyle configuration
>         at
> org.apache.maven.plugin.checkstyle.CheckstyleReport.executeReport(
> CheckstyleReport.java:488)
>         at org.apache.maven.reporting.AbstractMavenReport.generate(
> AbstractMavenReport.java:98)
>         at
> org.apache.maven.plugins.site.ReportDocumentRenderer.renderDocument(
> ReportDocumentRenderer.java:67)
>         ... 22 more
> Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException:
> cannot initialize module TreeWalker - Unable to instantiate
> TestNGTestHasGroup
>         at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java
> :165)
>         at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(
> AutomaticBean.java:209)
>         at
> org.apache.maven.plugin.checkstyle.CheckstyleReport.executeCheckstyle(
> CheckstyleReport.java:723)
>         at
> org.apache.maven.plugin.checkstyle.CheckstyleReport.executeReport(
> CheckstyleReport.java:484)
>         ... 24 more
> Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException:
> Unable to instantiate TestNGTestHasGroup
>         at
> com.puppycrawl.tools.checkstyle.PackageObjectFactory.createModule(
> PackageObjectFactory.java:152)
>         at com.puppycrawl.tools.checkstyle.TreeWalker.setupChild(
> TreeWalker.java:213)
>         at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(
> AutomaticBean.java:209)
>         at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java
> :144)
>         ... 27 more
> Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException:
> Unable to instantiate TestNGTestHasGroupCheck
>         at
> com.puppycrawl.tools.checkstyle.PackageObjectFactory.doMakeObject(
> PackageObjectFactory.java:94)
>         at
> com.puppycrawl.tools.checkstyle.PackageObjectFactory.createModule(
> PackageObjectFactory.java:149)
>         ... 30 more
>
> I have tried having the classname end with "Check" and without the
> classname ending with "Check" but nothing seems to work. I don't get a
> maven dependency error, so I assume that the jar file is being
> resolved to the classpath. I set up the jar structure as in the
> Checkstyle documentation. I'm baffled. I'm sure it something simple,
> that I'm just doing wrong. Any help would be appreciated.
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >>  http://get.splunk.com/
> _______________________________________________
> Checkstyle-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/checkstyle-user
>

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

_______________________________________________
Checkstyle-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.