Got an exception - java.lang.RuntimeException: Unable to get class information for @throws tag 'XXXException'.
2009-08-20 16:28
966 查看
This message can be quite confusing. The cause of this message cannot be easily guessed from the error message CheckStyle gives.
The
cause is that the class ConfigurationException, which is mentioned in
BasicPDFBuilder is not in the run classpath of Checkstyle, so
checkstyle cannot perform any checks on whether it is a checked
exception or a runtime exception or other. So this is not really a
warning about your code being bad, but a warning about checkstyle being
unable to fully check whether the import and usage of the class
ConfigurationException conforms to the coding styles configured.
So
you need to modify the ant scriptlet which runs your checkstyle (-when
running checkstyle locally, during automatic screening there's nothing
you can do about it..) to include all libraries in the run classpath:
Note: the files tc_checks.xml and tc_test_checks.xml can be obtained here: http://www.topcoder.com/tc?module=Static&d1=dev&d2=support&d3=compDocumentation
For
this message to not occur during automatic screening some admin needs
to fix this thing on the TC server, but as this classpath is
component-dependant (each component uses different libraries) and I
assume that the checks performed during automatic screening use one
generic script for all submissons of all components, this would be a
bigger change on the TC automatic screening implementation (even more
complicated: if the submitter added some 3rd-party libraries, that were
not part of CS in its submission).
So in general add the code mentioned above in your local build.xml (ivern
,
perhaps you could add this to the dev dist jars as a convenience...)
and add checkstyle to your ant classpath, then check locally and fix
the things you want. Afterwards you dont't need to look at the
checkstyle results during automatic screening(as they should be
identical to the local check results ) and instead only need to check
the results of the other automatic-screening-modules (like your name
found in your submission).
The
cause is that the class ConfigurationException, which is mentioned in
BasicPDFBuilder is not in the run classpath of Checkstyle, so
checkstyle cannot perform any checks on whether it is a checked
exception or a runtime exception or other. So this is not really a
warning about your code being bad, but a warning about checkstyle being
unable to fully check whether the import and usage of the class
ConfigurationException conforms to the coding styles configured.
So
you need to modify the ant scriptlet which runs your checkstyle (-when
running checkstyle locally, during automatic screening there's nothing
you can do about it..) to include all libraries in the run classpath:
<taskdef resource="checkstyletask.properties" /> <target name="checkstyle" depends="compile" > <mkdir dir="${testlogdir}" /> <checkstyle failonviolation="false" config="../tc_checks.xml" > <classpath> <path refid="buildlibs" /> <pathelement location="${build_classdir}" /> </classpath> <fileset dir="${javamain}" includes="**/*.java" /> <formatter type="plain" toFile="${testlogdir}/checkstyle.txt" /> </checkstyle> </target> <target name="checkstyle_tests" depends="compile_tests" > <mkdir dir="${testlogdir}" /> <checkstyle failonviolation="false" config="../tc_test_checks.xml" > <classpath> <path refid="buildlibs" /> <pathelement location="${javatests}" /> </classpath> <fileset dir="${javatests}/${packagedir}/" includes="**/*.java" excludes="UnitTests.java, AllTests.java, stresstests/*, failuretests/*, accuracytests/*" /> <formatter type="plain" toFile="${testlogdir}/checkstyletest.txt" /> </checkstyle> </target>
Note: the files tc_checks.xml and tc_test_checks.xml can be obtained here: http://www.topcoder.com/tc?module=Static&d1=dev&d2=support&d3=compDocumentation
For
this message to not occur during automatic screening some admin needs
to fix this thing on the TC server, but as this classpath is
component-dependant (each component uses different libraries) and I
assume that the checks performed during automatic screening use one
generic script for all submissons of all components, this would be a
bigger change on the TC automatic screening implementation (even more
complicated: if the submitter added some 3rd-party libraries, that were
not part of CS in its submission).
So in general add the code mentioned above in your local build.xml (ivern
,
perhaps you could add this to the dev dist jars as a convenience...)
and add checkstyle to your ant classpath, then check locally and fix
the things you want. Afterwards you dont't need to look at the
checkstyle results during automatic screening(as they should be
identical to the local check results ) and instead only need to check
the results of the other automatic-screening-modules (like your name
found in your submission).
相关文章推荐
- checkstyle问题:解决Got an exception - java.lang.RuntimeException: Unable to get class information for ***Exception
- Checkstyle "Unable to get class information for @throws tag 'xxxException" 问题
- Unable to find a value for "dwmc" in object of class "java.lang.String" using operator "." (null
- Android开发中java.lang.RuntimeException: Unable to start activity ComponentInfo{xxx}: java.lang.NullPoi
- Android开发中java.lang.RuntimeException: Unable to start activity ComponentInfo{xxx}: java.lang.NullPointerException 错误的集中原因及解决办法
- android中遇到java.lang.NumberFormatException: unable to parse 'null' as integer此类问题的原因及解决方法
- Caused by: java.lang.RuntimeException: Unable to bind views for xxActivity
- Test run failed: Instrumentation run failed due to 'java.lang.ClassNotFoundException'
- org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'funcSetId' in 'class java.lang.Integer'
- java.lang.RuntimeException: java.lang.IllegalArgumentException: Argument for @NotNull parameter 'nam
- java.lang.RuntimeException: Unable to get provider
- Unable to find a value for "字段名" in object of class java.lang.String using operator "."
- Android开发中java.lang.RuntimeException: Unable to start activity ComponentInfo{xxx}: java.lang.NullPoi
- Android问题:Test run failed: Instrumentation run failed due to 'java.lang.RuntimeException'
- Android开发中java.lang.RuntimeException: Unable to start activity ComponentInfo{xxx}: java.lang.NullPoi
- Android开发中java.lang.RuntimeException: Unable to start activity ComponentInfo{xxx}: java.lang.NullPoi
- retrofit2 java.lang.IllegalArgumentException: Unable to create converter for xxx
- Android开发中java.lang.RuntimeException: Unable to start activity ComponentInfo{xxx}: java.lang.NullPoi
- Android开发中java.lang.RuntimeException: Unable to start activity ComponentInfo xxx: java.lang.NullPoin
- There is no getter for property named 'xxx' in 'class java.lang.Long'