在一个业务类有下列属性

private SchedulerFactoryBeanscheduler;

    public SchedulerFactory BeangetScheduler() {
        return scheduler;
    }

    public void setScheduler(SchedulerFactoryBean scheduler) {
        this.scheduler = scheduler;
    }

用spring 进行装配:

   <property name="scheduler">
           <ref bean="schedulerFactoryBean" />
        </property>

    </bean>
    <bean id="schedulerFactoryBean" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"/>

启动时候报:Failed to convert property value of type [org.quartz.impl.StdScheduler] to required type [org.springframework.scheduling.quartz.SchedulerFactoryBean异常

解决方案:

SchedulerFactoryBean 这个bean
<bean id="Scheduler" lazy-init="false" autowire="no" 
class="org.springframework.scheduling.quartz.SchedulerFactoryBean" > 
</bean> 
它是一个工厂bean,得到的不是它本身,而是它负责创建的org.quartz.impl.StdScheduler对象 ,

所以属性需要修改:

   private StdScheduler scheduler;

    public StdScheduler getScheduler() {
        return scheduler;
    }

    public void setScheduler(StdScheduler scheduler) {
        this.scheduler = scheduler;
    }

关于Failed to convert property value of type [org.quartz.impl.StdScheduler] to required type [org.springframework.scheduling.quartz.SchedulerFactoryBean的更多相关文章

  1. Spring 整合 Flex (BlazeDS)无法从as对象 到 Java对象转换的异常:org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.Date' to required type 'java.sql.Timestamp' for property 'wfsj'; nested exception is java.lang.Ill

    异常信息如下: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value ...

  2. spring mvc出现 Failed to convert property value of type &#39;java.lang.String&#39; to required type &#39;java.util.Date&#39; for property &#39;endtime&#39;

    在使用spring mvc中,绑定页面传递时间字符串数据给Date类型是出错: Failed to convert property value of type [java.lang.String] ...

  3. 出错:Failed to convert property value of type &#39;org.apache.ibatis.session.defaults.DefaultSqlSessionFactory&#39; to required type &#39;java.lang.String&#39; for property &#39;sqlSessionFactoryBeanName&#39;;

    出错的详细信息: 3 ERROR [http-nio-80-exec-3] org.springframework.web.servlet.DispatcherServlet - Context in ...

  4. org.springframework.beans.TypeMismatchException: Failed to convert property value of type &#39;null&#39; to required type &#39;double&#39; for property &#39;band&#39;; nested exception is org.springframework.core.convert.Con

    本文为博主原创,未经允许不得转载: 先将异常粘贴出来: 20:37:26,909 ERROR [com.suning.fucdn.controller.ProductDataStaticsContro ...

  5. 【spring mvc】后台API查询接口,get请求,后台Date字段接收前台String类型的时间,报错default message [Failed to convert property value of type &#39;java.lang.String&#39; to required type &#39;java.util.Date&#39; for property &#39;createDate&#39;;

    后台API查询接口,get请求,后台Date字段接收前台String类型的时间筛选条件 后台接口接收 使用的实体 而createDate字段在后台实体中是Date类型 报错信息: org.spring ...

  6. [Failed to convert property value of type &#39;java.lang.String&#39; to required type &#39;java.util.Date&#39; for property &#39;beginTime&#39;;

    依照https://stackoverflow.com/questions/23702041/failed-to-convert-property-value-of-type-java-lang-st ...

  7. Failed to convert property value of type &#39;java.util.LinkedHashMap&#39; to required type &#39;java.util.Map&#39; for property &#39;filters&#39;

    在使用shiro的自定义filter出现的问题 <property name="filters"> <util:map> <entry key=&qu ...

  8. message [Failed to convert property value of type [java.lang.String] to required type [java.util.Date] for property

    springmvc前台字符串,后台Date类型字段.时间强转失败 数值:18年12月31日 15:43:21 解决方法,给时间字段加注释 @DateTimeFormat(pattern = " ...

  9. No setter found for property &#39;cronExpression&#39; in class &#39;org.springframework.scheduling.quartz.CronTriggerBean&#39;

    今天想写个Spring集成Quartz的小Demo,结果报错cronExpression未定义,通过差错,原来是因为Spring 3.0.5与Quartz2.2.2不兼容,Spring3.1以下的只能 ...

随机推荐

  1. Gulp真实项目用例

    包括了less预编译,css压缩,html文件include引入,js混淆压缩,本地开发热刷新服务器,html压缩,版本号添加 github地址: gulpfile.js var gulp = req ...

  2. OA

    OA(政府) http://zw.wuzhitong.com/oa_wuzhitong/index.asp http://www.wuzhitong.com/Information_ZW.html O ...

  3. [BTS] The external credentials in the SSO database are more recent.

    For test some interface. We change BizTalk Server time to a feature date. For example, change to nex ...

  4. Python精神

    [root@LDAP_slave ~]# python -c "import this" The Zen of Python, by Tim Peters Beautiful is ...

  5. CSS注释代码

    就像在Html的注释一样,在CSS中也有注释语句:用/*注释语句*/来标明(Html中使用<!--注释语句-->).就像下面代码: 示例: <!DOCTYPE HTML> &l ...

  6. Linux 进程管理、系统状态查询

    1.内存给进程一段空间让他启动,让内核通过cpu来管理它. 2.ps命令查看命令信息. 用户.pid号.使用cpu.使用内存.虚拟内存.真实内存.控制台.状态.启动时间.运行时间.名 USER PID ...

  7. jquery实现拖拽进度条并显示百分比的特效

    #box{position: relative; width: 200px; height: 50px; border: 1px solid #eee; margin: 50px auto 0;} # ...

  8. Two Sum III - Data structure design LT170

    Design and implement a TwoSum class. It should support the following operations:add and find. add - ...

  9. [翻译] SSKeychain

    SSKeychain https://github.com/soffes/sskeychain SSKeychain is a simple wrapper for accessing account ...

  10. git 代码比较工具,分支冲突解决

    下载地址:https://www.scootersoftware.com/BCompare-4.2.9.23626.exe