Re: Checkstyle-user Digest, Vol 16, Issue 7
"George Smith" <[email protected]>
| Newsgroups | gmane.comp.java.audit.checkstyle.user |
|---|---|
| Message-ID | <[email protected]> |
Yes, I have tried both ways. I emailed you the jar file that I created, and the source code for the check. I'd appreciate it if you could take a quick look at it and tell me what I am doing wrong. It's my first attempt at a custom check. I thought I followed the documentation pretty closely. Any help you can provide will be appreciated. > > 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 ------------------------------------------------------------------------- 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/