`
deyum
  • 浏览: 35893 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

解决:Connections could not be acquired from the underlying database!

 
阅读更多

 

本文转载自http://jyao.iteye.com/blog/1915561

og4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
org.quartz.SchedulerConfigException: Failure occured during job recovery. [See nested exception: org.quartz.JobPersistenceException: Failed to obtain DB connection from data source 'myDS': java.sql.SQLException: Connections could not be acquired from the underlying database! [See nested exception: java.sql.SQLException: Connections could not be acquired from the underlying database!]]
 at org.quartz.impl.jdbcjobstore.JobStoreSupport.schedulerStarted(JobStoreSupport.java:693)
 at org.quartz.core.QuartzScheduler.start(QuartzScheduler.java:580)
 at org.quartz.impl.StdScheduler.start(StdScheduler.java:142)
 at org.quartz.ee.servlet.QuartzInitializerListener.contextInitialized(QuartzInitializerListener.java:198)
 at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3830)
 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4337)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
 at org.apache.catalina.core.StandardService.start(StandardService.java:516)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.quartz.JobPersistenceException: Failed to obtain DB connection from data source 'myDS': java.sql.SQLException: Connections could not be acquired from the underlying database! [See nested exception: java.sql.SQLException: Connections could not be acquired from the underlying database!]
 at org.quartz.impl.jdbcjobstore.JobStoreSupport.getConnection(JobStoreSupport.java:777)
 at org.quartz.impl.jdbcjobstore.JobStoreTX.getNonManagedTXConnection(JobStoreTX.java:71)
 at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3774)
 at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3739)
 at org.quartz.impl.jdbcjobstore.JobStoreSupport.recoverJobs(JobStoreSupport.java:833)
 at org.quartz.impl.jdbcjobstore.JobStoreSupport.schedulerStarted(JobStoreSupport.java:691)
 ... 18 more
Caused by: java.sql.SQLException: Connections could not be acquired from the underlying database!
 at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
 at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:529)
 at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)
 at org.quartz.utils.PoolingConnectionProvider.getConnection(PoolingConnectionProvider.java:247)
 at org.quartz.utils.DBConnectionManager.getConnection(DBConnectionManager.java:108)
 at org.quartz.impl.jdbcjobstore.JobStoreSupport.getConnection(JobStoreSupport.java:774)
 ... 23 more
Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
 at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1319)
 at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557)
 at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477)
 at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525)
 ... 27 more

 

 

 

 

 

以上问题可能有一下原因造成:

 

1,驱动配置有误:driver=com.mysql.jdbc.Driver
2,数据库连接地址有误:url=jdbc:mysql://localhost:3306/test?3useUnicode=true&characterEncoding=utf8
3,密码或帐号有误:username=root
      password=root

 

4,数据库未启动或无权访问

 

5,项目未引入对应的驱动jar包mysql-connector-java-5.1.6-bin.jar

=====================================================================

我也遇到了这样的异常,因为我的DataSource是从网络上拷贝下来的,有驱动和数据库连接地址有些空格没有删除掉,所以才会出现这样的异常!把空格删掉就连上数据库了!

 

分享到:
评论

相关推荐

    有关数据库连接的问题

    databaseName=TestJavaOdbc"; Connection conn = DriverManager.getConnection(url); ``` #### 使用ODBC连接 除了直接使用JDBC驱动外,还可以通过ODBC桥接的方式连接SQL Server: 1. **加载ODBC驱动**: ```...

    mysql密码过期导致连接不上mysql

    初始为500,结果还是错误, 在修改为36000,并且加大了c3p0连接数cpool.maxPoolSize=100 这个时候出现下面错误现象2 Connections could not be acquired from the underlying database! 一直没有定位出来,靠,

    dbconfig.properties

    Connections could not be acquired from the underlying database,在正确导入所需jar包和安装合适版本的tomcat后,出现该问题,大多数是数据库连接部署,要仔细审查一下数据库配置

    mysql安装失败

    win7 系统 the security settings could not be applied to the database 在安装mysql的时候,就会遇到以下错误。遇到错误不可怕,怕的就是被错误所击倒! The security settings could not be applied to the ...

    boostdesc_bgm.i,vgg_generated_48.i等.zip

    Couldn't connect to server from the Internet. Perhaps direct connections are not allowed in the current network. To use proxy please check/specify these environment variables: - ...

    mingyang66#spring-parent#RabbitMQ学习笔记:Connections、Channels、Queue

    RabbitMQ学习笔记:Connections、Channels、Queues之state状态连接、信道、队列状态如下:GitHub地址:https://gi

    MyEclipse报错说明

    10. **Connections could not be acquired from the underlying database** 无法从底层数据库获取连接,这可能是由于数据库URL配置错误、网络问题或数据库服务未启动等原因造成的。检查数据库连接参数和数据库...

    Dimeric.Virtual.Database.

    VDB provides abstraction for the underlying database SQL dialect. VDB provides an escape syntax so that you can write the same SQL regardless of the database you are connecting to. This escape syntax...

    计算机网络第六版答案

    but the time when loss first occurs will be different from one experiment to the next due to the randomness in the emission process. 22. Five generic tasks are error control, flow control, ...

    微软内部资料-SQL性能优化3

    To make use of either more or less strict isolation levels in applications, locking can be customized for an entire session by setting the isolation level of the session with the SET TRANSACTION ...

    解决mysql 1040错误Too many connections的方法

    mysql官方告诉我们需要修改max_connections的值,那么我们怎么去修改呢?有两种方法 1、修改配置文件文件 修改/etc/my.cnf这个文件,在[mysqld]中新增max_connections=N,如果你没有这个文件请从编译源码中的support...

    KafkaOffsetMonitor监控工具2017年1月发布的版本

    Graphs could sometimes be difficult to read because you would see non-whole numbers on the y-axis legend, when facts being drawn are always whole numbers. Set y-axis to draw only whole numbers in the ...

    AWS certified solutions architect associate exam sample

    - **Database Visible Metrics**: Metrics such as the number of connections are not part of the basic monitoring package. #### 6. Operational Process Performed by AWS for Data Security - **Operational...

    Absolute Database for D7

    no DLLs No special installation or configuration required Database engine compiles right into EXE Single-file database format Database file could be merged with the application EXE file High Speed ...

    Java邮件开发Fundamentals of the JavaMail API

    be protocol agnostic, you can't overcome the limitations of the underlying protocols. If a capability isn't supported by a chosen protocol, the JavaMail API doesn't magically add the capability on ...

    sqlmap (懂的入)

    * SQL injection testing and detection does not depend upon the web application database management system back-end. SQL injection exploiting and query syntax obviously depend upon the web ...

    端口查看工具

    port is filtered by the other CurrPorts options and it's not displayed in the main window, it won't be displayed in the tray balloon.) * Version 1.87: o Improved the 'User Name' column. If you ...

    Oracle sqldeveloper without jdk (win+linux)

    - Bug 4924484: Values to which NCHAR, NVARCHAR2, or NCLOB columns are modified may be unnecessarily converted to the database character set before being converted to the national character set and ...

    weblogic 8.X 无限制

    The Server is not licensed for this operation.Connection rejected, the server license allows connections from only 5 unique IP addresses. 没有授权 提示5个IP访问的限制 解决办法: 从licensecodes.oracle...

Global site tag (gtag.js) - Google Analytics