quartz.properties是quartz的配置文件啊。然后我自己开发的quartz打成了一个jar包。jar里面有我自己重写的quartz.properties文件。但是我发现我执行的时候还是用了quartz默认的quartz.properties文件而且没有用我自己写的quartz.properties文件,我应该怎么才能用自己写的quartz.properties文件啊?
解决方案 »
- 简单问题
- jdk6.0无法安装的问题
- javamail的sendmail问题553 Requested action not taken: address blocked
- 菜鸟求救, 如何合并2个 PDF 文件?
- JBuilder问题DateSet has no unique row identifiers
- 进来讨论一下,来者有分
- java反编译?
- 什么JAVA入门级的书好呢?
- ?????请问北京哪个书店有Visual age 的书????
- java String类方法 toLowerCase(Locale locale)
- 跪求:java的Timer为什么自动停止了 明天回家 着急...求求..
- 有谁有SCJP1.5的考纲吗?我只是想知道I/O要不要考。
找到他的jar里边的源码properties文件 , 用你的替换了,重新打包。也不麻烦 Struts2 版本没更新前中文问题没解决时我们就自己改源码的。
如果没有任何变化说明那个属性文件只是作为给用户的一个参考而打到jar包里的,
这样你就可以再试试把quartz.properties放到你工程的classpath下面(WEB-INF/classes下)
如果将配置文件打在包里面的话,你用相对路径得到后,你再怎么的在外面修改就修改不了配置文件了
友情帮LZ顶下
<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 这个属性配置的不对
我们用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
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).