本文介绍了PostgreSQL-Quartz JDBC-JobStoreTX-getTriggersForJob-ArrayIndexOutOfBoundsException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

数据库:PostgreSQL 9.2

DB: PostgreSQL 9.2

托管:Openshift

Hosting: 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

Stacktrace:

Stacktrace:

由以下原因引起:java.lang.ArrayIndexOutOfBoundsException:2 at org.postgresql.util.PGbytea.toBytes(PGbytea.java:76)在 org.postgresql.jdbc2.AbstractJdbc2ResultSet.getBytes(AbstractJdbc2ResultSet.java:2271) 在 org.postgresql.jdbc2.AbstractJdbc2ResultSet.getBytes(AbstractJdbc2ResultSet.java:2451) 在 com.mchange.v2.c3p0.impl.NewProxyResultSet.getBytes(NewProxyResultSet.java:2781)

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一起使用

PS: Works with postgres 9.4

推荐答案

此JIRA https://issues.liferay.com/browse/LPS-15133 具有相同的堆栈跟踪,并且发声这是一个过时的驱动程序.

This JIRA https://issues.liferay.com/browse/LPS-15133 has the same stack trace and it tels it is a matter of an out dated driver.

如果您尝试使用最新版本的PostgreSQL jdbc驱动程序,则可能包括了org.postgresql groupId的依赖项,而logback依赖于以postgres作为groupId的驱动程序的旧版本,因此您将这两个依赖项都包括在您的应用.

If you have tried with last version of PostgreSQL jdbc driver, maybe you include a dependency from org.postgresql groupId, and logback depends on old version of driver with postgres as groupId, thus you are including both dependencies in your app.

请,尝试通过这种方式排除旧的jdbc版本:

Please, try to exclude the old jdbc version this way:

<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>

并告诉我们这种刺激是否会使您的应用正常工作.

And tell us if this exlcusion makes your app to work.

希望有帮助!

这篇关于PostgreSQL-Quartz JDBC-JobStoreTX-getTriggersForJob-ArrayIndexOutOfBoundsException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 09:21