2016-03-19 13 views
0

既存のprojectをカスタマイズしたいと思います。私はそのプロジェクトを何の誤りもなく構築し、展開することができます。アプリケーションコンテキストファイルBean.xmlの読み込み

class org.springframework.beans.factory.BeanDefinitionStoreException 
IOException parsing XML document from URL [file:resources/spring/config/BeanLocations.xml]; nested exception is java.io.FileNotFoundException: resources/spring/config/BeanLocations.xml (No such file or directory) 

あなたは私のクラスパスに近い外観を持っている場合:私の問題は、私は私のBeanLocation.xml

new ClassPathXmlApplicationContext("file:spring/config/BeanLocations.xml"); 

をロードしようとした場合、それはエラーがスローされ

C:/Program Files/Java/jdk1.8.0_60/lib/tools.jar;C:/Users/admin/workspace/ssf/samples/customcontroller/../../as-common/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../as-shared/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../commons-httpclient-contrib/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../gwt/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../indexer-lucene/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../jboss-portal/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../liferay/liferay/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../liferay-light/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../lucene-contrib/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../main/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../main-minimum/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../portal-module/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../remoting/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../rest-shared/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../slide-webdavclient/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../ssfs/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../taglib/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../tools/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../util/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../util-search/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/../../liferay/teaming/classes;C:/Users/admin/workspace/ssf/samples/customcontroller/src/resources 

その後、あなたはファイルを含む

+0

'file:'を使用せずに同じエラーが発生しました。 – StellaMaris

+0

[SpringがBean XML設定ファイルを見つけられません]の複製が存在する可能性があります(http://stackoverflow.com/questions/12893760/spring-cannot-find-bean-xml-configuration-file-when-it-does-存在します) – Cootri

答えて

0

を使用しているC:/Users/admin/workspace/ssf/samples/customcontroller/src/resourcesが見つかりますa file uri。この種のuriはクラスパスを気にしませんが、現在のフォルダを基準にファイルを読み込みます。

uriを使用するか、適切なパスでfile URIを設定してください。

+0

'classpath *:spring/config/BeanLocations.xml'は私のために働きますが、' file: 'プレフィックスなしでロードする方法を知りたいと思います。 – StellaMaris

+0

"file:spring/config/BeanLocations.xml"の代わりに何を使用することをお勧めしますか何度も試みましたが何も効果がありませんでした。 – StellaMaris

関連する問題