いつでも悩むJavaのパス

テスト用のコンテキストを作成するのに、どうしてもパスが通らなくて放置していたのだけど。

ApplicationContext context = new FileSystemXmlApplicationContext(〜SpringのXMLファイル);


ふとorg.springframework.context.support.FileSystemXmlApplicationContextのソースを見てみれば。

Resource paths are considered relative to the current VM working directory, even if they start with a slash.


と書いてある。


つまりは・・・やっぱりVMの起動したところにコピーするしかないということなんじゃろか。

org.springframework.orm.hibernate3.LocalSessionFactoryBeanあたりは、

Set Hibernate mapping resources to be found in the class path,(略)


こう書いてあるのだから、たぶんそうなんだろうなぁ。


そうなのかぁ・・・。