我用的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. 多项式求和,素数判定 HDU2011.2012

    HDU 2011:多项式求和 Description 多项式的描述如下: 1 - 1/2 + 1/3 - 1/4 + 1/5 - 1/6 + ... 现在请你求出该多项式的前n项的和.   Input ...

  2. display、visibility、visible区别

    标签的隐藏可以有三种:display.visibility.服务器控件的visible. 显然,这三者都能起到隐藏与显示的效果,但是用途确完全不一样,请看用法与区别: <div style=&q ...

  3. Hibernate框架学习之注解映射实体类

         前面的相关文章中,我们已经介绍了使用XML配置文件映射实体类及其各种类型的属性的相关知识.然而不论是时代的潮流还是臃肿繁杂的配置代码告诉我们,注解配置才是更人性化的设计,于是学习了基本的映射 ...

  4. git打包

    git help tag #tag的用法git taggit tag -d xxx #删除taggit tag v1.1 #新增taggit describe --tag #  

  5. 有序GUID

    背景 常见的一种数据库设计是使用连续的整数为做主键,当新的数据插入到数据库时,由数据库自动生成.但这种设计不一定适合所有场景. 随着越来越多的使用Nhibernate.EntityFramework等 ...

  6. Python 面向对象(三) 魔术方法

    __getitem__ 在对实例或对象使用索引访问时调用,self[key]__dir__ 收集当前模块的信息,包括继承自其它基类(包括object类)的属性和方法 __new 定义如何创建实例__i ...

  7. 一步一步带你实现virtual dom(二) -- Props和事件

    很高兴我们可以继续分享编写虚拟DOM的知识.这次我们要讲解的是产品级的内容,其中包括:设置和DOM一致性.以及事件的处理. 使用Babel 在继续之前,我们需要弥补前一篇文章中没有详细讲解的内容.假设 ...

  8. 企业级Tomcat部署实践及安全调优

    1.1 Tomcat简介 Tomcat是Apache软件基金会(Apache Software Foundation)的Jakarta 项目中的一个核心项目,由Apache.Sun和其他一些公司及个人 ...

  9. Spark SQL中的几种join

    1.小表对大表(broadcast join) 将小表的数据分发到每个节点上,供大表使用.executor存储小表的全部数据,一定程度上牺牲了空间,换取shuffle操作大量的耗时,这在SparkSQ ...

  10. 微软云计算 Massive Data 处理语言Scope 1

    Massive Data处理一直是云计算中很重要的一个环节.目前像Google,Yahoo在相关方面都有自己专有的技术.例如Google的基于MapReduce的Sawzall语言.和Yahoo基于H ...