错误码集合1

133 阅读1分钟

遇到就记录下:

 web.xml加载多个配置文件

<!-- 上下文参数 -->
	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>
            classpath:applicationContent*.xml,
            classpath:applicationContent-mybatis.xml
        </param-value>
	</context-param>

错误集

1、错误码:class path resource [xxxx.xml] cannot be opened because it does not exist
解析:web.xml加载配置文件名有问题,查看web.xml中配置的文件名与resource中配置的是否一致

2、错误码:No qualifying bean of type 'com.xxx.service.xxxx' available
解析:找不到该bean的注册,配置文件漏加载该bean,须在resource中配置文件中加入该bean;如果已经加入了,还是加载不到,查看web.xml中是否加载了该配置文件

<context:component-scan base-package="com.xxx.service"></context:component-scan>

3、错误码:class path resource [xxx.xml] cannot be opened because it does not exist

解析:如果遇到配置文件不存在,可先搜寻下在哪配置了,这个配置文件(使用file search,搜索下这个xxx.xml关键字),看下是否与你的配置文件名不一致