广告合作
  • 今日头条

    今日头条

  • 百度一下

    百度一下,你就知道

  • 新浪网

    新浪网 - 提供新闻线索,重大新闻爆料

  • 搜狐

    搜狐

  • 豆瓣

    豆瓣

  • 百度贴吧

    百度贴吧——全球领先的中文社区

  • 首页 尚未审核订阅工具 订阅

    applicaitonContext属性未注入

    来源:网络收集  点击:  时间:2024-03-02
    【导读】:
    applicaitonContext属性未注入, 请在applicationContext.xml中定义SpringContextHolder.方法/步骤1/4分步阅读

    我用的jeesite框架,在使用定时任务时,出现一些问题,,

    1.在windows上项目可以在tomcat下,运行

    2.在linux下项目在tomcatgh下,却出现问题:

    15-Dec-2017 15:15:37.552 INFO org.apache.catalina.core.ApplicationContext.log Initializing Spring root WebApplicationContext

    2017-12-15 15:15:44,224 ERROR - Context initialization failed

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name tasksBean: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.chseeker.modules.information.service.ToolInformationService com.thinkgem.jeesite.modules.sys.init.TasksBean.informationService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name toolInformationService: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.chseeker.modules.use.service.ToolUserInfoService com.chseeker.modules.information.service.ToolInformationService.toolUserInfoService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name toolUserInfoService: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected com.thinkgem.jeesite.common.persistence.CrudDao com.thinkgem.jeesite.common.service.CrudService.dao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name toolUserInfoDao: FactoryBean threw exception on object creation; nested exception is …………

    Caused by: java.lang.IllegalStateException: applicaitonContext属性未注入, 请在applicationContext.xml中定义SpringContextHolder.

    at org.apache.commons.lang3.Validate.validState(Validate.java:826)

    at com.thinkgem.jeesite.common.utils.SpringContextHolder.assertContextInjected(SpringContextHolder.java:105)

    at com.thinkgem.jeesite.common.utils.SpringContextHolder.getBean(SpringContextHolder.java:56)

    at com.chseeker.modules.use.entity.ToolUserInfo.clinit(ToolUserInfo.java:26)

    ... 75 more

    2/4

    这个是因为,,applicaitonContext没有初始化,查看

    3/4

    发现,是通过注释加载的,,我就想,是不是,我的定时任务比springContextHolder加载的早,造成的呢?

    于是,,我在spring-context.xml中写入bean class=com.thinkgem.jeesite.common.utils.SpringContextHolder lazy-init=false/

    4/4

    ,最后发布到linux中,,启动,问题解决

    最后的最后,,为什么windows下可以,linux下不可以呢???

    本文关键词:

    版权声明:

    1、本文系转载,版权归原作者所有,旨在传递信息,不代表看本站的观点和立场。

    2、本站仅提供信息发布平台,不承担相关法律责任。

    3、若侵犯您的版权或隐私,请联系本站管理员删除。

    4、文章链接:http://www.1haoku.cn/art_215354.html

    相关资讯

    ©2019-2020 http://www.1haoku.cn/ 国ICP备20009186号05-04 20:33:27  耗时:0.025
    0.0249s