我用的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.的更多相关文章

  1. spring controller中@Value取不到applicationContext.xml中加载配置文件的问题

    原因还未查证: http://sunjun041640.blog.163.com/blog/static/256268322014127113844746/ 在使用spring mvc时,实际上是两个 ...

  2. SSH整合,applicationContext.xml中配置hibernate映射文件问题

    今天在applicationContext.xml中配置sessionFactory时遇到了各种头疼的问题,现在总结一下: 1.<property name="mappingDirec ...

  3. android动画具体解释六 XML中定义动画

    动画View 属性动画系统同意动画View对象并提供非常多比view动画系统更高级的功能.view动画系统通过改变绘制方式来变换View对象,view动画是被view的容器所处理的,由于View本身没 ...

  4. Android——inflate 将一个xml中定义的布局找出来

    通俗的说,inflate就相当于将一个xml中定义的布局找出来. 因为在一个Activity里如果直接用findViewById()的话,对应的是setConentView()的那个layout里的组 ...

  5. applicationContext.xml中的使用${}是代表什么意思?

    在applicationContext.xml文件中,使用 ${xxx} 表示的是:调用某个变量,该变量的名称就是{xxx}里面的"xxx".   例如:在applicationC ...

  6. 在application-context.xml中配置多个property-placeholder

    如下所示,直接写多个<context:property-placeholder>标签是会报错的. <context:property-placeholder location=&qu ...

  7. Tomcat web.xml中定义了文件扩展名到MIME类型的对应关系

    Tomcat在返回静态资源时,会根据资源文件的扩展名产生对应的content-type头(也即MIME类型)添加到response header中. 在Tomcat的web.xml规定了扩展名及相应M ...

  8. Android strings.xml中定义字符串显示空格

    <string name="str">字 符 串</string> 其中   就表示空格.如果直接在里面键入空格,无论多少空格都只会显示一个. 用的XML转 ...

  9. 在properties.xml中定义变量,在application.xml中取值问题

    如果为application.xml中的变量赋默认值,同时又在properties.xml中变量赋值,而加载后是取不到properties.xml中的值的问题. 解决这个问题需要加上黑体部分配置: & ...

随机推荐

  1. 关于php加密库加密数据上传数据库或解密出错的问题

    php加密拓展库随着php版本的更新,函数的使用方法有所改变,所以加密模式推荐使用ecb,其中加密算法19种,加密模式8种,通过这种方式加密后的数据上传数据库后提取出来进行解密会发现结果是乱码,我认为 ...

  2. nginx服务部署 说明

    第1章 常用的软件 1.1 常用来提供静态服务的软件   Apache :这是中小型Web服务的主流,Web服务器中的老大哥,   Nginx :大型网站Web服务的主流,曾经Web服务器中的初生牛犊 ...

  3. input 密码框调出手机的数字键盘

    对于某些密码,想要在手机上调出数字键盘,同时要隐藏文字.可结合type=tel和 text-security属性达到目的. input{ -webkit-text-security:disc; tex ...

  4. Ajax 跨域 异步 CORS

    HTTP access control (CORS) 核心在于使用定制(添加新的header)HTTP header让浏览器和服务器有更多的相互了解,从而决定一个请求或者响应成功还是失败   对于一个 ...

  5. display:table 表格布局

    table 布局最大的特点 1.同行等高 2.宽度自动调节   那么table-cell是不是具备这个特点呢?答案是yes,为什么呢?css中有一个有意思的规则“创建匿名表格元素”.   拿table ...

  6. 技嘉 gigabyte b75m d3v 主板 定时开机无效问题解决

    BIOS 里面设置定时开机后发现到点并没有正常启动~~~  百思不得解.后来发现原来是WIN8系统下的控制面板的关机并非正常关机,而是不保存设置的非正常关机,在开始菜单右键——关闭或注销——关闭计算机 ...

  7. EF错误

    The model backing the 'XXXXDBContext' context has changed since the database was created. Either man ...

  8. Linux下安装ActiveMQ CPP

    ActiveMQ CPP ActiveMQ CPP是用C++语言访问ActiveMQ的客户端开发库,也称cms(cpp message service),安装cms开发库需要先安装一些基础库. 如下: ...

  9. 使用 Rust 构建分布式 Key-Value Store

    欢迎大家前往腾讯云社区,获取更多腾讯海量技术实践干货哦~ 引子 构建一个分布式 Key-Value Store 并不是一件容易的事情,我们需要考虑很多的问题,首先就是我们的系统到底需要提供什么样的功能 ...

  10. ssh简单配置

    Port 2223Protocol 2HostKey /etc/ssh/ssh_host_rsa_keyHostKey /etc/ssh/ssh_host_dsa_keyKeyRegeneration ...