Re: Can't read Checkstyle configuration

"Lars Kühne" <[email protected]> Thu, 6 Nov 2008 20:28:44 +0100
Newsgroups gmane.comp.java.audit.checkstyle.user
Message-ID <[email protected]>
On Thu, Nov 6, 2008 at 5:15 PM, Lewis, Eric wrote

> jboss@xyz /ige/temp/continuous_integration/ipi-utils/time-util/target$
> more checkstyle-checker.xml
> <?xml version="1.0" encoding="UTF-8"?>
>
> <!DOCTYPE checkstyle-packages PUBLIC
>    "-//Puppy Crawl//DTD Package Names 1.0//EN"
>    "http://www.puppycrawl.com/dtds/packages_1_0.dtd">
>
> <module name="Checker">
>  <module name="PackageHtml" />
>


The DOCTYPE is incorrect. According to
http://checkstyle.sourceforge.net/config.html#XML%20Details, the checker
configuration file should say something like this:

<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">


What happens below is that Checkstyle tries to validate the configuration
file against a DTD. The System ID you are using is not registered with the
XML parser, so the parser tries to download the DTD from puppycrawl.com.
This fails, probably because you'd have to use a HTTP proxy to access the
internet from your machine.

Note that once you correct the DOCTYPE definition, the corresponding DTDs
are built in to Checkstyle and it won't try to phone home.

Cheers,
Lars



> [...]
> Caused by: java.net.ConnectException: Connection timed out
>        at java.net.PlainSocketImpl.socketConnect(Native Method)
>        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
>        at
> java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
>        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
>        at java.net.Socket.connect(Socket.java:519)
>        at [...]
>        at
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnec
> tion.java:977)
>        at
> com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEnt
> ity(XMLEntityManager.java:677)
>        at
> com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XML
> EntityManager.java:1315)
>        at
> com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(
> XMLEntityManager.java:1282)
>        at
> com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource
> (XMLDTDScannerImpl.java:283)
>        at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver
> .dispatch(XMLDocumentScannerImpl.java:1176)
>        at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver
> .next(XMLDocumentScannerImpl.java:1075)
>        at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDri
> ver.next(XMLDocumentScannerImpl.java:993)
>        at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLD
> ocumentScannerImpl.java:647)
>        at
> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XM
> LNSDocumentScannerImpl.java:140)
>        at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.s
> canDocument(XMLDocumentFragmentScannerImpl.java:508)
>        at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML1
> 1Configuration.java:807)
>        at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML1
> 1Configuration.java:737)
>        at
> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.jav
> a:107)
>        at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Abstr
> actSAXParser.java:1205)
>        at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.pars
> e(SAXParserImpl.java:522)
>        at
> com.puppycrawl.tools.checkstyle.api.AbstractLoader.parseInputSource(Abst
> ractLoader.java:96)
>        at
> com.puppycrawl.tools.checkstyle.ConfigurationLoader.parseInputStream(Con
> figurationLoader.java:255)
>        at
> com.puppycrawl.tools.checkstyle.ConfigurationLoader.loadConfiguration(Co
> nfigurationLoader.java:344)
>        ... 23 more
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Checkstyle-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/checkstyle-user
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

_______________________________________________
Checkstyle-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user