Jar 内から構成ファイルにアクセスする必要があるため、次を使用します。
URL configUrl = Object.class.getResource("/config.xml");
ここで、URL を File オブジェクトに変換する必要があります。これは、下流の ConfigurationFile オブジェクトが初期化のために必要とするものだからです。これを試すと:
new File(configUrl.toURI())
私は得る:
java.lang.IllegalArgumentException: URI is not hierarchical
これを試すと:
new File(Thread.currentThread().getContextClassLoader().getResource("config.xml").getFile())
私は得る:
File does not exist: 'file:\E:\Apps\jarfile.jar!\config.xml'
注: 残念ながら、InputStream に File オブジェクトが必要です。