Got an exception - java.lang.RuntimeException: Unable to get class information for @throws tag 'XXXException'.

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:

<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).

### 解决Hive中 `Unable to instantiate` 的异常问题 遇到 `FAILED: SemanticException org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient` 错误通常意味着 Hive 无法实例化会话元存储客户端。这可能是由于多种原因引起的,包括但不限于配置不正确、依赖库缺失或版本兼容性问题。 #### 配置调整 一种常见的解决方案是进入 `hive/conf` 文件夹并编辑 `hive-site.xml` 文件。具体操作为注释掉可能导致冲突的参数设置[^4]: ```xml <!-- <property> <name>hive.metastore.warehouse.dir</name> <value>/user/hive/warehouse</value> </property> --> ``` 另一种有效的方法是在 `hive-site.xml` 中添加特定属性来指定 Metastore URI: ```xml <property> <name>hive.metastore.uris</name> <value>thrift://hive服务器的IP地址:9083</value> </property> ``` 上述更改有助于确保 Hive 客户端能够正确连接到远程Metastore服务[^5]。 #### 数据库重置尝试 如果之前的操作未能解决问题,则可以考虑清理现有的 MySQL 元数据库 (metastore),然后通过命令 `schematool -initSchema -dbType mysql` 来重新初始化它。不过需要注意的是,在执行此操作前应备份现有数据以防意外丢失。 #### 版本一致性检查 确认所使用的 Hadoop 和 Hive 组件之间的版本相互匹配也很重要。不同版本之间可能存在API变化或其他差异,这些都可能引发此类错误。因此建议查阅官方文档以获取推荐搭配列表,并据此调整环境中的软件版本[^1]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值