石英错误:没有合适的驱动程序

时间:2014-03-24 13:57:05

标签: quartz-scheduler

我在我的网络应用程序中使用了Quartz作业。当我使用Quartz 1.6.5和Teradata数据库版本13.10时,一切都运行正常。

我在石英旧版本遇到了频繁的死锁问题。所以,我将我的版本升级到Quartz2.2.1。当我使用Quartz 2.2.1和Teradata数据库版本13.10时,一切都运行正常。

后来我们在Teradata 13.10中面临一个奇怪的字符集问题,所以我们升级到Teradata 14.0。

现在,当我们使用Quartz 2.2.1和Teradata数据库版本14.0时,我们遇到了一个奇怪的问题

我们得到以下例外,

INFO >2014-03-20 10:35:34,541 com.mchange.v2.log.MLog[main]: MLog clients using log4j logging.
INFO >2014-03-20 10:35:35,007 com.mchange.v2.c3p0.C3P0Registry[main]: Initializing c3p0-0.9.1 [built 16-January-2007 14:46:42; debug? true; trace: 10]
INFO >2014-03-20 10:35:35,504 com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource[main]: Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 30b5x8901q4ns4b1b241po|1b7bf86, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.objectriver.jdbc.driver.L2PDriver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 30b5x8901q4ns4b1b241po|1b7bf86, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:teradata://10.219.82.10/database=T01DGF0_Q,CHARSET=UTF8,TMODE=TERA, lastAcquisitionFailureDefaultUser -> null, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 10, maxStatements -> 0, maxStatementsPerConnection -> 120, minPoolSize -> 1, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]
WARN >2014-03-20 10:36:04,519 com.mchange.v2.resourcepool.BasicResourcePool[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0]: com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@18837f1 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception:
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getDriver(DriverManager.java:264)
at com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataSource.java:224)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:135)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
INFO >2014-03-20 10:36:05,903 com.ssc.faw.common.LogManager[GenCache]: GenCache.Worker(1) created
WARN >2014-03-20 10:36:06,657 com.mchange.v2.resourcepool.BasicResourcePool[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2]: com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@150b45a -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception:
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getDriver(DriverManager.java:264)
at com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataSource.java:224)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:135)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
WARN >2014-03-20 10:36:06,657 com.mchange.v2.resourcepool.BasicResourcePool[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1]: com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@170a650 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception:
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getDriver(DriverManager.java:264)
at com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataSource.java:224)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:135)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)

请找到以下石英属性和作业xml,

quartz.properties

#==============================================================
# Registry Scheduler Properties
#==============================================================
org.quartz.scheduler.instanceName=Service_Dgf_Quartz_Scheduler
org.quartz.scheduler.makeSchedulerThreadDaemon = true

#============================================================================
# Cluster Configuration
#============================================================================
org.quartz.jobStore.isClustered = true
org.quartz.jobStore.clusterCheckinInterval = 60000
org.quartz.jobStore.selectWithLockSQL=LOCKING ROW FOR WRITE SELECT * FROM {0}LOCKS WHERE LOCK_NAME = ?
org.quartz.scheduler.instanceId = AUTO

#==============================================================
# Configure ThreadPool
#==============================================================
org.quartz.threadPool.class=org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount=10
org.quartz.threadPool.threadPriority=5

#==============================================================
# Configure JobStore
#==============================================================
org.quartz.jobStore.misfireThreshold = 60000
org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass = com.ssc.mfw.server.quartz.TeradataDelegate

#========================================================================================
# Configure JobInitializer Plugin
#========================================================================================
org.quartz.plugin.jobInitializer.wrapInUserTransaction = false
org.quartz.plugin.jobInitializer.class = org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin
org.quartz.plugin.jobInitializer.scanInterval = 0
org.quartz.plugin.jobInitializer.fileNames=quartz/service_dgf_jobs.xml
org.quartz.plugin.jobInitializer.failOnFileNotFound = true

#============================================================================
# Configure Plugins
#============================================================================
org.quartz.plugin.triggHistory.class = org.quartz.plugins.history.LoggingJobHistoryPlugin

#============================================================================
# Configure JobStore Additional Code
#============================================================================
org.quartz.jobStore.useProperties = false
org.quartz.jobStore.dataSource = QuartzDS
org.quartz.jobStore.tablePrefix = QRTZ_

org.quartz.dataSource.QuartzDS.connectionProvider.class=com.ssc.mfw.server.util.TeradataConnectionProvider

quartz_jobs.xml

<?xml version="1.0" encoding="UTF-8"?>
<job-scheduling-data
xmlns="http://www.quartz-scheduler.org/xml/JobSchedulingData"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.quartz-scheduler.org/xml/JobSchedulingData http://www.quartz-scheduler.org/xml/job_scheduling_data_1_8.xsd"
version="1.8">

<schedule>
<job>
<name>simpleJob</name>
<group>SimpleGroup</group>
<description>Mart Creation Job</description>
<job-class>com.ssc.mfw.server.job.VirtualMartCreationJob</job-class>
</job>
<trigger>
<!-- ServiceNotification will be fired every 5 minutes -->
<cron>
<name>simpleJobTrigger</name>
<job-name>simpleJob</job-name>
<job-group>SimpleGroup</job-group>
<cron-expression>0 0/5 * * * ?</cron-expression>
</cron>
</trigger>
</schedule>

<schedule>
<job>
<name>dashboardJob</name>
<group>dashboardGroup</group>
<description>Dashboard Job</description>
<job-class>com.ssc.mfw.server.job.DashBoardJob</job-class>
</job>
<trigger>
<!-- ServiceNotification will be fired every 12 hours -->
<cron>
<name>dashboardJobTrigger</name>
<job-name>dashboardJob</job-name>
<job-group>dashboardGroup</job-group>
<cron-expression>0 0 0/12 * * ?</cron-expression>
</cron>
</trigger>
</schedule>

<schedule>
<job>
<name>updateAsAtTmsJob</name>
<group>updateAsAtTmsGroup</group>
<description>Update DB Key Job</description>
<job-class>com.ssc.mfw.server.job.UpdateAsAtTmsJob</job-class>
</job>
<trigger>
<!-- ServiceNotification will be fired every 4 hours -->
<cron>
<name>updateAsAtTmsJobTrigger</name>
<job-name>updateAsAtTmsJob</job-name>
<job-group>updateAsAtTmsGroup</job-group>
<cron-expression>0 0 0/4 * * ?</cron-expression>
</cron>
</trigger>
</schedule>
</job-scheduling-data>

只有当石英数据库表为空时,我们才面临上述说法。如果石英表包含作业详细信息,则作业运行正常。

任何人都可以提出导致问题的建议吗?我在这里做错了什么。

此致 苏雷什。

2 个答案:

答案 0 :(得分:0)

您的问题非常简单:JDBC无法将您提供的数据库的URL解析为适当的Driver类。您可以通过几种不同的方式轻松解决这个问题,但不幸的是,提供具体的建议很困难,因为所有的JDBC配置都隐藏在后面......

org.quartz.dataSource.QuartzDS.connectionProvider.class=com.ssc.mfw.server.util.TeradataConnectionProvider

很可能,该类覆盖org.quartz.utils.PoolingConnectionProvider,并且当它这样做时,它提供String dbDriver作为其超级构造函数的第一个参数。 (该字符串可能是硬编码的,或者以某种方式从外部配置。)您需要将该String更新为适合您的新版Teradata的JDBC驱动程序。您还需要确保您正在使用的JDBC URL(可能是TeradataConnectionProvider的超级构造函数的第二个参数)是新数据库的URL,该URL与您感到惊讶的dbDriver类一致。查看Teradata 14 JDBC文档文档,了解驱动程序名称和兼容的JDBC URL格式。

(如果您的TeradataConnectionProvider实现为其超级构造器提供了Properties对象,请确保键&#34;驱动程序&#34;绑定到JDBC驱动程序类名,并且String URL绑定到相应的JDBC URL。 )

(如果您需要更具体的帮助,请将源包含在TeradataConnectionProvider中。)

(或者更透明地,使用定义的here配置属性直接配置您的DataSource。)

答案 1 :(得分:0)

我们正在使用另一个第三方jar来创建连接。该第三方jar接受特定格式的URL。我们以错误的格式发送了URL。现在,我们已经修复了问题并使其正常运行。 @Steve:感谢您的时间和支持。