【问题标题】:porting Quartz from IAS to JBoss AS将 Quartz 从 IAS 移植到 JBoss AS
【发布时间】:2011-11-07 12:49:02
【问题描述】:

我正在将我们的代码从 IAS 移植到 JBoss AS。 有一种奇怪的行为,即石英根本不会触发任何事件,石英日志中也没有出现错误。我还注意到 Quartz 表没有填充(QRTZ_JOB_DETAILS、QRTZ_TRIGGERS 等)。

我正在使用带有石英版本 1.5.2 的 JOBStoreCMT。数据源声明得很好。作业和触发器在 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时,一切正常,所以我猜是与容器事务管理器有关。

【问题讨论】:

    标签: java jakarta-ee jboss quartz-scheduler


    【解决方案1】:

    在过去几天解决这个问题后,我找到了解决方案。

    将以下属性添加到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

    【讨论】:

      猜你喜欢
      • 2014-07-16
      • 2012-05-15
      • 1970-01-01
      • 1970-01-01
      • 2011-11-15
      • 2021-02-22
      • 1970-01-01
      • 2011-05-15
      • 2011-09-28
      相关资源
      最近更新 更多