
spring
zzdrfd
这个作者很懒,什么都没留下…
展开
-
SpringBoot异常:Error creating bean with name 'entityManagerFactory' defined in class path resource
使用springboot持久化时,遇到异常:Error creating bean with name 'entityManagerFactory' defined in class path resource Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested se...原创 2017-09-29 14:21:44 · 19274 阅读 · 1 评论 -
WEB项目中文乱码的问题
原文1.解决HTML页面中的中文问题:为了使HTML页面很好地支持中文,就必须在每个HTML页面的头部增加如下代码:<META http-equiv=Content-Type content="text/html;charset=utf-8">2.解决JSP页面中的中文问题为了使JSP页面很好地支持中文,就必须在每个JSP页面的头部增加如下代码:&转载 2018-09-18 17:40:20 · 2021 阅读 · 1 评论 -
绝对路径${pageContext.request.contextPath}用法及其与web.xml中Servlet的url-pattern匹配过程
转载自系统的代码目录结构及add.jsp代码如图所示:图二 系统的代码目录结构及add.jsp代码${pageContext.request.contextPath}用于解决使用相对路径时出现的问题,它的作用是取出所部署项目的名字。对于图片文件,如图二所示“pageContext.request.contextPath/bookcover/101.jpg”使用的是绝对路径,{page...转载 2018-09-29 10:36:35 · 503 阅读 · 0 评论 -
Spring的refresh()方法相关异常
转载自如果是经常使用Spring,特别有自己新建ApplicationContext对象的经历的人,肯定见过这么几条异常消息:1.LifecycleProcessor not initialized - call ‘refresh’ before invoking lifecycle methods via the context: …2.BeanFactory not initialize...转载 2019-01-14 16:10:06 · 836 阅读 · 0 评论 -
【异常】No qualifying bean of type [xxx] is defined: expected single matching bean but found 2 [xxx,xxx]
Spring项目启动的时候,报以下异常:No qualifying bean of type [xxx] is defined: expected single matching bean but found 2 [xxx1,xxx2]通过调查,发现[xxx1,xxx2]中的xxx2是同事在applicationContext-xxx.xml文件中新增的一个Bean元素,而xxx1是在项目中...原创 2019-04-28 16:51:40 · 2778 阅读 · 0 评论 -
使用IDEA,出现Could not autowire. No beans of XXX type found
使用idea出现“Could not autowire. No beans of XXX type found”异常提醒,但是程序可以正常编译,执行。(虽然报异常提醒,但是该Bean已正常实例化)解决办法1)@Autowired注解添加 required = false@Autowired(required = false)2)降低idea对@Autowired注解的检测级别,不推荐...原创 2019-05-08 09:32:39 · 1432 阅读 · 0 评论 -
【异常】EmptyResultDataAccessException:Incorrect result size: expected 1,actual 0
在使用JdbcTemplate的queryForMap方法,查询数据库时报错。原因:查看源码:"JdbcTemplate"类public Map<String, Object> queryForMap(String sql, Object[] args, int[] argTypes) throws DataAccessException { return queryForO...原创 2019-07-08 13:59:17 · 8608 阅读 · 1 评论