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中的值的问题. 解决这个问题需要加上黑体部分配置: & ...
随机推荐
- Solitaire
Solitaire Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Sub ...
- 判断回文数字 9. Palindrome Number
Determine whether an integer is a palindrome. Do this without extra space. Some hints: Could negativ ...
- HTML学习笔记 CSS表格及轮廓案例 第八节 (原创)参考使用表
#tb, tb1, tr, th, td { border: 5px solid blue; /*加边框*/ padding: 5px; /*内边距*/ } #tb1 { border-collaps ...
- Cordova使用build命令出错: Could not create the Java Virtual Machine.
这是因为虚拟机内存不足导致的,解决方案如下: _JAVA_OPTIONS=-Xmx512M
- ldap数据库--ODSEE--schema
ldap服务器包含上百个对象类型(object class)和属性,这些对象类和属性都可以满足大部分需求,如果你想定义自己的schema,你只能继承扩展现有的schema进行操作. tip: 增加的新 ...
- 前端html 中jQuery实现对文本的搜索并把搜索相关内容显示出来
做项目的时候有这么一个需求,客户信息显示出来后我要搜索查找相关的客户,并把相关的客户信息全部显示出来,因为一个客户全部信息我写在一个div里面 所以显示的时候就是显示整个div.先看看实现的效果: ...
- 在昆明网络SEO的走向站外的优化该何去何从?
昨天大概讲了SEO的站内优化,今天我们来讲讲网站站外的优化. 站外主要以第三平台为主,其中包含站外推广:常规推广.外链建设:利用第三方平台优化关键词排名: 1.博客平台,现在有好多博客平台是很不错的, ...
- C:\WINDOWS\system32\wmp.dll”受到“Windows 系统文件保护”
在VC# 2005 中,要是打包的程序中包含了Windows Media Player 这个组件的话,在生成解决方案的过程中会提示出错: "错误1,应将“wmp.dll”排除,原因是其源文 ...
- flex词法解析
例子1.从标准输入的字数.单词.行数统计 %{ #include <string.h> int chars = 0; int lines = 0; int words = 0; %} %% ...
- 【转】Linux下软、硬链接的创建和删除
原文:http://www.cnblogs.com/xiaochaohuashengmi/archive/2011/10/05/2199534.html 在Linux系统中,内核为每一个新创建的文件分 ...