<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    KK

    Kim-'s-Blog.Object-Everything.I'm POJO.

    .紀-錄.爲了忘卻的記憶..真的勇士,要敢于直面遇到的問題,敢于正視繁雜的原碼......在實踐中積累!

      BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
      74 Posts :: 1 Stories :: 70 Comments :: 0 Trackbacks
    與 數據庫 db 相關操作有兩種:
    1.從DB中讀cronExpression
    2.Job持久化到數據庫
    對于1:
    Quartz 在Spring中動態設置cronExpression
    參考 小刀的blog
    http://m.tkk7.com/xiaodaoxiaodao/articles/103437.html 

    通過DB加載cronException

    一個類是可以的
    2個類會出問題

     <bean id="test2" class="cn.edu.hust.mes.service.quartz.Test">  
       
    <property name="scheduler" ref="schedulerFactoryBean"/>         
       
    </bean>  
         
       
    <bean id="test" class="Test">  
       
    <property name="scheduler" ref="schedulerFactoryBean"/>  
       
    </bean>  
         
       
    <bean name="schedulerFactoryBean"  
                 
    class="org.springframework.scheduling.quartz.SchedulerFactoryBean">  
              
    <property name="triggers">  
                   
    <list>  
                     
    <ref bean="cronTriggerForPLCRead"/>  
                     
    <ref bean="cronTrigger"/>  
                  
    </list>  
             
    </property>  
       
             
    <property name="configLocation" value="classpath:quartz.properties"/>  
        
    </bean> 


    Caused by: org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'schedulerFactoryBean': FactoryBean which is currently in creation returned null from getObject

    如果寫了攔截器的化 還會報這個錯 :

    Error creating bean with name 'test2': Bean with name 'test2' has been injected into other beans [schedulerJobDetailForPLCRead] in its raw version as part of a circular reference, but has eventually been wrapped (for example as part of auto-proxy creation). This means that said other beans do not use the final version of the bean. This is often the result of over-eager type matching - consider using 'getBeanNamesOfType' with the 'allowEagerInit' flag turned off, for example.


    對于2:
    MethodInvokingJobDetailFactoryBean 不能持久化
    必須用JobDetailBean 需繼承QuartzJobBean  不夠pojo
    使用MethodInvokingJobDetailFactoryBean的化會報:
    org.quartz.JobPersistenceException: Couldn't store job: Unable to serialize JobDataMap for insertion into database because the value of property 'methodInvoker' is not serializable: org.springframework.scheduling.quartz.MethodInvoki ngJobDetailFactoryBean [See nested exception: java.io.NotSerializableException: Unable to serialize JobDataMap for insertion into database because the value of property
    API上說了
    There's a note in the JavaDoc, I'd presume this might be your problem.
    JobDetails created via this FactoryBean are not serializable and thus not suitable for persistent job stores. You need to implement your own Quartz Job as a thin wrapper for each case where you want a persistent job to delegate to a specific service method.
    http://www.springframework.org/docs/api/org/springframework/scheduling/quartz/MethodInvokingJobDetailFactoryBean.html
    用MethodInvokingJobDetailFactoryBean不可持久化 除非加個thin wrapper
    但查不到任何資料
    但愿spring后續版本有好的方案 現在還是老老實實的用JobDetailBean吧

    另:
    不可用于web action action 用了session等作用域...
    Caused by: java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request? If you are actually operating within a web request and still receive this message,your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.
    posted on 2009-03-19 22:19 Kim' 閱讀(4255) 評論(0)  編輯  收藏

    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    jj
    主站蜘蛛池模板: 黄a大片av永久免费| 99久久免费看国产精品| 国产大片91精品免费观看男同| 亚洲av永久无码嘿嘿嘿| 国产免费女女脚奴视频网| 亚洲成人免费在线观看| 日韩免费精品视频| 亚洲一区AV无码少妇电影| 成人免费视频88| 国产亚洲精品成人久久网站| 亚洲性久久久影院| 国内精品一级毛片免费看| 亚洲婷婷综合色高清在线| 操美女视频免费网站| 免费看一级毛片在线观看精品视频| 亚洲av成人一区二区三区在线观看 | 亚洲砖码砖专无区2023 | 亚洲精品综合久久| 中文字幕乱理片免费完整的| 久久精品亚洲综合| 青娱乐免费视频在线观看| 亚洲精品无码av中文字幕| 亚洲国产精品一区二区第一页免| a级黄色毛片免费播放视频| 中文字幕在线观看亚洲| 免费看大黄高清网站视频在线| 一区二区免费电影| 67pao强力打造67194在线午夜亚洲| 成人性生活免费视频| 亚洲精品偷拍视频免费观看| 久久久无码精品亚洲日韩蜜桃| 亚洲精品动漫免费二区| 国产免费伦精品一区二区三区| 99久久精品国产亚洲| 欧洲精品免费一区二区三区| 中文字幕a∨在线乱码免费看| 亚洲综合男人的天堂色婷婷| 亚洲AV成人精品日韩一区18p| 亚洲免费视频播放| 一级毛片大全免费播放| 亚洲国产成a人v在线|