I use the Jeesite framework, when using timed tasks, there are some problems,
1. Items on Windows can be run under Tomcat,
2. Under Linux Project under Tomcatgh, there are problems:
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 beans 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 beans 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 beans with Name ' Tooluserinfodao ': Factorybean threw exception on object creation; Nested exception is ......
caused By:java.lang.IllegalStateException:applicaitonContext attribute not injected, Please define the Springcontextholder in the Applicationcontext.xml.
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)
... More
This is because, Applicaitoncontext is not initialized, view
Found, is loaded by comments, and I would like, is not, my scheduled task than Springcontextholder loaded early, caused by it?
So, I write in Spring-context.xml <bean class= "Com.thinkgem.jeesite.common.utils.SpringContextHolder" lazy-init= " False "/>
, finally released to Linux,, startup, problem solving
Finally, why Windows can under, Linux can not???
Applicaitoncontext property is not injected, define Springcontextholder in Applicationcontext.xml.