org.quartz.JobPersistenceException: Couldn't acquire next trigger: Column 'SCHED_TIME' cannot accept a NULL value. [See nested exception: java.sql.SQLIntegrityConstraintViolationException: Column 'SCHED_TIME' cannot accept a NULL value.]

  1. 0

    Attached is the code you could use to reproduce this issue. Make sure that you run the derby script to create quartz tables. The possible solutions to my knowledge are: 1. Updating the constant INSERT_FIRED_TRIGGER in StdJDBCConstants.java to include the column "sched_time" and updating the method "insertFiredTrigger" in StdJDBCDelegate.java accordingly 2. Dropping the null constraint on the column "sched_time" in table "qrtz_fired_triggers" Below is the stack trace for more information: ============================================== 53656 [MyScheduler_QuartzSchedulerThread] ERROR org.quartz.core.ErrorLogger - An error occurred while scanning for the next triggers to fire. org.quartz.JobPersistenceException: Couldn't acquire next trigger: Column 'SCHED_TIME' cannot accept a NULL value. [See nested exception: java.sql.SQLIntegrityConstraintViolationException: Column 'SCHED_TIME' cannot accept a NULL value.] at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTrigger(JobStoreSupport.java:2827) at org.quartz.impl.jdbcjobstore.JobStoreSupport$41.execute(JobStoreSupport.java:2755) at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3798) at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTriggers(JobStoreSupport.java:2751) at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:264) Caused by: java.sql.SQLIntegrityConstraintViolationException: Column 'SCHED_TIME' cannot accept a NULL value. at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source) at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source) at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source) at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeLargeUpdate(Unknown Source) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source) at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105) at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.insertFiredTrigger(StdJDBCDelegate.java:2624) at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTrigger(JobStoreSupport.java:2811) ... 4 more Caused by: java.sql.SQLException: Column 'SCHED_TIME' cannot accept a NULL value. at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source) ... 17 more Caused by: ERROR 23502: Column 'SCHED_TIME' cannot accept a NULL value. at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) at org.apache.derby.impl.sql.execute.NormalizeResultSet.normalizeColumn(Unknown Source) at org.apache.derby.impl.sql.execute.NormalizeResultSet.normalizeRow(Unknown Source) at org.apache.derby.impl.sql.execute.NormalizeResultSet.getNextRowCore(Unknown Source) at org.apache.derby.impl.sql.execute.DMLWriteResultSet.getNextRowCore(Unknown Source) at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown Source) at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source) at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source) ... 11 more

    Terracotta Project Issue Tracker | 3 years ago | S K
    org.quartz.JobPersistenceException: Couldn't acquire next trigger: Column 'SCHED_TIME' cannot accept a NULL value. [See nested exception: java.sql.SQLIntegrityConstraintViolationException: Column 'SCHED_TIME' cannot accept a NULL value.]
  2. 0

    Attached is the code you could use to reproduce this issue. Make sure that you run the derby script to create quartz tables. The possible solutions to my knowledge are: 1. Updating the constant INSERT_FIRED_TRIGGER in StdJDBCConstants.java to include the column "sched_time" and updating the method "insertFiredTrigger" in StdJDBCDelegate.java accordingly 2. Dropping the null constraint on the column "sched_time" in table "qrtz_fired_triggers" Below is the stack trace for more information: ============================================== 53656 [MyScheduler_QuartzSchedulerThread] ERROR org.quartz.core.ErrorLogger - An error occurred while scanning for the next triggers to fire. org.quartz.JobPersistenceException: Couldn't acquire next trigger: Column 'SCHED_TIME' cannot accept a NULL value. [See nested exception: java.sql.SQLIntegrityConstraintViolationException: Column 'SCHED_TIME' cannot accept a NULL value.] at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTrigger(JobStoreSupport.java:2827) at org.quartz.impl.jdbcjobstore.JobStoreSupport$41.execute(JobStoreSupport.java:2755) at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3798) at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTriggers(JobStoreSupport.java:2751) at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:264) Caused by: java.sql.SQLIntegrityConstraintViolationException: Column 'SCHED_TIME' cannot accept a NULL value. at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source) at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source) at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source) at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeLargeUpdate(Unknown Source) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source) at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105) at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.insertFiredTrigger(StdJDBCDelegate.java:2624) at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTrigger(JobStoreSupport.java:2811) ... 4 more Caused by: java.sql.SQLException: Column 'SCHED_TIME' cannot accept a NULL value. at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source) ... 17 more Caused by: ERROR 23502: Column 'SCHED_TIME' cannot accept a NULL value. at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) at org.apache.derby.impl.sql.execute.NormalizeResultSet.normalizeColumn(Unknown Source) at org.apache.derby.impl.sql.execute.NormalizeResultSet.normalizeRow(Unknown Source) at org.apache.derby.impl.sql.execute.NormalizeResultSet.getNextRowCore(Unknown Source) at org.apache.derby.impl.sql.execute.DMLWriteResultSet.getNextRowCore(Unknown Source) at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown Source) at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source) at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source) ... 11 more

    Terracotta Project Issue Tracker | 3 years ago | S K
    org.quartz.JobPersistenceException: Couldn't acquire next trigger: Column 'SCHED_TIME' cannot accept a NULL value. [See nested exception: java.sql.SQLIntegrityConstraintViolationException: Column 'SCHED_TIME' cannot accept a NULL value.]
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Here's my setup: As my destination, I set up HL7 Inspector to listen on port 6660. In Mirth Connect, create a channel with a Channel Reader as the source, TCP Sender (MLLP transmission mode) sending to 6660 as the destination. For Queue Settings, set to Attempt First. Leave everything else as defaults. With HL7 Inspector listening, send a message to the channel. Sends through fine. Now, stop HL7 Inspector. Send another message to the channel. Since HL7 Inspector is no longer listening, the message is queued. Everything good so far. Now go into the message view for the channel and delete the message. The message data is gone. Start the HL7 Inspector listening again. Even though the message has been deleted, on each retry interval, you get the following exception in the server log: 2013-08-24 09:52:16,708] ERROR (com.mirth.connect.connectors.tcp.TcpDispatcher:498): Error processing queued message 2-1 (SENT) for channel 13e934ea-410b-44d7-acc4-a800cc83cf22 (Destination 1). This error is expected if the message was manually removed from the queue. com.mirth.connect.donkey.server.data.DonkeyDaoException: java.sql.SQLIntegrityConstraintViolationException: INSERT on table 'D_MC2' caused a violation of foreign key constraint 'MC2_FKEY' for key (2,1). The statement has been rolled back. at com.mirth.connect.donkey.server.data.jdbc.JdbcDao.storeContent(JdbcDao.java:289) at com.mirth.connect.donkey.server.data.jdbc.JdbcDao.storeMessageContent(JdbcDao.java:222) at com.mirth.connect.donkey.server.data.buffered.BufferedDao.executeTasks(BufferedDao.java:103) at com.mirth.connect.donkey.server.data.buffered.BufferedDao.commit(BufferedDao.java:74) at com.mirth.connect.donkey.server.data.buffered.BufferedDao.commit(BufferedDao.java:61) at com.mirth.connect.donkey.server.channel.DestinationConnector.run(DestinationConnector.java:486) at java.lang.Thread.run(Thread.java:680)Caused by: java.sql.SQLIntegrityConstraintViolationException: INSERT on table 'D_MC2' caused a violation of foreign key constraint 'MC2_FKEY' for key (2,1). The statement has been rolled back. at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source) at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source) at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source) at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeLargeUpdate(Unknown Source) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source) at com.mirth.connect.donkey.server.data.jdbc.JdbcDao.storeContent(JdbcDao.java:285) ... 6 moreCaused by: java.sql.SQLException: INSERT on table 'D_MC2' caused a violation of foreign key constraint 'MC2_FKEY' for key (2,1). The statement has been rolled back. at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source) ... 17 moreCaused by: ERROR 23503: INSERT on table 'D_MC2' caused a violation of foreign key constraint 'MC2_FKEY' for key (2,1). The statement has been rolled back. at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) at org.apache.derby.impl.sql.execute.ForeignKeyRIChecker.doCheck(Unknown Source) at org.apache.derby.impl.sql.execute.GenericRIChecker.doCheck(Unknown Source) at org.apache.derby.impl.sql.execute.RISetChecker.doFKCheck(Unknown Source) at org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(Unknown Source) at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown Source) at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source) at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source) ... 11 more Additionally, HL7 Inspector will now receive the message over and over again (whatever the retry interval is). And since the message data is deleted, the only recourse is to stop/undeploy the channel.

    Mirth Project | 3 years ago | Eric Butterfield
    com.mirth.connect.donkey.server.data.DonkeyDaoException: java.sql.SQLIntegrityConstraintViolationException: INSERT on table 'D_MC2' caused a violation of foreign key constraint 'MC2_FKEY' for key (2,1). The statement has been rolled back.
  5. 0

    SQLIntegrityConstraintViolationException when indexing Bazaar history (Bugzilla #19116)

    GitHub | 4 years ago | vladak
    org.opensolaris.opengrok.history.HistoryException: java.sql.SQLIntegrityConstraintViolationException: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'CHANGESETS_REPO_REV_UNIQUE' defined on 'CHANGESETS'.

  1. davidvanlaatum 20 times, last 5 days ago
1 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.sql.SQLException

    Column 'SCHED_TIME' cannot accept a NULL value.

    at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException()
  2. Derby
    EmbedPreparedStatement.executeUpdate
    1. org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
    2. org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
    3. org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
    4. org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
    5. org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
    6. org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
    7. org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
    8. org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
    9. org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
    10. org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
    11. org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeLargeUpdate(Unknown Source)
    12. org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source)
    12 frames
  3. c3p0:JDBC DataSources/Resource Pools
    NewProxyPreparedStatement.executeUpdate
    1. com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)
    1 frame
  4. quartz
    QuartzSchedulerThread.run
    1. org.quartz.impl.jdbcjobstore.StdJDBCDelegate.insertFiredTrigger(StdJDBCDelegate.java:2624)
    2. org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTrigger(JobStoreSupport.java:2811)
    3. org.quartz.impl.jdbcjobstore.JobStoreSupport$41.execute(JobStoreSupport.java:2755)
    4. org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3798)
    5. org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTriggers(JobStoreSupport.java:2751)
    6. org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:264)
    6 frames