我是靠谱客的博主 清脆白羊,这篇文章主要介绍 an exception type mus,现在分享给大家,希望可以做个参考。

今天随便研究发现这么个问题
代码如下
package com.testpackage;

import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;

public class Tester {

static {
try {
Configuration config = new PropertiesConfiguration("database.proterties");
String driverClassName = config.getString("DataSource.driverClassName");
} catch (ConfigurationException e) {
e.printStackTrace();
}
}

报错信息为:No exception of type ConfigurationException can be thrown; an exception type must be a subclass of Throwable,

很奇怪,上网搜索一下,原来是需要这个包commons-lang

因为org.apache.commons.configuration.ConfigurationException extends org.apache.commons.lang.exception.NestableException.

最后

以上就是清脆白羊最近收集整理的关于 an exception type mus的全部内容,更多相关内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(114)

评论列表共有 0 条评论

立即
投稿
返回
顶部