摘要: 最常用的办法就是用 ClassPathXmlApplicationContext,FileSystemClassPathXmlApplicationContext,FileSystemXmlApplicationContext 等对象去加载Spring配置文件,这样做也是可以, 但是在加载Sprin... 阅读全文
posted @ 2012-03-29 18:39 highriver 阅读(2801) 评论(0) 推荐(1) 编辑
摘要: spring中读取绝对路径与类路径的二种方式:<bean id="propertyConfigurer"class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"><property name="locations"><list><value>/WEB-INF/mail.properties</value> <value>classpath: conf/sqlmap/ 阅读全文
posted @ 2012-03-29 18:20 highriver 阅读(1122) 评论(0) 推荐(0) 编辑
摘要: 使用了annotation的工程导出jar在运行时,报找不到@Service修饰的类。但是在工程里执行没有问题。报错如下:Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'wikiCategoryMigrateService' is defined解决:1将bean定义定义到xml中。这样即使不存在directory entries(DE),Spring也能找到bean。2使用export jar+Add directory entries把dir 阅读全文
posted @ 2012-03-29 18:14 highriver 阅读(2889) 评论(0) 推荐(0) 编辑