spring使用中问题汇总
2017-12-27 14:03
134 查看
1.配置文件找不到beans元素:可能是xsd与spring版本不一致,导致无法效验;
解决方案:将applicationContext.xml中xsd文件定义的版本改为spring jar包中定义的xsd的版本,如果版本定义的太高在本地会无法找到,只能从网络上下载。
第二,在dtd中缺少 xmlns="http://www.springframework.org/schema/beans"也会出现这个问题。
解决方法:在spring配置文件中加入xmlns="http://www.springframework.org/schema/beans即可解决。
可参考:https://www.cnblogs.com/longshiyVip/p/4574070.html#undefined
2.java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/springmvc-servlet.xm】
对于Maven项目,如果不特意指定参数名为contextConfigLoction的<context-parameter>元素,那么spring的ContextLoderListener监听器就会在/WEB-INF/下去寻找并加载该目录下的名为applicationContext.xml这个文件
可参考:http://blog.csdn.net/wlwlwlwl015/article/details/48134763
解决方案:将applicationContext.xml中xsd文件定义的版本改为spring jar包中定义的xsd的版本,如果版本定义的太高在本地会无法找到,只能从网络上下载。
第二,在dtd中缺少 xmlns="http://www.springframework.org/schema/beans"也会出现这个问题。
解决方法:在spring配置文件中加入xmlns="http://www.springframework.org/schema/beans即可解决。
可参考:https://www.cnblogs.com/longshiyVip/p/4574070.html#undefined
2.java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/springmvc-servlet.xm】
对于Maven项目,如果不特意指定参数名为contextConfigLoction的<context-parameter>元素,那么spring的ContextLoderListener监听器就会在/WEB-INF/下去寻找并加载该目录下的名为applicationContext.xml这个文件
可参考:http://blog.csdn.net/wlwlwlwl015/article/details/48134763
相关文章推荐
- 深入理解Spring Redis的使用 (五)、常见问题汇总
- 深入理解Spring Redis的使用 (五)、常见问题汇总
- 在spring-mvc中使用swagger2遇到的问题汇总
- 使用Spring发送邮件常见问题汇总
- 深入理解Spring Redis的使用 (五)、常见问题汇总
- 使用vs.net过程中问题汇总
- IMCO正品行货机使用问题汇总与解答
- spring.net 1.1.0 P3版本 中spring.core.dll 1.1.0.2版本对于AOP使用ADVICE中涉及使用ref/out参数的小问题
- Spring使用hibernateTemplate不能save对象的问题.
- Hibernate/Spring/Struts架构使用OpenSessionInView的问题
- spring下使用velocity的中文乱码问题
- 使用Spring的javamail注意的中文问题
- 使用JBOSS IDE的xdoclet来generate struts and spring xdoclet的问题
- Hibernate/Spring/Struts架构使用OpenSessionInView的问题
- Hibernate数据的lazy问题,以及使用spring整合hibernate lazy的解决办法(好文转载)
- 使用Spring的javamail注意的中文问题
- 在Eclipse RCP中使用Spring AOP/ProxyFactory的问题
- Hibernate/Spring/Struts架构使用OpenSessionInView的问题
- 项目中使用Spring时配置web.xml的listener侦听接口不能初始化的问题
- DataGrid的使用问题汇总