我使用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