ERROR [main] JDBCExceptionReporter.logExceptions(234) | Cannot create PoolableConnectionFactory (Connection timed out: connect)
WARN [main] SettingsFactory.buildSettings(147) | Could not obtain connection to query metadata
org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Connection timed out: connect)
at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:114)
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2833)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2829)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:860)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:779)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:398)
at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:275)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.detectPersistenceExceptionTranslators(PersistenceExceptionTranslationInterceptor.java:139)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.<init>(PersistenceExceptionTranslationInterceptor.java:79)
at org.springframework.dao.annotation.PersistenceExceptionTranslationAdvisor.<init>(PersistenceExceptionTranslationAdvisor.java:70)
at org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor.setBeanFactory(PersistenceExceptionTranslationPostProcessor.java:99)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeAwareMethods(AbstractAutowireCapableBeanFactory.java:1439)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1408)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:710)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:410)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4336)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1015)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1015)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
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: java.sql.SQLException: Connection timed out: connect
at net.sourceforge.jtds.jdbc.TdsUtil.getSQLException(TdsUtil.java:181)
at net.sourceforge.jtds.jdbc.TdsUtil.getSQLException(TdsUtil.java:160)
at net.sourceforge.jtds.jdbc.TdsConnection.<init>(TdsConnection.java:182)
at net.sourceforge.jtds.jdbc.TdsConnectionJDBC3.<init>(TdsConnectionJDBC3.java:53)
at net.sourceforge.jtds.jdbc.Driver.getConnection(Driver.java:102)
at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:85)
at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
... 52 more
========================连接配置
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="net.sourceforge.jtds.jdbc.Driver"/>
<property name="url" value="jdbc:jtds:sqlserver://127.0.0.1:1433/testserver"/>
<property name="username" value="sa"/>
<property name="password" value="sasa"/>
<property name="maxActive" value="50"/>
<property name="maxWait" value="1000"/>
<property name="poolPreparedStatements" value="true"/>
<property name="defaultAutoCommit" value="true"/>
</bean>
====我只是好久没启动而已,这回启动就报这错了,
相关推荐
在SQL Server 2005中,"Cannot create PoolableConnectionFactory (用户 'sa' 登录失败。该用户与可信 SQL Server 连接无)" 错误通常表明在尝试使用SQL Server的身份验证方式登录时遇到了问题。这篇博客文章可能详细...
用户 'sa' 登录失败。该用户与可信 SQL Server 连接无关联
这通常意味着将数据库驱动的JAR文件(例如sqljdbc.jar)放入Tomcat的`common/lib`目录下,这样Tomcat在启动时就能加载该驱动。 接下来,我们来看如何在Java代码中使用JNDI查找并使用数据源。以下是一个简单的示例:...
kettle常见问题kettle常见问题kettle常见问题kettle常见问题kettle常见问题
确认SQL Server 2000可以远程连接,除了开放1433端口外,还要升级数据库到SP3或SP4,否则连接会发出SQLNestedException:Cannot create PoolableConnectionFactory ([Microsoft][SQLServer 2000 Driver for JDBC]...
在执行JDBC Request之后,我们可能会出现一个报错:java.sql.SQLException: Cannot create PoolableConnectionFactory (The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more...
该问题的错误信息为:Cannot create PoolableConnectionFactory (The server time zone value '???��������??��??' is unrecognized or represents more than one time zone. You must configure either ...
Apache 数据库连接池,通常指的是 Apache 的开源项目 Commons DBCP (Database Connection Pool) 或者是更现代的 Apache Tomcat JDBC 连接池 (Tomcat DataSource Executor,也称为 C3P0、DBCP2)。这些组件是为 Java ...
错误的配置可能导致`PoolableConnectionFactory`无法创建,从而抛出`SQLNestedException`。检查`server.xml`文件中的DataSource配置,确保用户名、密码、URL等参数正确无误。 5. **网络问题**:除了上述软件配置,...
1. **Apache DBCP**:Apache的DBCP(Database Connection Pool)是一个开源的JDBC连接池,它包含了BasicDataSource和PoolableConnectionFactory等核心组件,提供了一套完整的数据库连接池解决方案。 2. **C3P0**:...
然后,创建一个`PoolableConnectionFactory`,将`ConnectionFactory`包装起来。接着,通过`ObjectPoolBuilder`创建一个连接池实例,并将其绑定到`PooledConnectionFactory`。最后,我们可以从连接池中获取和归还连接...
数据库连接池(Database Connection Pool)是Java开发中用于管理数据库连接的一种技术,它在系统启动时预先创建并维护一定数量的数据库连接,当应用程序需要访问数据库时,不再直接创建新的数据库连接,而是从连接池...
Tomcat,一个广泛使用的Java应用服务器,就是利用DBCP作为其默认的数据源。 首先,让我们深入了解什么是对象池机制。对象池是一种设计模式,它的核心思想是预先创建并维护一组对象,供应用程序按需使用。当一个对象...
3. 初始化连接池:在应用启动时创建并初始化连接池。 4. 获取和释放连接:在需要操作数据库时,从连接池获取连接;操作完成后,及时归还连接。 5. 监控和调整:定期检查连接池的状态,根据系统负载动态调整连接池...
- 初始化:在应用启动时,`BasicDataSource`会根据配置信息初始化连接池。 - 获取连接:使用`DataSource.getConnection()`方法从池中获取连接。 - 归还连接:使用完连接后,调用`Connection.close()`方法,实际并...
2. `PoolableConnectionFactory`: 它是连接工厂,负责将普通的数据库连接转化为可池化的连接,使得这些连接可以放入 Commons Pool 中管理。 3. `AbandonedConfig` 和 `AbandonedTrace`: 这两个组件用于处理废弃的...
- **PoolableConnectionFactory**: 负责创建可池化的数据库连接,并配置连接池的属性,如最大连接数、最小空闲连接数等。 **3. DBCP 1.2.2的配置** 在使用DBCP时,通常需要配置`BasicDataSource`的属性,如URL、...
DBCP虽然历史悠久,但在性能和稳定性上可能不如其他现代连接池,如HikariCP、C3P0或Tomcat JDBC Connection Pool。这些连接池提供了更好的性能优化和错误处理机制。 总结,DBCP作为一款经典的数据库连接池,虽然在...
- **创建PoolableConnectionFactory**:这是DBCP的核心,它将普通数据库连接转换为池化的连接,可以被对象池管理和回收。 - **注册PoolingDriver**:`PoolingDriver`是DBCP提供的JDBC驱动,它允许通过特定的URL...
PoolableConnectionFactory 将普通的JDBC Connection对象转换为池化的Connection,增加了诸如验证、关闭、回收等功能。 3. **ObjectPool**: 这是Jakarta Pool库中的接口,表示一个对象池。DBCP使用它来存储和管理...