XML ファイルを解析するために Apache の Common Configuration パッケージを使用することにしました。
私は次のことをすることにしました:
XMLConfiguration xmlConfig = new XMLConfiguration(file);
Eclipse は、私が例外をキャッチしていないと不平を言ったUnhandled exception type ConfigurationException
ので( )、信頼できるものをヒットしsurround with 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 が追加を提案したのに、なぜそのエラーが表示されたのかわかりません。