org.jooq.exception.DataAccessException: SQL [insert into "public"."message" ("metadata") values (cast(? as varchar))]; Batch entry 0 insert into "public"."message" ("metadata") values (cast(NULL as varchar)) was aborted: ERROR: column "metadata" is of type json but expression is of type character varying
Hint: You will need to rewrite or cast the expression.
Position: 258 Call getNextException to see the cause.

SQL [select `book_author`.`book_id`, `book_author`.`author_id` from `book_author` where (`book_author`.`book_id` = ? and `book_author`.`author_id` = ?) for update]; Can not issue executeUpdate() or executeLargeUpdate() for SELECTs

java.sql.BatchUpdateException: Batch entry 0 insert into "public"."message" ("campaign_id", "conversation_id", "start_state", "end_state", "link_followed", "kind", "sender", "recipient", "content", "metadata", "timestamp", "source") values (777, 15, '<<start>>', 'askEmail', 0, 'outbound_sms'::"public"."message_kind", '+61418974654', '+61434193516', 'Hi friend, what''s your email?', cast(NULL as varchar), 1474442678514002972, 0) was aborted: ERROR: column "metadata" is of type json but expression is of type character varying
Hint: You will need to rewrite or cast the expression.
Position: 258 Call getNextException to see the cause. at org.postgresql.jdbc.BatchResultHandler.handleError(BatchResultHandler.java:148) at org.postgresql.jdbc.PgStatement.executeBatch(PgStatement.java:780) at org.postgresql.jdbc.PgPreparedStatement.executeBatch(PgPreparedStatement.java:1662) at org.jooq.tools.jdbc.DefaultStatement.executeBatch(DefaultStatement.java:93) at org.jooq.impl.BatchSingle.executePrepared(BatchSingle.java:239) at org.jooq.impl.BatchSingle.execute(BatchSingle.java:182) at org.jooq.impl.BatchCRUD.executePrepared(BatchCRUD.java:159) at org.jooq.impl.BatchCRUD.execute(BatchCRUD.java:100) at rungopher.db_access.DbMessage.persist(DbMessage.java:46) at rungopher.StartCampaign.sendFirstMessages(StartCampaign.java:166) at rungopher.StartCampaign.start(StartCampaign.java:85) at rungopher.CampaignEventHandler.handleDelivery(CampaignEventHandler.java:46) at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:144) at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:99) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

Users with the same issue

You are the first who have seen this exception.

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.