决定使用Apache的公共配置包解析XML文件。
我决定做一个:
XMLConfiguration xmlConfig = new XMLConfiguration(file);
对于哪个Eclipse抱怨我没有遇到异常(未处理的异常类型ConfigurationException),所以我用try / catch命中可靠的环绕,并添加了以下代码:
try
{
XMLConfiguration xmlConfig = new XMLConfiguration(file);
}
catch (ConfigurationException ex)
{
ex.printStackTrace();
}
不过现在抱怨:
No exception of type ConfigurationException can be thrown; an exception type
must be a subclass of Throwable
我不明白为什么它是给我这个错误,当Eclipse是建议添加它的那个。