我使用Spring的依賴注入,但我遇到了難以加載我的Spring配置文件中的資源。彈簧豆配置
該資源是一個XML文件,位於我的類路徑中的JAR文件中。我嘗試訪問它,如下所示:
<import resource="classpath:com/config/resources.xml" />
但我不斷收到遇到以下錯誤:
Failed to import bean definitions from URL location [classpath:com/config/resources.xml]
的JAR文件是Java項目的類路徑,這又被用我web應用程序。我真的應該在Web項目中做我的Spring配置,而不是Java項目,還是這很重要?
我想你是指這個:http://static.springframework.org/spring/docs/2.5.x/reference/resources.html#resources-classpath-wildcards – 2008-11-17 19:11:51