Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

Quartz 2.2.2 : org.quartz.impl.jdbcjobstore.LockException: Failure obtaining db row lock: ORA-00942: table or view does not exist

Ask Question

I'm using Quartz Scheduler 2.2.2.

I have created a schema called 'SCHEDULER_DEV' in Oracle Database.

CREATE USER SCHEDULER_DEV IDENTIFIED BY SCHEDULER_DEV DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP QUOTA UNLIMITED ON USERS

I have provided below grants for this schema - create/alter session, create table, view, sequence, synonym, type and procedure.

In the qrtz_locks table, I have added 2 entries:

INSERT INTO QRTZ_LOCKS(SCHED_NAME,LOCK_NAME) VALUES('QuartzScheduler', 'STATE_ACCESS');

INSERT INTO QRTZ_LOCKS(SCHED_NAME,LOCK_NAME) VALUES('QuartzScheduler', 'TRIGGER_ACCESS');

I configured my web.xml like below:

    <listener-class>org.quartz.ee.servlet.QuartzInitializerListener</listener-class>
</listener>
<context-param>
    <param-name>config-file</param-name>
    <param-value>quartz.properties</param-value>
</context-param>
<context-param>
    <param-name>shutdown-on-unload</param-name>
    <param-value>true</param-value>
</context-param>
<context-param>
    <param-name>wait-on-shutdown</param-name>
    <param-value>true</param-value>
</context-param>
<context-param>
    <param-name>start-on-load</param-name>
    <param-value>true</param-value>
</context-param>
<context-param>
    <param-name>start-delay-seconds</param-name>
    <param-value>10</param-value>
</context-param>*

My quartz.properties file include as below along with other key-value pairs:

org.quartz.scheduler.instanceName=QuartzScheduler org.quartz.jobStore.dataSource=SchedulerDS org.quartz.jobStore.tablePrefix=SCHEDULER_DEV.QRTZ_ org.quartz.dataSource.SchedulerDS.jndiURL=jdbc/schedulerds org.quartz.dataSource.SchedulerDS.java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory

When I run my page I get the following error:

org.quartz.impl.jdbcjobstore.LockException: Failure obtaining db row lock: ORA-00942: table or view does not exist [See nested exception: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist ] at org.quartz.impl.jdbcjobstore.StdRowLockSemaphore.executeSQL(StdRowLockSemaphore.java:157) org.quartz.impl.jdbcjobstore.DBSemaphore.obtainLock(DBSemaphore.java:113) org.quartz.impl.jdbcjobstore.JobStoreSupport.doCheckin(JobStoreSupport.java:3270) org.quartz.impl.jdbcjobstore.JobStoreSupport$ClusterManager.manage(JobStoreSupport.java:3870) org.quartz.impl.jdbcjobstore.JobStoreSupport$ClusterManager.run(JobStoreSupport.java:3907)

org.quartz.jobStore.tablePrefix=SCHEDULER_DEV.QRTZ_

Try to change to: org.quartz.jobStore.tablePrefix=QRTZ_ and show me if it work.

P/s: If you using another Oracle schema, check if you have grant permission (select, update, insert, delete) to SCHEDULER_DEV on quartz tables.

I got into this issue as well and I can point you to the class and put a debugger in class StdRowLockSemaphore and

     ps = conn.prepareStatement(expandedSQL);
     ps.setString(1, lockName);

I think if you inspect the lock name and the SQL you will be able to find out which table it is accessing, in my case, I had these properties (org.quartz.jobStore.tablePrefix=QRTZ2_) which was not taking effect because we wanted to identify them with the version that it is 2+

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.