gpt4 book ai didi

java - PostgreSQL - quartz JDBC-JobStoreTX - getTriggersForJob - ArrayIndexOutOfBoundsException

转载 作者:行者123 更新时间:2023-11-29 13:00:04 27 4
gpt4 key购买 nike

数据库:PostgreSQL 9.2

托管:Openshift

配置:

org.quartz.scheduler.instanceName = OneTimeJob
org.quartz.threadPool.threadCount = 3
org.quartz.jobStore.useProperties = true

org.quartz.threadPool.class: org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread: true

org.quartz.jobStore.misfireThreshold: 60000

org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX

org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
org.quartz.jobStore.dataSource = Name

org.quartz.dataSource.Name.connectionProvider.class = com.name.scheduler.DBConnectionProvider

堆栈跟踪:

An SQLException was provoked by the following failure: java.lang.ArrayIndexOutOfBoundsException at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106) at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:65) at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:62) at com.mchange.v2.c3p0.impl.NewPooledConnection.handleThrowable(NewPooledConnection.java:369) at com.mchange.v2.c3p0.impl.NewProxyResultSet.getBytes(NewProxyResultSet.java:2795) at org.quartz.impl.jdbcjobstore.PostgreSQLDelegate.getJobDataFromBlob(PostgreSQLDelegate.java:88) at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.getMapFromProperties(StdJDBCDelegate.java:881) at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.selectTrigger(StdJDBCDelegate.java:1778) at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.selectTriggersForJob(StdJDBCDelegate.java:1704) at org.quartz.impl.jdbcjobstore.JobStoreSupport.getTriggersForJob(JobStoreSupport.java:2141)

Caused by: java.lang.ArrayIndexOutOfBoundsException: 2 at org.postgresql.util.PGbytea.toBytes(PGbytea.java:76) at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getBytes(AbstractJdbc2ResultSet.java:2271) at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getBytes(AbstractJdbc2ResultSet.java:2451) at com.mchange.v2.c3p0.impl.NewProxyResultSet.getBytes(NewProxyResultSet.java:2781)

PS:适用于 postgres 9.4

最佳答案

这个 JIRA https://issues.liferay.com/browse/LPS-15133具有相同的堆栈跟踪,它表示这是一个过时的驱动程序的问题。

如果您尝试使用最新版本的 PostgreSQL jdbc 驱动程序,可能您包含了来自 org.postgresql groupId 的依赖项,并且 logback 依赖于旧版本的驱动程序 postgres 作为 groupId,因此您在应用中包含了这两个依赖项。

请尝试以这种方式排除旧的 jdbc 版本:

<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.3</version>
<exclusions>
<exclusion>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
</exclusion>
</exclusions>
</dependency>

并告诉我们这种排除是否使您的应用正常运行。

希望对您有所帮助!

关于java - PostgreSQL - quartz JDBC-JobStoreTX - getTriggersForJob - ArrayIndexOutOfBoundsException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32936429/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com