[Logo] Terracotta Discussion Forums
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Jobs and triggers not stored in db when using my own datasource and  XML
Forum Index -> Quartz
Author Message
stevehel

journeyman

Joined: 01/09/2012 16:05:17
Messages: 12
Offline

Quartz version : 1.6.6
AS : JBoss 4.3.0_CP08

Hi,

I have just installed quartz v1.6.6 and using now JobStoreCMT.

My problem : at startup of JBoss, jobs and triggers are not stored in database, and they are not fired.
No exceptions, no error messages. I have even a log saying me that each job was adding, but nothing in database...

Log at startup :
Code:
 00:48:20,102 INFO  [org.jboss.resource.deployment.RARDeployment.startService(RARDeployment.java:105)] Required license terms exist, view META-INF/ra.xml in .../deploy/deploy.last/quartz-ra.rar
 00:48:20,107 INFO  [org.jboss.resource.adapter.quartz.inflow.QuartzResourceAdapter.start(QuartzResourceAdapter.java:52)] start quartz!!!
 00:48:20,200 WARN  [org.quartz.plugins.xml.JobInitializationPlugin.setFileName(JobInitializationPlugin.java:139)] The "filename" plugin property is deprecated.  Please use "filenames" in the future.
 00:48:20,231 INFO  [org.quartz.core.SchedulerSignalerImpl.<init>(SchedulerSignalerImpl.java:63)] Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
 00:48:20,232 INFO  [org.quartz.core.QuartzScheduler.<init>(QuartzScheduler.java:215)] Quartz Scheduler v.1.6.6 created.
 00:48:20,235 INFO  [org.quartz.plugins.management.ShutdownHookPlugin.initialize(ShutdownHookPlugin.java:128)] Registering Quartz shutdown hook.
 00:48:20,236 INFO  [org.quartz.plugins.xml.JobInitializationPlugin.initialize(JobInitializationPlugin.java:265)] Registering Quartz Job Initialization Plug-in.
 00:48:20,239 INFO  [org.quartz.impl.jdbcjobstore.JobStoreSupport.initialize(JobStoreSupport.java:591)] Using db table-based data access locking (synchronization).
 00:48:20,243 INFO  [org.quartz.impl.jdbcjobstore.JobStoreCMT.initialize(JobStoreCMT.java:146)] JobStoreCMT initialized.
 00:48:20,244 INFO  [org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:1235)] Quartz scheduler 'X2010Scheduler' initialized from default resource file in Quartz package: 'quartz.properties'
 00:48:20,245 INFO  [org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:1239)] Quartz scheduler version: 1.6.6
 00:48:20,310 INFO  [org.quartz.impl.jdbcjobstore.JobStoreSupport.logWarnIfNonZero(JobStoreSupport.java:3505)] ClusterManager: detected 1 failed or restarted instances.
 00:48:20,311 INFO  [org.quartz.impl.jdbcjobstore.JobStoreSupport.clusterRecover(JobStoreSupport.java:3355)] ClusterManager: Scanning for instance "PT31401326149801976"'s failed in-progress jobs.
 00:48:20,328 INFO  [org.quartz.impl.jdbcjobstore.JobStoreSupport.storeJob(JobStoreSupport.java:1089)] note: volatile jobs are effectively non-volatile in a clustered environment.
 00:48:20,339 INFO  [org.quartz.impl.jdbcjobstore.JobStoreSupport.storeTrigger(JobStoreSupport.java:1168)] note: volatile triggers are effectively non-volatile in a clustered environment.
 00:48:20,363 INFO  [org.quartz.xml.JobSchedulingDataProcessor.processFile(JobSchedulingDataProcessor.java:493)] Parsing XML file: x2010ScheduleJobs.xml with systemId: x2010ScheduleJobs.xml validating: false validating schema: jar:file:/C:/java/jboss-4.3.0.GA_CP08/server/default/lib/quartz-all-1.6.6.jar!/org/quartz/xml/job_scheduling_data_1_5.xsd
 00:48:20,465 INFO  [org.quartz.xml.JobSchedulingDataProcessor.scheduleJobs(JobSchedulingDataProcessor.java:587)] Scheduling 13 parsed jobs.
 00:48:20,472 INFO  [org.quartz.xml.JobSchedulingDataProcessor.scheduleJob(JobSchedulingDataProcessor.java:699)] Adding job: PURGE.FMK PURGE USER WCS
 00:48:20,520 INFO  [org.quartz.xml.JobSchedulingDataProcessor.scheduleJob(JobSchedulingDataProcessor.java:699)] Adding job: STATE MEMORY.DATA STATE MEMORYWCS
 00:48:20,530 INFO  [org.quartz.xml.JobSchedulingDataProcessor.scheduleJob(JobSchedulingDataProcessor.java:699)] Adding job: SEND DOCUMENT.SEND BROADCAST ERROR
 00:48:20,541 INFO  [org.quartz.xml.JobSchedulingDataProcessor.scheduleJob(JobSchedulingDataProcessor.java:699)] Adding job: PURGE.PURGE_ALL_MODULES
 00:48:20,552 INFO  [org.quartz.xml.JobSchedulingDataProcessor.scheduleJob(JobSchedulingDataProcessor.java:699)] Adding job: PURGE.DATA_PURGE_LOST_OBJECTS_ALL_MODULES
 00:48:20,563 INFO  [org.quartz.xml.JobSchedulingDataProcessor.scheduleJob(JobSchedulingDataProcessor.java:699)] Adding job: SEND DOCUMENT.SEND WCS BOX TO PURGE
 00:48:20,573 INFO  [org.quartz.xml.JobSchedulingDataProcessor.scheduleJob(JobSchedulingDataProcessor.java:699)] Adding job: STATE MEMORY.DATA_STATE_MEMORY
 00:48:20,584 INFO  [org.quartz.xml.JobSchedulingDataProcessor.scheduleJob(JobSchedulingDataProcessor.java:699)] Adding job: PURGE.PURGE_SUPERVISION
 00:48:20,595 INFO  [org.quartz.xml.JobSchedulingDataProcessor.scheduleJob(JobSchedulingDataProcessor.java:699)] Adding job: SEND DOCUMENT.SEND StationInformation
 00:48:20,608 INFO  [org.quartz.xml.JobSchedulingDataProcessor.scheduleJob(JobSchedulingDataProcessor.java:699)] Adding job: PTB.DISPLAY_LAST_DATA
 00:48:20,619 INFO  [org.quartz.xml.JobSchedulingDataProcessor.scheduleJob(JobSchedulingDataProcessor.java:699)] Adding job: SUPERVISION_RefreshSupervisionData.REFRESH SUPERVISION DATA
 00:48:20,633 INFO  [org.quartz.xml.JobSchedulingDataProcessor.scheduleJob(JobSchedulingDataProcessor.java:699)] Adding job: PTB.MANAGE PTB ORDERS DISPLAY
 00:48:20,645 INFO  [org.quartz.xml.JobSchedulingDataProcessor.scheduleJob(JobSchedulingDataProcessor.java:697)] Replacing job: SEND DOCUMENT.SEND WCS BOX TO PURGE
 00:48:20,660 INFO  [org.quartz.xml.JobSchedulingDataProcessor.scheduleJobs(JobSchedulingDataProcessor.java:607)] 12 scheduled jobs.
 00:48:20,661 INFO  [org.quartz.core.QuartzScheduler.start(QuartzScheduler.java:461)] Scheduler X2010Scheduler_$_PT31401326152900204 started.
 00:48:20,692 INFO  [org.quartz.impl.jdbcjobstore.JobStoreSupport.storeTrigger(JobStoreSupport.java:1168)] note: volatile triggers are effectively non-volatile in a clustered environment.
 


I've configured 2 datasources in quartz.properties, one for managed connections (using my xa datasource) and one for the non managed transactions (defined in quartz.properties).

Code:
 #org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
 org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreCMT
 #org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate
 org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.oracle.OracleDelegate
 org.quartz.jobStore.useProperties = false
 
 org.quartz.jobStore.dataSource = JBOSS_DS
 org.quartz.dataSource.JBOSS_DS.jndiURL=java:QuartzDS
 #org.quartz.jobStore.dontSetAutoCommitFalse = true
 
 org.quartz.jobStore.tablePrefix = QRTZ_
 org.quartz.jobStore.isClustered = true
 org.quartz.jobStore.clusterCheckinInterval = 20000
 org.quartz.jobStore.misfireThreshold = 60000
 #org.quartz.jobStore.selectWithLockSQL =
 org.quartz.jobStore.nonManagedTXDataSource = myDS
 #org.quartz.jobStore.dontSetNonManagedTXConnectionAutoCommitFalse = false
 #org.quartz.jobStore.txIsolationLevelReadCommitted = READ_COMMITTED_ISOLATION
 
 #Oracle
 org.quartz.dataSource.myDS.driver = oracle.jdbc.driver.OracleDriver
 org.quartz.dataSource.myDS.URL = jdbc:oracle:thin:@localhost:1521:xe
 org.quartz.dataSource.myDS.user = x2010conf 
 org.quartz.dataSource.myDS.password = x2010conf
 org.quartz.dataSource.myDS.maxConnections = 5
 


And my oracle-xa-ds.xml defining my datasource :

Code:
 <datasources>
   <xa-datasource>
     <jndi-name>QuartzDS</jndi-name>
     <track-connection-by-tx/>
     <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:@localhost:1521:xe</xa-datasource-property>
     <xa-datasource-property name="User">x2010conf</xa-datasource-property>
     <xa-datasource-property name="Password">x2010conf</xa-datasource-property>
     
     
     <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 -->
     <metadata>
        <type-mapping>Oracle9i</type-mapping>
     </metadata>
       
     <!--pooling parameters-->
     <min-pool-size>1</min-pool-size>
     <max-pool-size>200</max-pool-size>
     
   </xa-datasource>
 
 


If I change this property (org.quartz.jobStore.dontSetAutoCommitFalse) to true, jobs and triggers are created, but stays in ACQUIRED state in clustered environment, and quartz seems to not work anymore (jobs not fired) until I let only one JBoss active.

Any idea of what I'm missing ?

Thanks in advance for your help.

Steve
jhouse

seraphim
[Avatar]
Joined: 11/06/2009 15:29:56
Messages: 1703
Offline

Sounds very much like your code that is creating and storing the triggers/jobs is not calling commit() on the JTA transaction after doing the scheduling (e.g. scheduler.scheduleJob(job, trigger)).
stevehel

journeyman

Joined: 01/09/2012 16:05:17
Messages: 12
Offline

Thanks for your answer.
Jobs are created automatically from an xml file at startup of QuartzService during JBoss startup, no code like scheduler.scheduleJob is done manually.
jhouse

seraphim
[Avatar]
Joined: 11/06/2009 15:29:56
Messages: 1703
Offline

Could you share your complete set of quartz config properties?
stevehel

journeyman

Joined: 01/09/2012 16:05:17
Messages: 12
Offline

Yes :

Code:
 # Properties file for use by StdSchedulerFactory
 # to create a Quartz Scheduler Instance.
 #
 # Instances of the specified JobStore, ThreadPool and Logger classes will
 # be created by name, and then any additional properties specified for them
 # in this file will be set on the instance by calling an equivalent 'set'
 # method. (see below for more examples)
 #
 
 # ===========================================================================
 # Configure Main Scheduler Properties  ======================================
 # ===========================================================================
 #
 # The general pattern for defining the scheduler's main properties is:
 #
 #     org.quartz.scheduler.instanceName = SCHED_NAME
 #     org.quartz.scheduler.instanceId = INSTANCE_ID
 #     org.quartz.scheduler.threadName = THREAD_NAME
 #     org.quartz.scheduler.rmi.export = false
 #     org.quartz.scheduler.rmi.proxy = false
 #     org.quartz.scheduler.rmi.registryHost = localhost
 #     org.quartz.scheduler.rmi.registryPort = 1099
 #     org.quartz.scheduler.rmi.createRegistry = never
 #     org.quartz.scheduler.userTransactionURL = USER_TX_LOCATION
 #     org.quartz.scheduler.wrapJobExecutionInUserTransaction = JOBS_IN_USER_TX
 #     org.quartz.scheduler.idleWaitTime = IDLE_WAIT_TIME
 #     org.quartz.scheduler.dbFailureRetryInterval = DB_FAILURE_RETRY_INTERVAL
 #     org.quartz.scheduler.classLoadHelper.class = CLASS_LOAD_HELPER_CLASS
 #     org.quartz.context.key.SOME_KEY = SOME_VALUE
 #
 #
 # "SCHED_NAME" can be any string, and has no meaning to the scheduler itself -
 # but rather serves as a mechanism for client code to distinguish schedulers
 # when multiple instances are used within the same program.  If you are using
 # the clustering features, you must use the same name for every instance in
 # the cluster that is 'logically' the same Scheduler.
 #
 # "INSTANCE_ID" can be any string, and but must be unique for all schedulers
 # working as if they are the same 'logical' Scheduler within a cluster.
 # you may use the value "AUTO" as the instanceId if you wish the Id to be
 # generated for you.
 #
 # "THREAD_NAME" can be any String that is a valid name for a java thread. If
 # this property is not specified, the thread will receive the scheduler's
 # name ("org.quartz.scheduler.instanceName").
 #
 # "USER_TX_LOCATION" should be set to the JNDI URL at which Quartz can locate
 # the Application Server's UserTransaction manager.  The default value (if not
 # specified) is "java:comp/UserTransaction" - which works for almost all
 # Application Servers.  Websphere users may need to set this property to
 # "jta/usertransaction".  This is only used if Quartz is configured to use
 # JobStoreCMT, and "JOBS_IN_USER_TX" is set to true.
 #
 # "JOBS_IN_USER_TX" should be set to "true" if you want Quartz to start a
 # UserTransaction before calling execute on your job.  The Tx will commit after
 # the job's execute method completes, and the JobDataMap is updated (if it is
 # a StatefulJob).  The default value is "false".
 #
 # "IDLE_WAIT_TIME" is the amount of time in milliseconds that the scheduler
 # will wait before re-queries for available triggers when the scheduler is otherwise
 # idle.  Normally you should not have to 'tune' this parameter, unless you're using
 # XA transactions, and are having problems with delayed firings of triggers that
 # should fire immediately.
 #
 # "DB_FAILURE_RETRY_INTERVAL" is the amount of time in milliseconds that the
 # scheduler will wait between re-tries when it has detected a loss of
 # connectivity to the database (obviously not meaningful with RamJobStore)
 #
 # "CLASS_LOAD_HELPER_CLASS" defaults to the most robust approach, which is to
 # use the "org.quartz.simpl.CascadingClassLoadHelper" class - which in turn
 # uses every other ClassLoadHelper class until one works.  You should probably
 # not find the need to specify any other class for this property, though strange
 # things seem to happen within application servers.  All of the current
 # ClassLoadHelper implementation can be found in the "org.quartz.simpl" package.
 #
 # "SOME_KEY" and "SOME_VALUE" represent a name-value pair that will be placed
 # into the "scheduler context" as strings. (see Scheduler.getContext()).
 # So for example, the setting "org.quartz.context.key.MyKey = MyValue" would
 # perform the equivalent of scheduler.getContext().put("MyKey", "MyValue").
 #
 #
 # RMI notes:
 #
 # If you want the Quartz Scheduler exported via RMI as a server then set
 # the 'rmi.export' flag to true.  You must also then specify a  host and
 # port for the rmiregistry process - which is typically 'localhost' port 1099.
 #
 # Set the 'rmi.createRegistry' flag according to how you want Quartz to cause
 # the creation of an RMI Registry.  Use "false" or "never" if you don't want
 # Quartz to create a registry.  Use "true" or "as_needed" if you want Quartz
 # to first attempt to use an existing registry, and then fall back to creating
 # one.  Use "always" if you want Quartz to attempt creating a Registry, and
 # then fall back to using an existing one.
 #   If a registry is created, it will be bound to port number in the given
 # the 'rmi.registryPort' property, and 'rmi.registryHost' should be "localhost".
 #
 # If you want to connect (use) a remotely served scheduler, then set the
 # 'rmi.proxy' flag to true.  You must also then specify a  host and port
 # for the rmiregistry process - which is typically 'localhost' port 1099.
 #
 # You cannot specify a 'true' value for both 'export' and 'proxy' - if you
 # do, the 'export' option will be ignored.  A value of 'false' for both
 # 'export' and 'proxy' properties is of course valid.
 #
 org.quartz.scheduler.instanceName = X2010Scheduler
 org.quartz.scheduler.instanceId = AUTO
 org.quartz.scheduler.rmi.export = false
 org.quartz.scheduler.rmi.proxy = false
 
 
 # ===========================================================================
 # Configure ThreadPool  =====================================================
 # ===========================================================================
 #
 # The general pattern for defining a thread pool is the following:
 #
 #     org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
 #     org.quartz.threadPool.threadCount = THREAD_COUNT
 #     org.quartz.threadPool.threadPriority = THREAD_PRIO
 #
 #       optional parameters for SimpleThreadPool are:
 #
 #         org.quartz.threadPool.makeThreadsDaemons = DAEMON_THREADS
 #         org.quartz.threadPool.threadsInheritGroupOfInitializingThread = INHERIT_GRP
 #         org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread = INHERIT_LDR
 #
 #  or
 #
 #     org.quartz.threadPool.class = com.mycompany.goo.FooThreadPool
 #     org.quartz.threadPool.somePropOfFooThreadPool = someValue
 #
 # "THREAD_COUNT" can be any positive integer, although you should realize that
 # only numbers between 1 and 100 are very practical.  This is the number of
 # threads that are available for concurrent execution of jobs.  If you only
 # have a few jobs that fire a few times a day, then 1 thread is plenty! If you
 # have tens of thousands of jobs, with many firing every minute, then you
 # probably want a thread count more like 50 or 100 (this highly depends on the
 # nature of the work that your jobs perform, and your systems resources!)
 #
 # "THREAD_PRIO" can be any int between Thread.MIN_PRIORITY (1) and
 # Thread.MAX_PRIORITY (10).  The default is Thread.NORM_PRIORITY (5).
 #
 # "DAEMON_THREADS" can be set to "true" to have the threads in the pool created
 # as daemon threads.  Default is "false".
 #
 # "INHERIT_GRP" can be "true" or "false", and defaults to true.
 #
 # "INHERIT_LDR" can be "true" or "false", and defaults to false.
 #
 org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
 org.quartz.threadPool.threadCount = 20
 org.quartz.threadPool.threadPriority = 5
 
 # ===========================================================================
 # Configure JobStore  =======================================================
 # ===========================================================================
 #
 # The general pattern for defining a JobStore is one of the following:
 #
 #     org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore
 #     org.quartz.jobStore.misfireThreshold = MISFIRE_THRESHOLD
 #
 #  or
 #
 #     org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.<JobStoreClass>
 #       Where JobStoreClass is one of:
 #         - JobStoreTX is for standalone-Quartz implementations
 #         - JobStoreCMT is for appserver-based container-managed
 #           transaction Quartz implementations
 #
 #     org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.<DriverDelegateClass>
 #      org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.oracle.OracleDelegate
 #       Where DriverDelegateClass is one of:
 #         - StdJDBCDelegate (for many JDBC-compliant drivers)
 #         - MSSQLDelegate (for Microsoft SQL Server drivers)
 #         - PostgreSQLDelegate (for PostgreSQL drivers)
 #         - WebLogicDelegate (for WebLogic drivers)
 #         - oracle.OracleDelegate (for Oracle drivers)
 #
 #     org.quartz.jobStore.useProperties = USE_PROPERTIES
 #     org.quartz.jobStore.dataSource = DS_NAME
 #     org.quartz.jobStore.tablePrefix = TABLE_PREFIX
 #     org.quartz.jobStore.isClustered = IS_CLUSTERED
 #     org.quartz.jobStore.selectWithLockSQL = LOCKING_SELECT_STATEMENT
 #     org.quartz.jobStore.dontSetAutoCommitFalse = DONT_TURN_OFF_AUTO_COMMIT
 #     org.quartz.jobStore.maxMisfiresToHandleAtATime = MAX_MISFIRE_HANDLE
 #     org.quartz.jobStore.txIsolationLevelSerializable = SERIALIZABLE_ISOLATION
 #
 #   If you're using JobStoreCMT then you need this param also:
 #
 #     org.quartz.jobStore.nonManagedTXDataSource = NON_MANAGED_TX_DS_NAME
 #
 #   And, if you're using JobStoreCMT, then these params are optional:
 #
 #     org.quartz.jobStore.dontSetNonManagedTXConnectionAutoCommitFalse = DONT_TURN_OFF_AUTO_COMMIT
 #     org.quartz.jobStore.txIsolationLevelReadCommitted = READ_COMMITTED_ISOLATION
 #
 #
 #  or, for a custom JobStore implementation:
 #
 #     org.quartz.jobStore.class = com.mycompany.goo.FooJobStore
 #     org.quartz.jobStore.somePropOfFooJobStore = someValue
 #
 #
 # The value of "MISFIRE_THRESHOLD" should be the number of milliseconds the
 # scheduler will 'tolerate' a trigger to pass its next-fire-time by, before
 # being considered "misfired".  The default value (if you don't make an entry
 # of this property in your configuration) is 60000 (60 seconds).
 #
 # The value of "MAX_MISFIRE_HANDLE" is the maximum number of misfired triggers
 # that the misfire handlingthread will try to recover at one time (within one
 # transaction).  If unspecified, the default is 20.
 #
 # The "USE_PROPERTIES" flag (true or false value - defaults to false) instructs
 # JDBCJobStore that all values in JobDataMaps will be Strings, and therefore
 # can be stored as name-value pairs, rather than storing more complex objects
 # in their serialized form in the BLOB column.  This is much safer in the long
 # term, as you avoid the class versioning issues that there are with
 # serializing your non-String classes into a BLOB.
 #
 # JDBCJobStore's "DS_NAME" must be the name of one the datasources
 # defined in this file. JobStoreCMT _requires_ a datasource that contains
 # container-managed-transaction-capable connections.  Typically this means a
 # datasource that is managed by an application server, and used by Quartz by
 # specifying the JNDI url of the datasource.
 #
 # JobStoreCMT also _requires_ a (second) datasource that contains connections
 # that will not be part of container-managed transactions.
 # "NON_MANAGED_TX_DS_NAME" must be the name of one the datasources defined in
 # this file. - This datasource must contain non-container-transaction managed
 # connections.
 #
 # JDBCJobStore's "TABLE_PREFIX" property is a string equal to the prefix
 # given to Quartz's tables that were created in your database.
 #
 # JDBCJobStore's "IS_CLUSTERED" property must be set to either "true" or
 # "false".  If unset, the default is "false".  This property must be set
 # to "true" if you are having multiple instances of Quartz use the same
 # set of database tables... otherwise you will experience havoc.  Also
 # note that each instance in the cluster MUST have a unique "instance id"
 # (the "org.quartz.scheduler.instanceId" property), but should have the
 # same "scheduler instance name" ("org.quartz.scheduler.instanceName").
 #
 # * NOTE: Never run clustering on separate machines, unless their clocks are
 #         synchronized using some form of time-sync service (daemon) that runs
 #         very regularly (the clocks must be within a second of each other).
 #         See http://www.boulder.nist.gov/timefreq/service/its.htm if you are
 #         unfamiliar with how to do this.
 #
 #         Also: never fire-up a non-clustered instance against the same set
 #         of tables that any other instance is running against.  You will
 #         get serious data corruption, and eratic behavior.
 #
 #
 # JDBCJobStore's "LOCKING_SELECT_STATEMENT" property must be a SQL string
 # that selects a row in the "LOCKS" table and places a lock on it. If not
 # set, the default is "SELECT * FROM {0}LOCKS WHERE LOCK_NAME = ? FOR UPDATE", 
 # which works for most databases.  The "{0}" is replaced during run-time 
 # with the TABLE_PREFIX that you configured above.
 #
 # "DONT_TURN_OFF_AUTO_COMMIT" tells Quartz not to call setAutoCommit(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.
 #
 # "SERIALIZABLE_ISOLATION" tells Quartz (when using JobStoreTX or CMT) to call 
 # setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);  on JDBC 
 # connections.  This can be helpful to prevent lock timeouts with some databases 
 # under high load, and "longer"-lasting transactions.
 #
 # "READ_COMMITTED_ISOLATION" tells Quartz (When using JobStoreCMT) to call
 # setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);  on the
 # non-managed JDBC connections.  This can be helpful to prevent lock timeouts 
 # with some databases (such as DB2) under high load, and "longer"-lasting 
 # transactions.
 #
 #
 #
 #org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
 org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreCMT
 #org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate
 org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.oracle.OracleDelegate
 #org.quartz.jobStore.dontSetAutoCommitFalse = true
 org.quartz.jobStore.useProperties = false
 org.quartz.jobStore.dataSource = myDS
 #org.quartz.jobStore.dataSource = JBOSS_DS
 org.quartz.jobStore.tablePrefix = QRTZ_
 org.quartz.jobStore.isClustered = true
 org.quartz.jobStore.clusterCheckinInterval = 20000
 org.quartz.jobStore.misfireThreshold = 60000
 #org.quartz.jobStore.selectWithLockSQL =
 org.quartz.jobStore.nonManagedTXDataSource = myDS
 #org.quartz.jobStore.dontSetNonManagedTXConnectionAutoCommitFalse = false
 #org.quartz.jobStore.txIsolationLevelReadCommitted = READ_COMMITTED_ISOLATION
 
 # ===========================================================================
 # Configure Datasources  ====================================================
 # ===========================================================================
 #
 # (only needed when using JDBCJobStore, or a plugin that requires JDBC)
 #
 # -- If your Scheduler is very busy (i.e. nearly always executing the same
 #    number of jobs as the size of the thread pool, then you should probably
 #    set the number of connections in the DataSource to be the size of the
 #    thread pool + 1
 #
 # The general pattern for defining a DataSource is one of the following:
 #
 #     org.quartz.dataSource.NAME.driver = DRIVER_CLASS_NAME
 #     org.quartz.dataSource.NAME.URL = DB_URL
 #     org.quartz.dataSource.NAME.user = DB_USER
 #     org.quartz.dataSource.NAME.password = DB_PASSWORD
 #     org.quartz.dataSource.NAME.maxConnections = DB_POOL_SIZE
 #     org.quartz.dataSource.NAME.validationQuery= VALIDATION_QUERY
 #
 #  or
 #
 #     org.quartz.dataSource.NAME.jndiURL = DB_JNDI_URL
 #
 #  or
 #     org.quartz.dataSource.NAME.jndiURL = DB_JNDI_URL
 #     org.quartz.dataSource.NAME.jndiAlwaysLookup = DB_JNDI_ALWAYS_LOOKUP
 #     org.quartz.dataSource.NAME.java.naming.factory.initial = JNDI_CTXT_FACTORY
 #     org.quartz.dataSource.NAME.java.naming.provider.url = JNDI_PROVIDER_URL
 #     org.quartz.dataSource.NAME.java.naming.security.principal = JNDI_PRINCIPAL
 #     org.quartz.dataSource.NAME.java.naming.security.credentials = JNDI_CREDENTIALS
 #
 #
 # The DataSource's "NAME" can be anything you want, and has no meaning other
 # than being able to 'define' a DataSource here, and assign it by name to the
 # JDBCJobStore.
 #
 # With the two types of DataSource definition shown above, a DataSource can
 # either be created with the given database connection information, or can
 # be "logically mapped" to use a DataSource that is managed by an application
 # server an made available via JNDI.
 #
 # "DRIVER_CLASS_NAME" must be the java class name of the JDBC driver for your
 # database.
 #
 # "DB_URL" must be the connection URL (host, port, etc.) for connection to your
 # database.
 #
 # "DB_USER" is the user name to use when connecting to your database.
 #
 # "DB_USER" is the password to use when connecting to your database.
 #
 # "DB_POOL_SIZE" is the maximum number of connections that the DataSource can
 # create in it's pool of connections.
 #
 # "VALIDATION_QUERY" is an optional SQL query string that the DataSource
 # can use to detect and replace failed/corrupt connections.  For example an
 # oracle user might choose "select table_name from user_tables" - which is a
 # query that should never fail - unless the connection is actually bad.
 #
 # "DB_JNDI_URL" is the JNDI URL for a DataSource that is managed by your
 # application server.  Additionally, you can provide the class name of the 
 # JNDI InitialContextFactory that you wish to use, the provider's URL, and
 # a username & password for connecting to the JNDI provider, if it is not
 # the default provider of your environment.
 #
 # "DB_JNDI_ALWAYS_LOOKUP" can be "true" or "false" - if the property is not
 # set, the default is "false".  This option tells Quartz whether or not it
 # should always lookup the DataSource under the JNDI tree each time it 
 # needs to get a connection from it.  If set to (the default) "false",
 # Quartz will "hold on to" the DataSource after looking it up only once.
 #
 
 #Oracle
 org.quartz.dataSource.JBOSS_DS.jndiURL=java:/DefaultDS
 
 org.quartz.dataSource.myDS.driver = oracle.jdbc.driver.OracleDriver
 org.quartz.dataSource.myDS.URL = jdbc:oracle:thin:@XXXXX:1521:lmprod
 org.quartz.dataSource.myDS.user = XXXXX  
 org.quartz.dataSource.myDS.password = XXXXX 
 org.quartz.dataSource.myDS.maxConnections = 5
 
 #Mysql
 #org.quartz.dataSource.myDS.driver = com.mysql.jdbc.Driver
 #org.quartz.dataSource.myDS.URL = jdbc:mysql://localhost:3306/jbossdb
 #org.quartz.dataSource.myDS.user = jboss
 #org.quartz.dataSource.myDS.password = jboss
 #org.quartz.dataSource.myDS.maxConnections = 5
 
 #org.quartz.dataSource.myDS.jndiURL=jdbc/PAWS
 #org.quartz.dataSource.myDS.jndiAlwaysLookup=false
 #org.quartz.dataSource.myDS.java.naming.factory.initial=com.evermind.server.rmi.RMIInitialContextFactory
 #org.quartz.dataSource.myDS.java.naming.provider.url=ormi://localhost
 #org.quartz.dataSource.myDS.java.naming.security.principal=admin
 #org.quartz.dataSource.myDS.java.naming.security.credentials=123
 
 
 # ===========================================================================
 # Configure SchedulerPlugins  ===============================================
 # ===========================================================================
 #
 # The general pattern for defining a SchedulerPlugin is the following:
 #
 #     org.quartz.plugin.NAME.class = PLUGIN_CLASS_NAME
 #
 # If the plugin class has properties you want set via some "setter" methods
 # on the class, name the properties and values as such
 #
 #     org.quartz.plugin.NAME.propName = propValue
 #
 # ...where "propName" corrisponds to a "setPropName" method on the plugin
 # class.  Only primitive data type values (including Strings) are supported.
 #
 #
 # Configure Plugins =========================================================
 
 #org.quartz.plugin.triggHistory.class = org.quartz.plugins.history.LoggingTriggerHistoryPlugin
 #org.quartz.plugin.triggHistory.triggerFiredMessage = Trigger {1}.{0} fired job {6}.{5} at: {4, date, HH:mm:ss MM/dd/yyyy}
 #org.quartz.plugin.triggHistory.triggerCompleteMessage = Trigger {1}.{0} completed firing job {6}.{5} at {4, date, HH:mm:ss MM/dd/yyyy} with resulting trigger instruction code: {9}
 
 org.quartz.plugin.jobInitializer.class = org.quartz.plugins.xml.JobInitializationPlugin
 org.quartz.plugin.jobInitializer.fileName = x2010ScheduleJobs.xml
 org.quartz.plugin.jobInitializer.overWriteExistingJobs = false
 org.quartz.plugin.jobInitializer.failOnFileNotFound = false
 org.quartz.plugin.jobInitializer.scanInterval = 10
 #org.quartz.plugin.jobInitializer.useContextClassLoader = true
 
 org.quartz.plugin.shutdownhook.class = org.quartz.plugins.management.ShutdownHookPlugin
 org.quartz.plugin.shutdownhook.cleanShutdown = true
 
 # ===========================================================================
 # Configure Listeners         ===============================================
 # ===========================================================================
 #
 # The general pattern for defining a "Global" TriggerListener is:
 #
 #     org.quartz.triggerListener.NAME.class = TRIGGER_LISTENER_CLASS_NAME
 #
 # The general pattern for defining a "Global" JobListener is the following:
 #
 #     org.quartz.jobListener.NAME.class = JOB_LISTENER_CLASS_NAME
 #
 # "NAME" becomes the listener's name, and a "setName(String)" method is
 # reflectively found and called on the class that is instantiated.
 #
 # If the listener class has properties you want set via some "setter" methods
 # on the class, name the properties and values as such
 #
 #     org.quartz.triggerListener.NAME.propName = propValue
 # or
 #     org.quartz.jobListener.NAME.propName = propValue
 #
 # ...where "propName" corrisponds to a "setPropName" method on the listener
 # class.  Only primitive data type values (including Strings) are supported.
 #
 #
 # Configure Plugins =========================================================
 
 #org.quartz.triggerListener.dummy.class = org.quartz.examples.DumbTriggerListener
 
 



And content of x2010ScheduleJobs.xml where jobs are declared (one job only for this one) :

Code:
 <?xml version='1.0' encoding='utf-8'?>
 <quartz xmlns="http://www.opensymphony.com/quartz/JobSchedulingData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	xsi:schemaLocation="http://www.opensymphony.com/quartz/JobSchedulingData
   http://www.opensymphony.com/quartz/xml/job_scheduling_data_1_5.xsd"
 	version="1.5">
 
 <!-- framework -->
 	<job>
 	  <job-detail>
 	    <name>FMK PURGE USER WCS</name>
 	    <group>PURGE</group>
 	    <description>Send a user purge notification to the scheduler for WCS</description>
 	    <job-class>com.asis.x2010.fmk.business.quartz.FmkEJBInvokeStateful</job-class>
 	    <volatility>false</volatility>
 	    <durability>true</durability>
 	    <recover>true</recover>
 	    <job-data-map allows-transient-data="true">
 				<entry><key>sleepStart</key><value>20</value></entry>
 	      <entry><key>ejb</key><value>wcs-Application/FMK/DV/EJB/SchedulerManagerFmkSessionBean/remote</value></entry>
 	      <entry><key>method</key><value>purgeUser</value></entry>
 	      <entry><key>argTypes1</key><value>int</value></entry>
 	      <entry><key>args1</key><value>0</value></entry>    
 	      <entry><key>argTypes2</key><value>int</value></entry>
 	      <entry><key>args2</key><value>5</value></entry>
 	    </job-data-map>
 	  </job-detail>
 	  <trigger>
 			<cron>
 	      <name>TriggerFMKPurgeUserWCS</name>
 	      <group>TRIGGER_FMKPurgeUser</group>
 	      <description>Send a user purge notification trigger to the scheduler for WCS</description>
 	      <job-name>FMK PURGE USER WCS</job-name>
 	      <job-group>PURGE</job-group>
 	      <cron-expression>0 0 8 * * ?</cron-expression>
 			</cron>
 	  </trigger>
 	</job>
 	<job>
 		<job-detail>
 			<name>DATA STATE MEMORYWCS</name>
 			<group>STATE MEMORY</group>
 			<description>State Memory WCS</description>
 			<job-class>com.asis.x2010.fmk.business.quartz.FmkEJBInvokeStateful</job-class>
 			<volatility>false</volatility>
 			<durability>true</durability>
 			<recover>false</recover>
 			<job-data-map allows-transient-data="true">
 				<entry><key>sleepStart</key><value>120</value></entry>
 				<entry><key>ejb</key><value>wcs-Application/FMK/DV/EJB/StateMemoryFmkSessionBean/remote</value></entry>
 				<entry><key>method</key><value>getMemory</value></entry>
 			</job-data-map>
 			</job-detail>
 			<trigger>
 				<simple>
 					<name>TriggerDataStateMemoryWCS</name>
 					<group>TRIGGER_DATA_MEMORY_WCS</group>
 					<description>State Memory Trigger WCS</description>
 					<job-name>DATA STATE MEMORYWCS</job-name>
 					<job-group>STATE MEMORY</job-group>
 					<repeat-count>-1</repeat-count>
 					<repeat-interval>60000</repeat-interval>
 				</simple>
 			</trigger>
 	</job>
 
 
 </quartz>
 
 
jhouse

seraphim
[Avatar]
Joined: 11/06/2009 15:29:56
Messages: 1703
Offline


Please try adding this property:

org.quartz.plugin.jobInitializer.wrapInUserTransaction = true

stevehel

journeyman

Joined: 01/09/2012 16:05:17
Messages: 12
Offline

I've added the property, and I have an error message at startup no :

Code:
 11:21:34,344 INFO  [QuartzScheduler] Quartz Scheduler v.1.6.6 created.
 11:21:34,347 INFO  [ShutdownHookPlugin] Registering Quartz shutdown hook.
 11:21:34,348 INFO  [JobInitializationPlugin] Registering Quartz Job Initialization Plug-in.
 11:21:34,351 INFO  [JobStoreCMT] Using db table-based data access locking (synchronization).
 11:21:34,356 INFO  [JobStoreCMT] JobStoreCMT initialized.
 11:21:34,357 INFO  [StdSchedulerFactory] Quartz scheduler 'X2010Scheduler' initialized from default resource file in Quartz package: 'quartz.properties'
 11:21:34,357 INFO  [StdSchedulerFactory] Quartz scheduler version: 1.6.6
 11:21:34,433 ERROR [JobInitializationPlugin] Failed to start UserTransaction for plugin: jobInitializer
 org.quartz.SchedulerException: UserTransactionHelper could not lookup/create UserTransaction. [See nested exception: javax.naming.NameNotFoundException: UserTransaction n
 ot bound]
         at org.quartz.ee.jta.UserTransactionHelper$UserTransactionWithContext.<init>(UserTransactionHelper.java:153)
         at org.quartz.ee.jta.UserTransactionHelper.lookupUserTransaction(UserTransactionHelper.java:113)
         at org.quartz.plugins.SchedulerPluginWithUserTransactionSupport.startUserTransaction(SchedulerPluginWithUserTransactionSupport.java:175)
         at org.quartz.plugins.SchedulerPluginWithUserTransactionSupport.start(SchedulerPluginWithUserTransactionSupport.java:142)
         at org.quartz.core.QuartzScheduler.startPlugins(QuartzScheduler.java:2168)
         at org.quartz.core.QuartzScheduler.start(QuartzScheduler.java:456)
         at org.quartz.impl.StdScheduler.start(StdScheduler.java:146)
         at org.jboss.resource.adapter.quartz.inflow.QuartzResourceAdapter.start(QuartzResourceAdapter.java:58)
         at org.jboss.resource.deployment.RARDeployment.startService(RARDeployment.java:109)
         at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
         at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
         at org.jboss.system.ServiceDynamicMBeanSupport.invoke(ServiceDynamicMBeanSupport.java:124)
         at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
         at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
         at $Proxy0.start(Unknown Source)
         at org.jboss.system.ServiceController.start(ServiceController.java:417)
         at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
         at $Proxy48.start(Unknown Source)
         at org.jboss.deployment.SimpleSubDeployerSupport.startService(SimpleSubDeployerSupport.java:356)
         at org.jboss.deployment.SimpleSubDeployerSupport.start(SimpleSubDeployerSupport.java:127)
         at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
         at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
         at sun.reflect.GeneratedMethodAccessor27.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
         at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
         at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
         at $Proxy10.deploy(Unknown Source)
         at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
         at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
         at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:266)
         at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:344)
         at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
         at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
         at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
         at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
         at $Proxy0.start(Unknown Source)
         at org.jboss.system.ServiceController.start(ServiceController.java:417)
         at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
         at $Proxy4.start(Unknown Source)
         at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
         at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
         at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
         at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
         at $Proxy5.deploy(Unknown Source)
         at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
         at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
         at org.jboss.Main.boot(Main.java:200)
         at org.jboss.Main$1.run(Main.java:518)
         at java.lang.Thread.run(Thread.java:662)
 Caused by: javax.naming.NameNotFoundException: UserTransaction not bound
         at org.jnp.server.NamingServer.getBinding(NamingServer.java:581)
         at org.jnp.server.NamingServer.getBinding(NamingServer.java:589)
         at org.jnp.server.NamingServer.getObject(NamingServer.java:595)
         at org.jnp.server.NamingServer.lookup(NamingServer.java:342)
         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:694)
         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:801)
         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:654)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)
         at org.quartz.ee.jta.UserTransactionHelper$UserTransactionWithContext.<init>(UserTransactionHelper.java:150)
         ... 96 more
 11:21:34,478 INFO  [JobStoreCMT] note: volatile jobs are effectively non-volatile in a clustered environment.
 11:21:34,489 INFO  [JobStoreCMT] note: volatile triggers are effectively non-volatile in a clustered environment.
 


And jobs and triggers are still not persisted in database.

Thanks for your help

Steve
stevehel

journeyman

Joined: 01/09/2012 16:05:17
Messages: 12
Offline

I've found the solution for my previous post, using this thread : http://forums.terracotta.org/forums/posts/list/2804.page

Adding property
org.quartz.scheduler.userTransactionURL = UserTransaction
and no more exception.

And my triggers and jobs are now persisted !

But unfortunately I have still a problem.

When I have only one JBoss node started, everything is perfect, quartz is running well.
When I start the second node of my JBoss cluster, quartz seems frozen, triggers are not fired, everything seems blocked.

If i look in database, one trigger stays in ACQUIRED status always.

I have also an error log at quartz's JBoss node 2 startup :

Code:
 11:53:03,095 INFO  [QuartzScheduler] Quartz Scheduler v.1.6.6 created.
 11:53:03,098 INFO  [ShutdownHookPlugin] Registering Quartz shutdown hook.
 11:53:03,099 INFO  [JobInitializationPlugin] Registering Quartz Job Initialization Plug-in.
 11:53:03,102 INFO  [JobStoreCMT] Using db table-based data access locking (synchronization).
 11:53:03,106 INFO  [JobStoreCMT] JobStoreCMT initialized.
 11:53:03,107 INFO  [StdSchedulerFactory] Quartz scheduler 'X2010Scheduler' initialized from default resource file in Quartz package: 'quartz.properties'
 11:53:03,108 INFO  [StdSchedulerFactory] Quartz scheduler version: 1.6.6
 11:54:03,311 ERROR [JobInitializationPlugin] Error starting background-task for watching jobs file.
 org.quartz.impl.jdbcjobstore.LockException: Failure obtaining db row lock: ORA-02049: temporisation : la transaction distribuÚe attend un verrou
  [See nested exception: java.sql.SQLException: ORA-02049: temporisation : la transaction distribuÚe attend un verrou
 ]
         at org.quartz.impl.jdbcjobstore.StdRowLockSemaphore.executeSQL(StdRowLockSemaphore.java:112)
         at org.quartz.impl.jdbcjobstore.DBSemaphore.obtainLock(DBSemaphore.java:112)
         at org.quartz.impl.jdbcjobstore.JobStoreCMT.executeInLock(JobStoreCMT.java:237)
         at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInLock(JobStoreSupport.java:3671)
         at org.quartz.impl.jdbcjobstore.JobStoreSupport.storeJobAndTrigger(JobStoreSupport.java:1035)
         at org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:732)
         at org.quartz.impl.StdScheduler.scheduleJob(StdScheduler.java:265)
         at org.quartz.plugins.xml.JobInitializationPlugin.start(JobInitializationPlugin.java:307)
         at org.quartz.plugins.SchedulerPluginWithUserTransactionSupport.start(SchedulerPluginWithUserTransactionSupport.java:144)
         at org.quartz.core.QuartzScheduler.startPlugins(QuartzScheduler.java:2168)
         at org.quartz.core.QuartzScheduler.start(QuartzScheduler.java:456)
         at org.quartz.impl.StdScheduler.start(StdScheduler.java:146)
         at org.jboss.resource.adapter.quartz.inflow.QuartzResourceAdapter.start(QuartzResourceAdapter.java:58)
         at org.jboss.resource.deployment.RARDeployment.startService(RARDeployment.java:109)
         at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
         at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
         at org.jboss.system.ServiceDynamicMBeanSupport.invoke(ServiceDynamicMBeanSupport.java:124)
         at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
         at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
         at $Proxy0.start(Unknown Source)
         at org.jboss.system.ServiceController.start(ServiceController.java:417)
         at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
         at $Proxy49.start(Unknown Source)
         at org.jboss.deployment.SimpleSubDeployerSupport.startService(SimpleSubDeployerSupport.java:356)
         at org.jboss.deployment.SimpleSubDeployerSupport.start(SimpleSubDeployerSupport.java:127)
         at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
         at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
         at sun.reflect.GeneratedMethodAccessor27.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
         at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
         at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
         at $Proxy10.deploy(Unknown Source)
         at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
         at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
         at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:266)
         at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:344)
         at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
         at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
         at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
         at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
         at $Proxy0.start(Unknown Source)
         at org.jboss.system.ServiceController.start(ServiceController.java:417)
         at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
         at $Proxy4.start(Unknown Source)
         at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
         at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
         at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
         at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
         at $Proxy5.deploy(Unknown Source)
         at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
         at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
         at org.jboss.Main.boot(Main.java:200)
         at org.jboss.Main$1.run(Main.java:518)
         at java.lang.Thread.run(Thread.java:662)
 Caused by: java.sql.SQLException: ORA-02049: temporisation : la transaction distribuÚe attend un verrou
 
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:219)
         at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:813)
         at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1049)
         at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:854)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1154)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3370)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3415)
         at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:255)
         at org.quartz.impl.jdbcjobstore.StdRowLockSemaphore.executeSQL(StdRowLockSemaphore.java:92)
         ... 101 more
 11:54:03,358 INFO  [QuartzScheduler] Scheduler X2010Scheduler_$_PT31401326365583065 started.
 11:54:03,424 INFO  [Http11Protocol] D?marrage de Coyote HTTP/1.1 sur http-0.0.0.0-8280
 11:54:03,441 INFO  [AjpProtocol] Starting Coyote AJP/1.3 on ajp-0.0.0.0-8209
 


Any idea of what can happen ?

Steve
jhouse

seraphim
[Avatar]
Joined: 11/06/2009 15:29:56
Messages: 1703
Offline


Do you have both nodes configured to read the xml file and insert the defined jobs/triggers?
stevehel

journeyman

Joined: 01/09/2012 16:05:17
Messages: 12
Offline

quartz.properties file is the same on each node, and xml file is duplicated on each node, so answer to your question is yes.
stevehel

journeyman

Joined: 01/09/2012 16:05:17
Messages: 12
Offline

some news for my problem...

I have tried added these 2 properties in my quartz.properties, and it seems now to work correctly when in cluster mode :

org.quartz.scheduler.wrapJobExecutionInUserTransaction = true
org.quartz.jobStore.dontSetAutoCommitFalse=true


Now still one other problem when in cluster : quartz detects again and again changes made on my xml file where my jobs are defined, whereas this file has not been changed. It occurs on both nodes.
I have a log like this :

Code:
 18:29:29,339 INFO  [FileScanJob] File 'x2010ScheduleJobs.xml' updated, notifying listener.
 18:33:32,942 INFO  [JobSchedulingDataProcessor] Scheduling 13 parsed jobs.
 18:33:32,945 INFO  [JobSchedulingDataProcessor] Replacing job: PURGE.FMK PURGE USER WCS
 ...
 


And quartz replace all my jobs and triggers again and again...

Any idea ?
stevehel

journeyman

Joined: 01/09/2012 16:05:17
Messages: 12
Offline

Resolved it : the two xml files (which contains jobs definitions) were not at the same date...

Thanks a lot jhouse for your help !
jhouse

seraphim
[Avatar]
Joined: 11/06/2009 15:29:56
Messages: 1703
Offline


Np. glad you got it working.
 
Forum Index -> Quartz
Go to:   
Powered by JForum 2.1.7 © JForum Team