Error creating bean with name 'userLogin' defined in ServletContext resource [/WEB-INF/classes/spring-actions.xml]: Unsatisfied dependency expressed through bean property 'arguments': : Error creating bean with name 'QuartzCornTrigger' defined in ServletContext resource [/WEB-INF/classes/spring-actions.xml]: Cannot resolve reference to bean 'userLogin' while setting bean property 'jobDetail'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'userLogin': FactoryBean which is currently in creation returned null from getObject; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'QuartzCornTrigger' defined in ServletContext resource [/WEB-INF/classes/spring-actions.xml]: Cannot resolve reference to bean 'userLogin' while setting bean property 'jobDetail'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'userLogin': FactoryBean which is currently in creation returned null from getObjectxml配置
<bean name = "userloginAction" class = "elkw.action.system.UserLoginAction"></bean>
<!-- 定义调度对象和调用的方法 -->
<bean id="userLogin" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="userloginAction"></property>
<property name="targetMethod">
<value>timerTask</value>
</property>
</bean>
<!-- 配置触发器 -->
<bean id="QuartzCornTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="userLogin"></property>
<!-- 触发时间(使用cron表达式) -->
<property name="cronExpression">
<value>0/5 * * * * ?</value>
</property>
</bean>
<!-- 调度程序管理类 -->
<bean id="startQuartz" lazy-init="false" autowire="no"
class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<!-- 添加触发器 -->
<property name="triggers">
<list>
<ref local="QuartzCornTrigger" />
</list>
</property>
</bean>
<bean name = "userloginAction" class = "elkw.action.system.UserLoginAction"></bean>
<!-- 定义调度对象和调用的方法 -->
<bean id="userLogin" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="userloginAction"></property>
<property name="targetMethod">
<value>timerTask</value>
</property>
</bean>
<!-- 配置触发器 -->
<bean id="QuartzCornTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="userLogin"></property>
<!-- 触发时间(使用cron表达式) -->
<property name="cronExpression">
<value>0/5 * * * * ?</value>
</property>
</bean>
<!-- 调度程序管理类 -->
<bean id="startQuartz" lazy-init="false" autowire="no"
class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<!-- 添加触发器 -->
<property name="triggers">
<list>
<ref local="QuartzCornTrigger" />
</list>
</property>
</bean>
解决方案 »
- hibernate的Entity能实现动态表名吗?
- java连接ftp,用127.0.0.1可以连接成功并上传,但用本地已设置的IP则出错:java.net.ConnectException: Connection refused: connect
- 关于struts2和jquery的一个问题
- 求助,谁有JdbcTelplate操作Oracle数据库的Demo,万分感谢。
- Tomcat 配置
- 请教一下 为什么在XP中VB.NET的ASP.NET应用程序不能用?
- wap 下载应该注意哪些有的手机下载错误..
- jsp里如何判断text里的值是否是日期型?
- 关于JSP-mail
- 强烈关注Struts 1.0.2 范例中的action.xml与struts-config.xml的问题!!!
- 关于在struts2中如何将.action加入到web.xml中的<welcome-file-list>下 急!在线等!!!!
- springJdbc数据库操作等
<bean id="QuartzCornTrigger" 下加<property name="startDelay">
<value>5000</value>
</property>
Error creating bean with name 'userLogin' defined in ServletContext resource [/WEB-INF/classes/spring-actions.xml]: Unsatisfied dependency expressed through bean property 'arguments': : Error creating bean with name 'QuartzCornTrigger' defined in ServletContext resource [/WEB-INF/classes/spring-actions.xml]: Cannot resolve reference to bean 'userLogin' while setting bean property 'jobDetail'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'userLogin': FactoryBean which is currently in creation returned null from getObject; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'QuartzCornTrigger' defined in ServletContext resource [/WEB-INF/classes/spring-actions.xml]: Cannot resolve reference to bean 'userLogin' while setting bean property 'jobDetail'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'userLogin': FactoryBean which is currently in creation returned null from getObject
<property name="cronExpression">
<value>55 1 * * * ?</value>
</property>
</bean>
<!-- 调度程序管理类 -->
<bean id="startQuartz" lazy-init="true" autowire="no"
class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<!-- 通过MethodInvokingJobDetailFactoryBean实现 -->
<bean id="myJob" class="com.quartz.MyJob"/>
<bean id="myJobProxy" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="myJob"/>
<property name="targetMethod" value="test"/>
</bean>
<bean id="scheduledQuartzTaskTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="myJobProxy"/>
<property name="cronExpression" value="0 59 * * * ?"/>
</bean>
<!-- 配置任务调度按排表 -->
<bean id="quartzTiggerFactoryBean" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="scheduledQuartzTaskTrigger"/>
</list>
</property>
</bean>
<bean id="scheduleInfoManager" class="com.springquartz.service.ScheduleInfoManager">
<property name="scheduler" ref="schedulerFactory"/>
</bean>
<!-- 添加执行任务 -->
<bean id="excuteJobBean" class="com.springquartz.service.ExecuteJobBean">
<property name="scheduler" ref="jobFactory"/>
</bean>
<bean id="schedulerJobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="scheduleInfoManager"/>
<property name="targetMethod" value="reScheduleJob"/>
<property name="concurrent" value="false"/>
</bean>
<bean id="executeJobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="excuteJobBean"/>
<property name="targetMethod" value="excuteJob"/>
<property name="concurrent" value="false"/>
</bean>
<bean id="cronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean" >
<property name="jobDetail" ref="schedulerJobDetail"/>
<property name="cronExpression">
<value>0/10 * * * * ?</value>
</property>
</bean>
<bean id="executeCronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="executeJobDetail"/>
<property name="cronExpression">
<value>* 0/1 * * * ?</value>
</property>
</bean>
<bean id="schedulerFactory" class="org.springframework.scheduling.quartz.SchedulerFactoryBean" lazy-init="false" autowire="no" >
<property name="triggers">
<list>
<ref bean="cronTrigger"/>
</list>
</property>
</bean>
<bean id="jobFactory" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="executeCronTrigger"/>
</list>
</property>
</bean>