Applicaitoncontext property is not injected, define Springcontextholder in Applicationcontext.xml.

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.