割接(升级)失败的几种情况

2019-10-31

在覆盖更新的时候,地址重复。比如你开始写了一个TestController里面有几个测试接口,并更新到服务器上,后来,你把它命名为Test2Controller,本地运行没有问题,本地工具同步做得好,它把以前那个controller删除了,但是

服务器如果是覆盖更新的吧,就会有2个Testcontroller,就会冲突。

DayPartStatTask dayPartStatTask = SpringContextHelper.getBean(DayPartStatTask.class);这种情况,如果class没有定位bean时,会报错,而不是返回null,还是用name好用。

严重: Servlet.service() for servlet [dispatcherServlet] in context with path [/API_UBP] threw exception [Request processing failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.dr.iptv.task.DayPartStatTask] is defined] with root cause
org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.dr.iptv.task.DayPartStatTask] is defined

解决办法:DayPartStatTask dayPartStatTask = (DayPartStatTask) SpringContextHelper.getBean("dayPartStatTask");

 

posted on 2019-10-31 22:32  angelshelter  阅读(380)  评论(0编辑  收藏  举报

导航