quartz.properties是quartz的配置文件啊。然后我自己开发的quartz打成了一个jar包。jar里面有我自己重写的quartz.properties文件。但是我发现我执行的时候还是用了quartz默认的quartz.properties文件而且没有用我自己写的quartz.properties文件,我应该怎么才能用自己写的quartz.properties文件啊?

解决方案 »

  1.   

    quartz 没用过,不过如果你的quartz支持扩展配置文件直接import方式就可以了,但看你的意思是不支持,
    找到他的jar里边的源码properties文件 , 用你的替换了,重新打包。也不麻烦  Struts2 版本没更新前中文问题没解决时我们就自己改源码的。
      

  2.   

    你可以试试把quartz.properties文件删掉,程序会不会还是正常运行。
    如果没有任何变化说明那个属性文件只是作为给用户的一个参考而打到jar包里的,
    这样你就可以再试试把quartz.properties放到你工程的classpath下面(WEB-INF/classes下)
      

  3.   

       将配置文件写在SRC外面,里面得到配置文件用相当路径,打包的时候不要将文件打包应该就能通过你修改的配置文件得到相应的结果
        如果将配置文件打在包里面的话,你用相对路径得到后,你再怎么的在外面修改就修改不了配置文件了
       
      

  4.   

    最近也在研究quartz包。。可以一起讨论讨论。呵
      

  5.   

    接分  只要15分 ~~~~thanks.
      

  6.   

      没怎么用过LZ说的quartz
         友情帮LZ顶下
      

  7.   

    <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="autoStartup">
    <value>true</value>
    </property>
    <property name="waitForJobsToCompleteOnShutdown">
    <value>true</value>
    </property> <property name="configLocation" value="classpath:quartz.properties" /> <property name="triggers">
    <list>
    <ref local="ftpScanTrigger" />
    </list>
    </property>
    </bean>肯定 是你 configLocation 这个属性配置的不对
      

  8.   

    在原基础上修改他的properties文件不就可以了。。里面也没多少东西的。。自己的写的话,配置路径。
      

  9.   

    怎么还用quartz.properties?
    我们用quartz都是在xml中配置的了, 给LZ帖段用xml配置quartz的代码:<!-- 定时任务 开始 -->  
    <bean id="radius" class="com.zzt.isp.logagent.access.service.RadiusLogService" />  
      
    <!--定义radius目标bean和bean中的方法 -->  
    <bean id="radiusjobtask" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">  
        <property name="targetObject">  
            <ref local="radius" />  
        </property>  
        <property name="targetMethod">  
            <value>execute</value>  
        </property>  
        <!--定义radius为单线程-->  
        <property name="concurrent" value="false" />  
    </bean>  
    <!--定义radius触发的时间-->  
    <bean id="radiuscron" class="org.springframework.scheduling.quartz.CronTriggerBean">  
        <property name="jobDetail">  
            <ref bean="radiusjobtask" />  
        </property>  
        <property name="cronExpression">  
            <value>5/20 * * * * ?</value>  
        </property>  
    </bean>  
      
    <!--总管理-->  
    <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">  
        <property name="triggers">  
            <list>  
                <ref local="radiuscron" />  
            </list>  
        </property>  
    </bean> 
    前些天,才写的篇博客,呵呵~ 可以参考,个人感觉这么用确实很方便的。
    http://blog.csdn.net/zhangzhenting/archive/2010/02/04/5288929.aspx
      

  10.   

    建议楼主看看,Quartz Quick Start Guide里面的关于properties file的内容
    The properties fileQuartz uses a properties file called (kudos on the originality) quartz.properties. This isn't necessary at first, but to use anything but the most basic configuration it must be located on your classpath.Again, to give an example based on my personal situation, my application was developed using WebLogic Workshop. I keep all of my configuration files (including quartz.properties) in a project under the root of my application. When I package everything up into a .ear file, the config project gets packaged into a .jar which is included within the final .ear. This automatically puts quartz.properties on the classpath.If you're building a web application (i.e. in the form of a .war file) that includes Quartz, you will likely want to place the quartz.properties file in the WEB-INF/classes folder in order for it to be on the classpath.
    ConfigurationThis is the big bit! Quartz is a very configurable application. The best way to configure Quartz is to edit a quartz.properties file, and place it in your application's classpath (see Installation section above). 
      

  11.   

    在原基础上修改他的properties文件不就可以了。。