Re: Checkstyle Custom rule fails to instantiate
"Mark Tymieniecki" <[email protected]> Fri, 3 Feb 2012 17:25:13 -0000
| Newsgroups | gmane.comp.java.audit.checkstyle.user |
|---|---|
| Message-ID | <[email protected]> |
This is a multipart message in MIME format. --===============3137908786621679507== Content-Type: multipart/alternative; boundary="----=_NextPart_000_0011_01CCE298.CA091140" Content-Language: en-gb This is a multipart message in MIME format. ------=_NextPart_000_0011_01CCE298.CA091140 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Oliver, =20 Many thanks for that, it ran slower so was obviously trying something = but still with the same result. I amdefinitely doing something blindingly obvious and probably very stupid, but for the life of me cannot fathom = what ! Regards =20 From: Oliver Burn [mailto:[email protected]]=20 Sent: 02 February 2012 20:05 To: [email protected] Subject: Re: [Checkstyle-user] Checkstyle Custom rule fails to = instantiate =20 In the file "client_checks.xml" how is the "LoggerAttr" module defined? = Try using the fully qualified class name. On Thu, Feb 2, 2012 at 23:25, Mark Tymieniecki <[email protected]> wrote: Hi Lars, I am running Windows 7, and have set CLASSPATH correctly(trying both \ = and / in that path!), but cannot run directly from another folder so have to = use the -JAR option and then with the full path. This is what it all end up looking like: C:\02-Client-Code\Client\Checkstyle>java -D64 -jar c:/checkstyle-5.5/checkstyle-5.5-all.jar -c "C:/02-Client-Code/Client/Checkstyle/client_checks.xml" -f xml -o C:/02-Client-Code/Client/Checkstyle/Client_checkstyle_errors.xml = -r "E:/Eclipse Projects/Client_Rules_Test/src" Unable to create Checker: cannot initialize module TreeWalker - Unable = to instantiate LoggerAttr com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot = initialize module TreeWalker - Unable to instantiate LoggerAttr at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:178) at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(Automatic Bean.java:184) at = com.puppycrawl.tools.checkstyle.Main.createChecker(Main.java:143) at com.puppycrawl.tools.checkstyle.Main.main(Main.java:120) Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: = Unable to instantiate LoggerAttr at com.puppycrawl.tools.checkstyle.PackageObjectFactory.createModule(Package= Obj ectFactory.java:155) at com.puppycrawl.tools.checkstyle.TreeWalker.setupChild(TreeWalker.java:161= ) at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean= .ja va:184) at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:157) ... 3 more Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: = Unable to instantiate LoggerAttrCheck at com.puppycrawl.tools.checkstyle.PackageObjectFactory.doMakeObject(Package= Obj ectFactory.java:98) at com.puppycrawl.tools.checkstyle.PackageObjectFactory.createModule(Package= Obj ectFactory.java:152) ... 6 more This is very worrying as I have now tried it on three platforms and get = the same result each time. Regards -----Original Message----- From: Lars K=F6dderitzsch [mailto:[email protected]] Sent: 01 February 2012 18:16 To: [email protected] Subject: Re: [Checkstyle-user] Checkstyle Custom rule fails to = instantiate Hello Mark, if I got it right you need to fully specify each jar in the CLASSPATH variable (or via -cp cmd line option) or use a classpath wildcard to = pick up all jars in a folder (e.g. foo/*). http://docs.oracle.com/javase/7/docs/technotes/tools/windows/classpath.ht= ml HTH, Lars | Snipped for less scrolling -------------------------------------------------------------------------= --- -- Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers = is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, = Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ Checkstyle-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/checkstyle-user -------------------------------------------------------------------------= --- -- Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ Checkstyle-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/checkstyle-user =20 ------=_NextPart_000_0011_01CCE298.CA091140 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; = charset=3Diso-8859-1"> <html xmlns:v=3D"urn:schemas-microsoft-com:vml" = xmlns:o=3D"urn:schemas-microsoft-com:office:office" = xmlns:w=3D"urn:schemas-microsoft-com:office:word" = xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" = xmlns=3D"http://www.w3.org/TR/REC-html40"><head><meta name=3DGenerator = content=3D"Microsoft Word 14 (filtered medium)"><style><!-- /* Font Definitions */ @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4;} @font-face {font-family:Tahoma; panose-1:2 11 6 4 3 5 4 4 2 4;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0cm; margin-bottom:.0001pt; font-size:12.0pt; font-family:"Times New Roman","serif";} a:link, span.MsoHyperlink {mso-style-priority:99; color:blue; text-decoration:underline;} a:visited, span.MsoHyperlinkFollowed {mso-style-priority:99; color:purple; text-decoration:underline;} p.MsoAcetate, li.MsoAcetate, div.MsoAcetate {mso-style-priority:99; mso-style-link:"Balloon Text Char"; margin:0cm; margin-bottom:.0001pt; font-size:8.0pt; font-family:"Tahoma","sans-serif";} span.EmailStyle17 {mso-style-type:personal-reply; font-family:"Times New Roman","serif"; color:#1F497D;} span.BalloonTextChar {mso-style-name:"Balloon Text Char"; mso-style-priority:99; mso-style-link:"Balloon Text"; font-family:"Tahoma","sans-serif"; mso-fareast-language:EN-GB;} .MsoChpDefault {mso-style-type:export-only; font-family:"Calibri","sans-serif"; mso-fareast-language:EN-US;} @page WordSection1 {size:612.0pt 792.0pt; margin:72.0pt 72.0pt 72.0pt 72.0pt;} div.WordSection1 {page:WordSection1;} --></style><!--[if gte mso 9]><xml> <o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" /> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext=3D"edit"> <o:idmap v:ext=3D"edit" data=3D"1" /> </o:shapelayout></xml><![endif]--></head><body lang=3DEN-GB link=3Dblue = vlink=3Dpurple><div class=3DWordSection1><p class=3DMsoNormal><span = style=3D'font-size:11.0pt;color:#1F497D'>Hi = Oliver,<o:p></o:p></span></p><p class=3DMsoNormal><span = style=3D'font-size:11.0pt;color:#1F497D'><o:p> </o:p></span></p><p = class=3DMsoNormal><span style=3D'font-size:11.0pt;color:#1F497D'>Many = thanks for that, it ran slower so was obviously trying something but = still with the same result. I amdefinitely doing something blindingly = obvious and probably very stupid, but for the life of me cannot fathom = what !<o:p></o:p></span></p><p class=3DMsoNormal><span = style=3D'font-size:11.0pt;color:#1F497D'>Regards<o:p></o:p></span></p><p = class=3DMsoNormal><span = style=3D'font-size:11.0pt;color:#1F497D'><o:p> </o:p></span></p><p = class=3DMsoNormal><b><span lang=3DEN-US = style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span>= </b><span lang=3DEN-US = style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Oliver = Burn [mailto:[email protected]] <br><b>Sent:</b> 02 February 2012 = 20:05<br><b>To:</b> = [email protected]<br><b>Subject:</b> Re: = [Checkstyle-user] Checkstyle Custom rule fails to = instantiate<o:p></o:p></span></p><p = class=3DMsoNormal><o:p> </o:p></p><p class=3DMsoNormal = style=3D'margin-bottom:12.0pt'>In the file "client_checks.xml" = how is the "LoggerAttr" module defined? Try using the fully = qualified class name.<o:p></o:p></p><div><p class=3DMsoNormal>On Thu, = Feb 2, 2012 at 23:25, Mark Tymieniecki <<a = href=3D"mailto:[email protected]">[email protected]</a>> = wrote:<o:p></o:p></p><p class=3DMsoNormal>Hi Lars,<br><br>I am running = Windows 7, and have set CLASSPATH correctly(trying both \ and /<br>in = that path!), but cannot run directly from another folder so have to = use<br>the -JAR option and then with the full path.<br>This is what it = all end up looking = like:<br><br>C:\02-Client-Code\Client\Checkstyle>java -D64 = -jar<br>c:/checkstyle-5.5/checkstyle-5.5-all.jar = -c<br>"C:/02-Client-Code/Client/Checkstyle/client_checks.xml" = -f<br> xml -o = C:/02-Client-Code/Client/Checkstyle/Client_checkstyle_errors.xml = -r<br>"E:/Eclipse Projects/Client_Rules_Test/src"<br>Unable to = create Checker: cannot initialize module TreeWalker - Unable = to<br>instantiate = LoggerAttr<br>com.puppycrawl.tools.checkstyle.api.CheckstyleException: = cannot initialize<br>module TreeWalker - Unable to instantiate = LoggerAttr<br> = at<br>com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.ja= va:178)<br> = at<br>com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(A= utomatic<br>Bean.java:184)<br> at = com.puppycrawl.tools.checkstyle.Main.createChecker(Main.java:143)<br>&nbs= p; at = com.puppycrawl.tools.checkstyle.Main.main(Main.java:120)<br>Caused by: = com.puppycrawl.tools.checkstyle.api.CheckstyleException: Unable<br>to = instantiate LoggerAttr<br> = at<br>com.puppycrawl.tools.checkstyle.PackageObjectFactory.createMo= dule(PackageObj<br>ectFactory.java:155)<br> = at<br>com.puppycrawl.tools.checkstyle.TreeWalker.setupChild(TreeWal= ker.java:161)<br> = at<br>com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(A= utomaticBean.ja<br>va:184)<br> = at<br>com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.ja= va:157)<br>... 3 more<br>Caused by: = com.puppycrawl.tools.checkstyle.api.CheckstyleException: Unable<br>to = instantiate LoggerAttrCheck<br> = at<br>com.puppycrawl.tools.checkstyle.PackageObjectFactory.doMakeOb= ject(PackageObj<br>ectFactory.java:98)<br> = at<br>com.puppycrawl.tools.checkstyle.PackageObjectFactory.createMo= dule(PackageObj<br>ectFactory.java:152)<br> = ... 6 more<br><br>This is very worrying as I have now tried it on = three platforms and get the<br>same result each = time.<br><br>Regards<br>-----Original Message-----<br>From: Lars = K=F6dderitzsch [mailto:<a = href=3D"mailto:[email protected]">[email protected]</a>]<br>Sen= t: 01 February 2012 18:16<br>To: <a = href=3D"mailto:[email protected]">checkstyle-user@lis= ts.sourceforge.net</a><br>Subject: Re: [Checkstyle-user] Checkstyle = Custom rule fails to instantiate<br><br>Hello Mark,<br><br>if I got it = right you need to fully specify each jar in the CLASSPATH<br>variable = (or via -cp cmd line option) or use a classpath wildcard to pick = up<br>all jars in a folder (e.g. foo/*).<br><br><a = href=3D"http://docs.oracle.com/javase/7/docs/technotes/tools/windows/clas= spath.html" = target=3D"_blank">http://docs.oracle.com/javase/7/docs/technotes/tools/wi= ndows/classpath.html</a><br><br>HTH,<br>Lars<br><br>| Snipped for less = scrolling<br><br><br><br>------------------------------------------------= ----------------------------<br>--<br>Keep Your Developer Skills Current = with LearnDevNow!<br>The most comprehensive online learning library for = Microsoft developers is<br>just $99.99! Visual Studio, SharePoint, SQL - = plus HTML5, CSS3, MVC3, Metro<br>Style Apps, more. Free future releases = when you subscribe now!<br><a = href=3D"http://p.sf.net/sfu/learndevnow-d2d" = target=3D"_blank">http://p.sf.net/sfu/learndevnow-d2d</a><br>____________= ___________________________________<br>Checkstyle-user mailing = list<br><a = href=3D"mailto:[email protected]">Checkstyle-user@lis= ts.sourceforge.net</a><br><a = href=3D"https://lists.sourceforge.net/lists/listinfo/checkstyle-user" = target=3D"_blank">https://lists.sourceforge.net/lists/listinfo/checkstyle= -user</a><br><br><br>----------------------------------------------------= --------------------------<br>Keep Your Developer Skills Current with = LearnDevNow!<br>The most comprehensive online learning library for = Microsoft developers<br>is just $99.99! Visual Studio, SharePoint, SQL - = plus HTML5, CSS3, MVC3,<br>Metro Style Apps, more. Free future releases = when you subscribe now!<br><a = href=3D"http://p.sf.net/sfu/learndevnow-d2d" = target=3D"_blank">http://p.sf.net/sfu/learndevnow-d2d</a><br>____________= ___________________________________<br>Checkstyle-user mailing = list<br><a = href=3D"mailto:[email protected]">Checkstyle-user@lis= ts.sourceforge.net</a><br><a = href=3D"https://lists.sourceforge.net/lists/listinfo/checkstyle-user" = target=3D"_blank">https://lists.sourceforge.net/lists/listinfo/checkstyle= -user</a><o:p></o:p></p></div><p = class=3DMsoNormal><o:p> </o:p></p></div></body></html> ------=_NextPart_000_0011_01CCE298.CA091140-- --===============3137908786621679507== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 --===============3137908786621679507== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Checkstyle-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/checkstyle-user --===============3137908786621679507==--