applicaitonContext属性未注入, 请在applicationContext.xml中定义SpringContextHolder.
我用的jeesite框架,在使用定时任务时,出现一些问题,,
1.在windows上项目可以在tomcat下,运行
2.在linux下项目在tomcatgh下,却出现问题:
15-Dec-2017 15:15:37.552 INFO [www.toolcoo.com-startStop-1] org.apache.catalina.core.ApplicationContext.log Initializing Spring root WebApplicationContext
2017-12-15 15:15:44,224 ERROR [org.springframework.web.context.ContextLoader] - 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
这个是因为,,applicaitonContext没有初始化,查看
发现,是通过注释加载的,,我就想,是不是,我的定时任务比springContextHolder加载的早,造成的呢?
于是,,我在spring-context.xml中写入<bean class="com.thinkgem.jeesite.common.utils.SpringContextHolder" lazy-init="false"/>
,最后发布到linux中,,启动,问题解决
最后的最后,,为什么windows下可以,linux下不可以呢???
applicaitonContext属性未注入, 请在applicationContext.xml中定义SpringContextHolder.的更多相关文章
- spring controller中@Value取不到applicationContext.xml中加载配置文件的问题
原因还未查证: http://sunjun041640.blog.163.com/blog/static/256268322014127113844746/ 在使用spring mvc时,实际上是两个 ...
- SSH整合,applicationContext.xml中配置hibernate映射文件问题
今天在applicationContext.xml中配置sessionFactory时遇到了各种头疼的问题,现在总结一下: 1.<property name="mappingDirec ...
- android动画具体解释六 XML中定义动画
动画View 属性动画系统同意动画View对象并提供非常多比view动画系统更高级的功能.view动画系统通过改变绘制方式来变换View对象,view动画是被view的容器所处理的,由于View本身没 ...
- Android——inflate 将一个xml中定义的布局找出来
通俗的说,inflate就相当于将一个xml中定义的布局找出来. 因为在一个Activity里如果直接用findViewById()的话,对应的是setConentView()的那个layout里的组 ...
- applicationContext.xml中的使用${}是代表什么意思?
在applicationContext.xml文件中,使用 ${xxx} 表示的是:调用某个变量,该变量的名称就是{xxx}里面的"xxx". 例如:在applicationC ...
- 在application-context.xml中配置多个property-placeholder
如下所示,直接写多个<context:property-placeholder>标签是会报错的. <context:property-placeholder location=&qu ...
- Tomcat web.xml中定义了文件扩展名到MIME类型的对应关系
Tomcat在返回静态资源时,会根据资源文件的扩展名产生对应的content-type头(也即MIME类型)添加到response header中. 在Tomcat的web.xml规定了扩展名及相应M ...
- Android strings.xml中定义字符串显示空格
<string name="str">字 符 串</string> 其中 就表示空格.如果直接在里面键入空格,无论多少空格都只会显示一个. 用的XML转 ...
- 在properties.xml中定义变量,在application.xml中取值问题
如果为application.xml中的变量赋默认值,同时又在properties.xml中变量赋值,而加载后是取不到properties.xml中的值的问题. 解决这个问题需要加上黑体部分配置: & ...
随机推荐
- js中的引用类型和基本类型
基本类型 : Undifined.Null.Boolean.Number和String 引用类型 :Object .Array .Function .Date等. 基本数据类型保存在栈内存中 是按值访 ...
- Linux修改时区的正确方法
CentOS和Ubuntu的时区文件是/etc/localtime,但是在CentOS7以后localtime以及变成了一个链接文件 [root@centos7 ~]# ll /etc/localti ...
- ⑾bootstrap组件 徽章 大屏 页头 基础案例
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- 二、VueJs 填坑日记之基础项目构建
在上一篇文章中,大致介绍了一下本系列博文以及学习vuejs我们需要了解的一些概念,希望大家认真阅读,所谓知己知彼,百战百胜,学习也一样,工欲善其事,必先利其器,要想学好vuejs,那前提的概念一定要熟 ...
- Windows常用shell命令大全
Windows常用shell命令大全 基于鼠标操作的后果就是OS界面外观发生改变, 就得多花学习成本.更主要的是基于界面引导Path与命令行直达速度是难以比拟的.另外Geek很大一部分是键盘控,而非鼠 ...
- 二:Redis快速入门及应用
Redis的使用难吗?不难,Redis用好容易吗?不容易.Redis的使用虽然不难,但与业务结合的应用场景特别多.特别紧,用好并不容易.我们希望通过一篇文章及Demo,即可轻松.快速入门并学会应用. ...
- .net core 同时实现网站管理员后台、会员、WebApi登录及权限控制
我们在开网站信息系统时,常常有这样几个角色,如后台的管理员,前台的会员,以及我们各种应用的WebAPI 都需要进行登录操作及权限控制,那么在.net core如何进行设计呢. 首先我使用的是.net ...
- C语言一些知识点回顾
1.多行宏定义 #include <stdio.h> #define _PyObject_HEAD_EXTRA \ struct _object *_ob_next; \ struct _ ...
- linux使用yum安装mariadb
一,安装 yum install mariadb mariadb-server 二,如何设置密码 用root 进入mysql后 mysql>set password =password('你的 ...
- android studio 的自动更新问题
地址背墙了 没办法... 只有另寻他法了: 在Android Studio安装目录/bin/studio(对应版本, x86, x64).vmoptions文件中追加以下几行 -Djava.net.p ...