将 Quartz 从 IAS 移植到 JBoss AS
我正在将我们的代码从 IAS 移植到 JBoss AS。 有一个奇怪的行为,石英根本不触发任何事件,并且石英日志中没有出现错误。我还注意到 Quartz 表未填充(QRTZ_JOB_DETAILS、QRTZ_TRIGGERS 等)。
我正在使用 JOBStoreCMT 和quartz 版本 1.5.2。数据源已明确声明。作业和触发器在 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_pluginDS
oracle-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>
我缺少什么? PS,使用JobStoreTX时,一切正常,所以我猜这与容器事务管理器有关。
I am porting our code from IAS to JBoss AS.
There is strange behavior where quartz does not trigger any event at all, and no errors appear at quartz logs. I have also noticed that the Quartz tables are not populated (QRTZ_JOB_DETAILS, QRTZ_TRIGGERS etc.).
I am using JOBStoreCMT with quartz version 1.5.2. datasource is well declared. Jobs and triggers worked well in IAS and declared within the code.
quartz properties:
#============================================================================
# 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_pluginDS
oracle-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>
What am I missing?
PS, When using JobStoreTX, everything works well, so I guess it is something related to the container transaction manager.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过几天的思考这个问题,我找到了解决方案。
将以下属性添加到quartz.properties 文件中。就这么简单。
将此参数设置为 true 告诉 Quartz 不要在从 DataSource 获取的连接上调用 setAutoCommit(false) 。这在某些情况下会很有帮助,例如,如果您的司机抱怨在已经关闭的情况下呼叫它。此属性默认为 false,因为大多数驱动程序要求调用
setAutoCommit(false)
。由于某种原因,JBoss 覆盖了默认值,因此我必须显式添加它。
功劳归于未知用户:
http://osdir.com/ml/java.quartz.user /2007-10/msg00123.html
After hanging around the problem for the last couple of days I found a solution.
Adding the property below to quartz.properties file. As simple as that.
Setting this parameter to
true
tells Quartz not to callsetAutoCommit(false)
on connections obtained from the DataSource(s). This can be helpful in a few situations, such as if you have a driver that complains if it is called when it is already off. This property defaults to false, because most drivers require thatsetAutoCommit(false)
is called.For some reason JBoss overrides the default value, so I had to add it explicitly.
The credit goes to unknown user at:
http://osdir.com/ml/java.quartz.user/2007-10/msg00123.html