我正在将我们的代码从IAS移植到JBoss AS。有一个奇怪的行为,quartz根本不触发任何事件,而且quartz日志中也没有出现任何错误。我还注意到Quartz表没有填充(QRTZ_JOB_DETAILS、QRTZ_TRIGGERS等)。
我使用的是quartz版本为1.5.2的JOBStoreCMT。datasource声明得很好。作业和触发器在IAS中工作良好,并在代码中声明。
石英属性:
#============================================================================
# Configure Main Scheduler Properties
#============================================================================
org.quartz.scheduler.instanceName = bitbandScheduler
org.quartz.scheduler.instanceId = AUTO
#============================================================================
# Configure ThreadPool
#============================================================================
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 15
org.quartz.threadPool.threadPriority = 5
#============================================================================
# Configure JobStore
#============================================================================
org.quartz.jobStore.misfireThreshold = 60000
org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreCMT
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate
org.quartz.jobStore.useProperties = false
org.quartz.jobStore.dataSource = bitband_pluginDS
org.quartz.jobStore.nonManagedTXDataSource = bitband_pluginDSTX
org.quartz.jobStore.tablePrefix = QRTZ_
org.quartz.jobStore.isClustered = false
org.quartz.jobStore.clusterCheckinInterval = 20000
#============================================================================
# Configure Datasources
#============================================================================
org.quartz.dataSource.bitband_pluginDS.jndiURL=java:bitband_pluginDS
org.quartz.dataSource.bitband_pluginDSTX.jndiURL=java:bitband_pluginDSoracle-ds.xml:
<xa-datasource>
<jndi-name>bitband_pluginDS</jndi-name>
<!-- uncomment to enable interleaving <interleaving/> -->
<isSameRM-override-value>false</isSameRM-override-value>
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
<xa-datasource-property name="URL">jdbc:oracle:thin:@ord-rtv063.orca.ent:1521:DB11g</xa-datasource-property>
<xa-datasource-property name="User">RIGHTV7_VS</xa-datasource-property>
<xa-datasource-property name="Password">RIGHTV7_VS</xa-datasource-property>
<max-pool-size>100</max-pool-size>
<min-pool-size>20</min-pool-size>
<valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name>
<check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>
<!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
<!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
<!-- Checks the Oracle error codes and messages for fatal errors -->
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->
<no-tx-separate-pools/>
<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
<metadata>
<type-mapping>Oracle9i</type-mapping>
</metadata>
</xa-datasource>我遗漏了什么?另外,在使用JobStoreTX时,一切都运行得很好,所以我猜这与容器事务管理器有关。
发布于 2011-11-08 15:51:59
在这个问题上徘徊了几天之后,我找到了一个解决方案。
正在将以下属性添加到quartz.properties文件。就这么简单。
org.quartz.jobStore.dontSetAutoCommitFalse=false将此参数设置为true告诉Quartz不要在从DataSource获取的连接上调用setAutoCommit(false)。在少数情况下,这可能很有帮助,例如,如果您的驱动程序在已经关闭的情况下被调用,则它会抱怨。此属性默认为false,因为大多数驱动程序都要求调用setAutoCommit(false)。
由于某些原因,JBoss覆盖了默认值,所以我必须显式地添加它。
该积分将授予未知用户:http://osdir.com/ml/java.quartz.user/2007-10/msg00123.html
https://stackoverflow.com/questions/8036731
复制相似问题