tomcat 404问题,console出的问题有关于mysql数据库连接问题,账号密码错误等问题。萌新求帮助!!

复制的一个网站项目,想要再localhost尝试看看,但网页404,查询问题发现mysql链接有问题。
试图尝试解决,但无功而返。刚开始自学水平很差,能有大神帮忙耐心指点吗?谢谢
如果能帮我解决问题有重谢。可以加q或v帮助下小弟!
以下是console结果(如果需要什么代码,可随时复制黏贴):


INFO: Initializing Spring root WebApplicationContext
11:28:29,539 INFO ContextLoader:305 - Root WebApplicationContext: initialization started
11:28:29,613 INFO XmlWebApplicationContext:578 - Refreshing Root WebApplicationContext: startup date [Tue Dec 04 11:28:29 CST 2018]; root of context hierarchy
11:28:29,652 INFO XmlBeanDefinitionReader:317 - Loading XML bean definitions from class path resource [applicationContext.xml]
11:28:29,811 INFO XmlBeanDefinitionReader:317 - Loading XML bean definitions from class path resource [applicationContext-dataSource.xml]
11:28:29,952 INFO PropertySourcesPlaceholderConfigurer:172 - Loading properties file from class path resource [jdbc.properties]
11:28:30,020 INFO MLog:80 - MLog clients using log4j logging.
11:28:30,047 INFO C3P0Registry:204 - Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace: 10]
11:28:30,214 INFO Version:37 - HHH000412: Hibernate Core {5.0.1.Final}
11:28:30,216 INFO Environment:213 - HHH000206: hibernate.properties not found
11:28:30,217 INFO Environment:317 - HHH000021: Bytecode provider name : javassist
11:28:30,261 INFO Version:66 - HCANN000001: Hibernate Commons Annotations {5.0.0.Final}
11:28:30,381 INFO AbstractPoolBackedDataSource:462 - 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 -> 1hge75i9zx396c51lmbo3k|1bf951e0, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hge75i9zx396c51lmbo3k|1bf951e0, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://localhost:3306/test?characterEncoding=utf-8, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]
11:28:59,645 WARN BasicResourcePool:1841 - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@1d4e6cb -- 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: Access denied for user 'root'@'localhost' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3823)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:870)
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1659)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1206)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2234)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2265)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2064)
at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:790)
at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:44)
at sun.reflect.GeneratedConstructorAccessor21.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:395)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
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)
11:28:59,650 WARN JdbcEnvironmentInitiator:132 - HHH000342: Could not obtain connection to query metadata : Connections could not be acquired from the underlying database!
11:28:59,652 WARN BasicResourcePool:1841 - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@5453f660 -- 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: Access denied for user 'root'@'localhost' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3823)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:870)
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1659)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1206)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2234)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2265)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2064)
at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:790)
at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:44)
at sun.reflect.GeneratedConstructorAccessor21.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:395)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
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)
11:28:59,652 WARN BasicResourcePool:1841 - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@68345260 -- 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: Access denied for user 'root'@'localhost' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3823)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:870)
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1659)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1206)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2234)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2265)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2064)
at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:790)
at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:44)
at sun.reflect.GeneratedConstructorAccessor21.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:395)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
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)
11:28:59,720 INFO Dialect:154 - HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
11:28:59,744 INFO LobCreatorBuilderImpl:63 - HHH000422: Disabling contextual LOB creation as connection was null
11:29:00,395 INFO SchemaUpdate:101 - HHH000228: Running hbm2ddl schema update
11:29:29,549 WARN BasicResourcePool:1841 - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@6aad2b9c -- 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: Access denied for user 'root'@'localhost' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3823)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:870)
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1659)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1206)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2234)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2265)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2064)
at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:790)
at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:44)
at sun.reflect.GeneratedConstructorAccessor21.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:395)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
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)
11:29:29,554 WARN XmlWebApplicationContext:546 - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'orderInfoDaoImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void com.itheima.dao.impl.OrderInfoDaoImpl.setHT(org.springframework.orm.hibernate5.HibernateTemplate); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in class path resource [applicationContext-dataSource.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext-dataSource.xml]: Invocation of init method failed; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Unable to open JDBC connection for schema management target
11:29:29,567 ERROR ContextLoader:351 - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'orderInfoDaoImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void com.itheima.dao.impl.OrderInfoDaoImpl.setHT(org.springframework.orm.hibernate5.HibernateTemplate); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in class path resource [applicationContext-dataSource.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext-dataSource.xml]: Invocation of init method failed; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Unable to open JDBC connection for schema management target
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1218)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:778)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4994)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5492)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1245)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1895)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void com.itheima.dao.impl.OrderInfoDaoImpl.setHT(org.springframework.orm.hibernate5.HibernateTemplate); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in class path resource [applicationContext-dataSource.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext-dataSource.xml]: Invocation of init method failed; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Unable to open JDBC connection for schema management target
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:661)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
... 27 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in class path resource [applicationContext-dataSource.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext-dataSource.xml]: Invocation of init method failed; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Unable to open JDBC connection for schema management target
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1230)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1199)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1123)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1021)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:618)
... 29 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext-dataSource.xml]: Invocation of init method failed; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Unable to open JDBC connection for schema management target
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1582)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
... 42 more
Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: Unable to open JDBC connection for schema management target
at org.hibernate.tool.schema.internal.TargetDatabaseImpl.prepare(TargetDatabaseImpl.java:42)
at org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigration(SchemaMigratorImpl.java:56)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:129)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:97)
at org.hibernate.internal.SessionFactoryImpl.(SessionFactoryImpl.java:481)
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:708)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:724)
at org.springframework.orm.hibernate5.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:416)
at org.springframework.orm.hibernate5.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:401)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1641)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578)
... 49 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.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122)
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess.obtainConnection(JdbcEnvironmentInitiator.java:180)
at org.hibernate.tool.schema.internal.TargetDatabaseImpl.prepare(TargetDatabaseImpl.java:38)
... 60 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)
... 64 more
十二月 04, 2018 11:29:29 上午 org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'orderInfoDaoImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void com.itheima.dao.impl.OrderInfoDaoImpl.setHT(org.springframework.orm.hibernate5.HibernateTemplate); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in class path resource [applicationContext-dataSource.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext-dataSource.xml]: Invocation of init method failed; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Unable to open JDBC connection for schema management target
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1218)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:778)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4994)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5492)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1245)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1895)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void com.itheima.dao.impl.OrderInfoDaoImpl.setHT(org.springframework.orm.hibernate5.HibernateTemplate); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in class path resource [applicationContext-dataSource.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext-dataSource.xml]: Invocation of init method failed; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Unable to open JDBC connection for schema management target
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:661)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
... 27 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in class path resource [applicationContext-dataSource.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext-dataSource.xml]: Invocation of init method failed; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Unable to open JDBC connection for schema management target
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1230)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1199)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1123)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1021)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:618)
... 29 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext-dataSource.xml]: Invocation of init method failed; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Unable to open JDBC connection for schema management target
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1582)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
... 42 more
Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: Unable to open JDBC connection for schema management target
at org.hibernate.tool.schema.internal.TargetDatabaseImpl.prepare(TargetDatabaseImpl.java:42)
at org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigration(SchemaMigratorImpl.java:56)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:129)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:97)
at org.hibernate.internal.SessionFactoryImpl.(SessionFactoryImpl.java:481)
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:708)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:724)
at org.springframework.orm.hibernate5.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:416)
at org.springframework.orm.hibernate5.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:401)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1641)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578)
... 49 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.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122)
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess.obtainConnection(JdbcEnvironmentInitiator.java:180)
at org.hibernate.tool.schema.internal.TargetDatabaseImpl.prepare(TargetDatabaseImpl.java:38)
... 60 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)
... 64 more

十二月 04, 2018 11:29:29 上午 org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
11:29:29,570 WARN BasicResourcePool:1841 - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@3e5739e3 -- 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: Access denied for user 'root'@'localhost' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3823)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:870)
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1659)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1206)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2234)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2265)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2064)
at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:790)
at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:44)
at sun.reflect.GeneratedConstructorAccessor21.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:395)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
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)
11:29:29,570 WARN BasicResourcePool:1841 - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@f302a79 -- 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: Access denied for user 'root'@'localhost' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3823)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:870)
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1659)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1206)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2234)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2265)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2064)
at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:790)
at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:44)
at sun.reflect.GeneratedConstructorAccessor21.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:395)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
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)
十二月 04, 2018 11:29:29 上午 org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/ssh] startup failed due to previous errors
十二月 04, 2018 11:29:29 上午 org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
十二月 04, 2018 11:29:29 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [/ssh] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
十二月 04, 2018 11:29:29 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/ssh] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak.
十二月 04, 2018 11:29:29 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/ssh] appears to have started a thread named [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0] but has failed to stop it. This is very likely to create a memory leak.
十二月 04, 2018 11:29:29 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/ssh] appears to have started a thread named [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1] but has failed to stop it. This is very likely to create a memory leak.
十二月 04, 2018 11:29:29 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/ssh] appears to have started a thread named [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2] but has failed to stop it. This is very likely to create a memory leak.
十二月 04, 2018 11:29:29 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/ssh] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak.
十二月 04, 2018 11:29:29 上午 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory E:\apache-tomcat-7.0.57\webapps\ssh has finished in 61,100 ms
十二月 04, 2018 11:29:29 上午 org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-apr-8080"]
十二月 04, 2018 11:29:29 上午 org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-apr-8009"]
十二月 04, 2018 11:29:29 上午 org.apache.catalina.startup.Catalina start
INFO: Server startup in 61993 ms

0

3个回答

你先看看数据库密码对不对,然后把数据库配置截图发出来

 #数据库连接配置
spring.datasource.url=jdbc:mysql://localhost/yunbianli?useUnicode=true
spring.datasource.username=root
spring.datasource.password=19921024
spring.datasource.driver-class-name=com.mysql.jdbc.Driver

# initial-size: 10
spring.datasource.initial-size= 50
# min-idle: 5
spring.datasource.min-idle=0
# max-idle: 40
spring.datasource.max-idle=40
#  max-wait: 500
spring.datasource.max-wait=500

你c3p0应该是:
c3p0.maxIdle=40
0
weixin_43923587
weixin_43923587 回复qq_31122833: 我下载了这个版本的可以吗? “druid-1.1.9-javadoc.jar ”
9 个月之前 回复
weixin_43923587
weixin_43923587 回复qq_31122833: 主要是我都是按照教程上来弄得,自己更正问题的能力太差了。。。我去试试druid连接池
9 个月之前 回复
weixin_43923587
weixin_43923587 回复qq_31122833: 我这个一开始设置密码改成这个了呀= =难道我弄错了?
9 个月之前 回复
qq_31122833
小达哥的垃圾桶 回复weixin_43923587: 你连的是mysql数据库吗?你连接配置是连mysql数据库
9 个月之前 回复
qq_31122833
小达哥的垃圾桶 回复weixin_43923587: 数据库是你本地电脑的数据库吗
9 个月之前 回复
qq_31122833
小达哥的垃圾桶 回复weixin_43923587: 我修改了评论,你试试别用c3p0连接池,用阿里巴巴的druid连接池。以上连接配置是我的
9 个月之前 回复
qq_31122833
小达哥的垃圾桶 回复weixin_43923587: 晕,你确定密码是19921024吗?
9 个月之前 回复
weixin_43923587
weixin_43923587 回复qq_31122833: 改成username还是不行=- = 崩溃
9 个月之前 回复
weixin_43923587
weixin_43923587 回复qq_31122833: jar包导入了
9 个月之前 回复
weixin_43923587
weixin_43923587 回复qq_31122833: 好的我试试
9 个月之前 回复
qq_31122833
小达哥的垃圾桶 回复weixin_43923587: 你有导入的c3p0的jar包吗
9 个月之前 回复
qq_31122833
小达哥的垃圾桶 回复weixin_43923587: 数据库连接配置user改成username看看
9 个月之前 回复
weixin_43923587
weixin_43923587 请问,配置数据库是需要jtds-1.2.5.jar这个放到lib包里然后再在代码里引用数据源吗?
9 个月之前 回复
weixin_43923587
weixin_43923587 好的,收到谢谢
9 个月之前 回复

图片说明
根据你的这个报错 初步判断 数据库用户名或密码错了,先用可视化工具连一下数据库看是否可以连上,需要贴一下配置数据库的代码看一下

0
weixin_43923587
weixin_43923587 请问,配置数据库是需要jtds-1.2.5.jar这个放到lib包里然后再在代码里引用数据源吗?
9 个月之前 回复
weixin_43923587
weixin_43923587 收到,我试试
9 个月之前 回复

图片说明
这个是否是我配置数据库的代码? sqlyog也能连接的上,但不知道为什么还提示账号密码错误。。。。。该怎么办,一头雾水。求救!!!
图片说明

0
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
tomcat 404 问题,萌新完全措手无助!
复制了个网上商城项目,想要按照步骤再localhost看看效果如何。rn 但访问永远是404,各位大神能够帮助我下吗?rn 网上排查原因,很可能是路径错误,但本人萌新的不行也不知道哪里有错误。能帮忙看看吗?rn 如果能帮到萌新我,重谢!!!rn 第一次是没有启动mysql,经过大神提点打开了mysql。如果是mysql路径问题改怎么改啊= =rn 但发现还是出现404问题,这是新的console:rn 附上eclipse,tomcat启动console:rn12:21:16,138 INFO ContextLoader:305 - Root WebApplicationContext: initialization startedrn12:21:16,215 INFO XmlWebApplicationContext:578 - Refreshing Root WebApplicationContext: startup date [Mon Dec 03 12:21:16 CST 2018]; root of context hierarchyrn12:21:16,253 INFO XmlBeanDefinitionReader:317 - Loading XML bean definitions from class path resource [applicationContext.xml]rn12:21:16,419 INFO XmlBeanDefinitionReader:317 - Loading XML bean definitions from class path resource [applicationContext-dataSource.xml]rn12:21:16,585 INFO PropertySourcesPlaceholderConfigurer:172 - Loading properties file from class path resource [jdbc.properties]rn12:21:16,674 INFO MLog:80 - MLog clients using log4j logging.rn12:21:16,703 INFO C3P0Registry:204 - Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace: 10]rn12:21:16,897 INFO Version:37 - HHH000412: Hibernate Core 5.0.1.Finalrn12:21:16,898 INFO Environment:213 - HHH000206: hibernate.properties not foundrn12:21:16,900 INFO Environment:317 - HHH000021: Bytecode provider name : javassistrn12:21:16,949 INFO Version:66 - HCANN000001: Hibernate Commons Annotations 5.0.0.Finalrn12:21:17,075 INFO AbstractPoolBackedDataSource:462 - 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 -> 1hge75i9zvpp72t95hhis|4b8fa058, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hge75i9zvpp72t95hhis|4b8fa058, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://localhost:3306/test?characterEncoding=utf-8, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> user=******, password=******, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]rn12:21:46,319 WARN BasicResourcePool:1841 - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@4241d3ee -- 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: rnjava.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)rn at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)rn at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)rn at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3823)rn at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:870)rn at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1659)rn at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1206)rn at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2234)rn at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2265)rn at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2064)rn at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:790)rn at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:44)rn at sun.reflect.GeneratedConstructorAccessor19.newInstance(Unknown Source)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)rn at java.lang.reflect.Constructor.newInstance(Constructor.java:525)rn at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)rn at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:395)rn at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)rn at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)rn at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)rn at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)rn at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)rn at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)rn at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)rn at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)rn at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)rn12:21:46,323 WARN JdbcEnvironmentInitiator:132 - HHH000342: Could not obtain connection to query metadata : Connections could not be acquired from the underlying database!rn12:21:46,328 WARN BasicResourcePool:1841 - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@6ca1f056 -- 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: rnjava.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)rn at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)rn at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)rn at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3823)rn at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:870)rn at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1659)rn at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1206)rn at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2234)rn at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2265)rn at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2064)rn at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:790)rn at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:44)rn at sun.reflect.GeneratedConstructorAccessor19.newInstance(Unknown Source)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)rn at java.lang.reflect.Constructor.newInstance(Constructor.java:525)rn at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)rn at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:395)rn at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)rn at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)rn at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)rn at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)rn at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)rn at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)rn at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)rn at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)rn at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)rn12:21:46,328 WARN BasicResourcePool:1841 - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@4b14cbc4 -- 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: rnjava.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)rn at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)rn at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)rn at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3823)rn at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:870)rn at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1659)rn at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1206)rn at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2234)rn at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2265)rn at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2064)rn at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:790)rn at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:44)rn at sun.reflect.GeneratedConstructorAccessor19.newInstance(Unknown Source)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)rn at java.lang.reflect.Constructor.newInstance(Constructor.java:525)rn at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)rn at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:395)rn at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)rn at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)rn at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)rn at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)rn at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)rn at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)rn at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)rn at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)rn at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)rn12:21:46,338 INFO Dialect:154 - HHH000400: Using dialect: org.hibernate.dialect.MySQLDialectrn12:21:46,359 INFO LobCreatorBuilderImpl:63 - HHH000422: Disabling contextual LOB creation as connection was nullrn12:21:46,819 INFO SchemaUpdate:101 - HHH000228: Running hbm2ddl schema updatern12:22:15,916 WARN BasicResourcePool:1841 - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@5c1c8876 -- 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: rnjava.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)rn at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)rn at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)rn at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3823)rn at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:870)rn at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1659)rn at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1206)rn at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2234)rn at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2265)rn at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2064)rn at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:790)rn at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:44)rn at sun.reflect.GeneratedConstructorAccessor19.newInstance(Unknown Source)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)rn at java.lang.reflect.Constructor.newInstance(Constructor.java:525)rn at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)rn at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:395)rn at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)rn at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)rn at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)rn at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)rn at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)rn at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)rn at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)rn at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)rn at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)rn12:22:15,918 WARN XmlWebApplicationContext:546 - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'orderInfoDaoImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void com.itheima.dao.impl.OrderInfoDaoImpl.setHT(org.springframework.orm.hibernate5.HibernateTemplate); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in class path resource [applicationContext-dataSource.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext-dataSource.xml]: Invocation of init method failed; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Unable to open JDBC connection for schema management targetrn12:22:15,924 WARN BasicResourcePool:1841 - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@26177995 -- 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: rnjava.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)rn at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)rn at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)rn at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3823)rn at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:870)rn at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1659)rn at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1206)rn at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2234)rn at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2265)rn at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2064)rn at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:790)rn at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:44)rn at sun.reflect.GeneratedConstructorAccessor19.newInstance(Unknown Source)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)rn at java.lang.reflect.Constructor.newInstance(Constructor.java:525)rn at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)rn at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:395)rn at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)rn at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)rn at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)rn at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)rn at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)rn at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)rn at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)rn at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)rn at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)rn12:22:15,924 WARN BasicResourcePool:1841 - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@2535e741 -- 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: rnjava.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)rn at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)rn at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)rn at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3823)rn at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:870)rn at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1659)rn at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1206)rn at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2234)rn at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2265)rn at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2064)rn at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:790)rn at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:44)rn at sun.reflect.GeneratedConstructorAccessor19.newInstance(Unknown Source)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)rn at java.lang.reflect.Constructor.newInstance(Constructor.java:525)rn at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)rn at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:395)rn at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)rn at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)rn at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)rn at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)rn at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)rn at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)rn at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)rn at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)rn at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)rn12:22:15,933 ERROR ContextLoader:351 - Context initialization failedrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'orderInfoDaoImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void com.itheima.dao.impl.OrderInfoDaoImpl.setHT(org.springframework.orm.hibernate5.HibernateTemplate); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in class path resource [applicationContext-dataSource.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext-dataSource.xml]: Invocation of init method failed; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Unable to open JDBC connection for schema management targetrn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1218)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:778)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)rn at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4994)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5492)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1245)rn at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1895)rn at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)rn at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)rn at java.util.concurrent.FutureTask.run(FutureTask.java:166)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)rn at java.lang.Thread.run(Thread.java:722)rnCaused by: org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void com.itheima.dao.impl.OrderInfoDaoImpl.setHT(org.springframework.orm.hibernate5.HibernateTemplate); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in class path resource [applicationContext-dataSource.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext-dataSource.xml]: Invocation of init method failed; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Unable to open JDBC connection for schema management targetrn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:661)rn at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)rn ... 27 morernCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in class path resource [applicationContext-dataSource.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext-dataSource.xml]: Invocation of init method failed; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Unable to open JDBC connection for schema management targetrn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1485)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1230)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1199)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1123)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1021)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:618)rn ... 29 morernCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext-dataSource.xml]: Invocation of init method failed; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Unable to open JDBC connection for schema management targetrn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1582)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)rn ... 42 morernCaused by: org.hibernate.tool.schema.spi.SchemaManagementException: Unable to open JDBC connection for schema management targetrn at org.hibernate.tool.schema.internal.TargetDatabaseImpl.prepare(TargetDatabaseImpl.java:42)rn at org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigration(SchemaMigratorImpl.java:56)rn at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:129)rn at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:97)rn at org.hibernate.internal.SessionFactoryImpl.(SessionFactoryImpl.java:481)rn at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444)rn at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:708)rn at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:724)rn at org.springframework.orm.hibernate5.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:416)rn at org.springframework.orm.hibernate5.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:401)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1641)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578)rn ... 49 morernCaused by: java.sql.SQLException: Connections could not be acquired from the underlying database!rn at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)rn at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:529)rn at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)rn at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122)rn at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess.obtainConnection(JdbcEnvironmentInitiator.java:180)rn at org.hibernate.tool.schema.internal.TargetDatabaseImpl.prepare(TargetDatabaseImpl.java:38)rn ... 60 morernCaused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.rn at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1319)rn at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557)rn at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477)rn at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525)rn ... 64 morern十二月 03, 2018 12:22:15 下午 org.apache.catalina.core.StandardContext listenerStartrnSEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'orderInfoDaoImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void com.itheima.dao.impl.OrderInfoDaoImpl.setHT(org.springframework.orm.hibernate5.HibernateTemplate); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in class path resource [applicationContext-dataSource.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext-dataSource.xml]: Invocation of init method failed; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Unable to open JDBC connection for schema management targetrn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1218)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:778)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)rn at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4994)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5492)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1245)rn at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1895)rn at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)rn at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)rn at java.util.concurrent.FutureTask.run(FutureTask.java:166)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)rn at java.lang.Thread.run(Thread.java:722)rnCaused by: org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void com.itheima.dao.impl.OrderInfoDaoImpl.setHT(org.springframework.orm.hibernate5.HibernateTemplate); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in class path resource [applicationContext-dataSource.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext-dataSource.xml]: Invocation of init method failed; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Unable to open JDBC connection for schema management targetrn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:661)rn at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)rn ... 27 morernCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in class path resource [applicationContext-dataSource.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext-dataSource.xml]: Invocation of init method failed; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Unable to open JDBC connection for schema management targetrn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1485)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1230)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1199)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1123)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1021)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:618)rn ... 29 morernCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext-dataSource.xml]: Invocation of init method failed; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Unable to open JDBC connection for schema management targetrn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1582)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)rn ... 42 morernCaused by: org.hibernate.tool.schema.spi.SchemaManagementException: Unable to open JDBC connection for schema management targetrn at org.hibernate.tool.schema.internal.TargetDatabaseImpl.prepare(TargetDatabaseImpl.java:42)rn at org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigration(SchemaMigratorImpl.java:56)rn at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:129)rn at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:97)rn at org.hibernate.internal.SessionFactoryImpl.(SessionFactoryImpl.java:481)rn at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444)rn at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:708)rn at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:724)rn at org.springframework.orm.hibernate5.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:416)rn at org.springframework.orm.hibernate5.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:401)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1641)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578)rn ... 49 morernCaused by: java.sql.SQLException: Connections could not be acquired from the underlying database!rn at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)rn at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:529)rn at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)rn at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122)rn at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess.obtainConnection(JdbcEnvironmentInitiator.java:180)rn at org.hibernate.tool.schema.internal.TargetDatabaseImpl.prepare(TargetDatabaseImpl.java:38)rn ... 60 morernCaused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.rn at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1319)rn at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557)rn at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477)rn at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525)rn ... 64 more
Tomcat 问题 出现404 错误
今天本人从5.0 换到了 6.0rn配置了server.xmlrn在server.xml下rn加了句rn rn然后在rnF:\Web\WebRoot下的Web.xml 修改了一下rn如下:rnrnrnrnrn Welcome to Tomcatrn rn Welcome to Tomcatrn rn rn rnrnrn rnrnrnrn然后重启Tomcat rn可以看到服务器下有这个文件夹rn点击这个文件夹下的index.jsprn还是出现404错误rn请教下到底是出现了什么问题?
mysql数据库连接的问题!请求帮助!
这是按照书上写的一段测试数据库连接的代码:rnrnrn';rnrn$colse=mysql_connect($link);rnecho $close;rn?>rnrnrnrn运行结果如下:Warning: MySQL Connection Failed: Access denied for user: 'root@localhost' (Using password: YES) in D:\myphp\eshops\test.php on line 5rnrn请高手指点问题出现在哪里?我是一个初学者,所以不知道哪里出了问题!谢谢!
关于数据库连接问题,请求帮助!
rnimport java.sql.*;rnrnpublic class conSql rnrnrn public static void main(String[] args) rn ResultSet rs;rn Statement stmt;rn rn tryrn Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");rnrn rn catch (ClassNotFoundException e)rn System.out.print(" "+e);rn tryrn String url="jdbc:microsoft:sqlserver://510B1209F7E9460;DatabaseName=asset"; rn String user="asset"; rn String password="asset00"; rn Connection conn= DriverManager.getConnection(url,user,password);rn stmt=conn.createStatement();rn String sql="select * from password"; rn rs=stmt.executeQuery(sql);rn while(rs.next()) rn String name =rs.getString(1);rn String number=rs.getString(2);rn System.out.println("name"+name); rn System.out.println("number"+number); rn rn rs.close();rn stmt.close();rn conn.close();rn rn catch (SQLException e)rnrn rnrn在JSP中运行可以通过 为什么在JAVA 文件中却报错。rnelipse3.1 WindowsXp 2rn错误信息:rn java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriverrnrnrnrnrnrn
萌新请教,求帮助
求大神解释,这个程序是没有语法错误的,但是一旦输入6.0,程序就会崩溃,最后一个图片是书中给出的答案,为啥总会出现程序崩溃呀?rn[img=https://img-bbs.csdn.net/upload/201804/02/1522670783_282772.png][/img][img=https://img-bbs.csdn.net/upload/201804/02/1522670792_507343.png][/img]
萌新求大佬帮助
描述rnrn有一个长度为n的整数序列。请写一个程序,把序列中的最小值与第一个数交换,最大值与最后一个数交换。输出转换好的序列。rnrn输入rnrn输入包括两行。 rnrn第一行为正整数n(1≤n≤10)。 rn第二行为n个整数组成的序列。rnrnrnrn输出rnrn输出转换好的序列。数据之间用空格隔开。rnrn样例输入rn5rn2 1 5 4 3rnrn样例输出rnrn1 2 3 4 5rn在下的代码rn#include rnint main()rnrn int n,a,b,c,d,e,f,min,max,i;rn int str[11];rn while(scanf("%d",&n)!=EOF)rn rn for(i=0;imax)rn rn max=str[i];rn b=i;rn rn rn c=str[0];rn d=str[n-1];rn str[0]=min;rn str[n-1]=max;rn str[a]=c;rn str[b]=d;rn for(i=0;i
Tomcat 404问题详解
我这里说的404问题 是可以访问localhost:8080,但是访问不了项目的问题。 如果访问不了项目 你就要去看看 tomcat的webapps文件夹里面有没有项目名的文件夹了 。 我想应该是没有的。 问题所在: 我安装的 tomcat的时候 总想着自己是固态硬盘 所以就直接选择c盘安装了。但是 ,往c盘进行读写的时候都需要管理员权限 。这个时候 ,如果我们在tomcat下编译 ,
tomcat 404 配置的问题
今天配置tomcat的404页面发现IE和国产浏览器的极速模式都不生效,只有firefox生效,一直找不到原因,但是基本上能确定是客户端的问题。后来终于把这个问题找出来了。        IE和浏览器极速模式在返回状态为404的时候,如果页面内容长度小于512bytes,它会用浏览器自己的默认错误页面代替响应页面的内容。     不晓得是哪个定的规矩   ...
tomcat 404 问题
tomcat,在emplice里启动成功,网页中输入http://localhost:8080成功出现小猫,但是,打开网页文件时总是出现404错误,文件路径没问题,求高手
求大佬帮助萌新上位机问题!!有偿!!!!
萌新求大佬指导上位机编程通讯以及控件使用等等,主要部分为上位机,加qq1437150973    有偿指导!!!!!!
tomcat 404 问题及解决方法
昨天晚上用tomcat 实验一个小程序,没想到的是一直提示404错误。我已经确认目录下有我的html文件,但仍然是404。今天就总结一下tomcat 404 的几种常见问题及解决方法。 问题一: 指定目录下没有访问的文件,这是最常见的,也是最容易解决的。只需要将访问的文件(如:a.html)放到指定目录下即可。 问题二: 将访问的文件(如...
关于tomcat启动超时 和mysql等数据库连接的问题
早上来的时候tomcat启动报超时,然后错误粘了一下去百度,结果改完timeout还是没有什么用 后来研究研究发现 windows防火墙开着呢 关闭了好使 如果不想要关闭,就新建入站和出站规则开放3306端口
关于Tomcat下数据库连接的简单问题
我使用ODBC-JDBC桥连接的SQL2000数据库. 在MyEclipse下可以连接到数据库,但到了Tomcat下确连不上数据库,我的Tomcat是6.0的,高手指教一下在有问题啊
萌新求问UUID的问题…
创建完一个UUID 对象后,比如u,直接打印它出来的结果就是它的内容吗?怎么把它变成无-,大写字母的格式啊?
关于404的问题....求高手...
“/”应用程序中的服务器错误。rn无法找到资源。rn说明: HTTP 404。您正在查找的资源(或者它的一个依赖项)可能已被移除,或其名称已更改,或暂时不可用。请检查以下 URL 并确保其拼写正确。rnrn请求的 URL: /Error.aspx
AJAX xmlHttp.status==404问题求大神帮助
open的第二个参数没有问题,传的路径如果是Defalut.aspx的话status == 200,但是后面加参数例如Defalut.aspx?id=1的话status == 404 求大神帮助。rn
萌新,请教一个问题。
问题描述:如图,看书写的代码,vs2017报错,求指教!rnrn谢谢大神。rnrn[img=https://img-bbs.csdn.net/upload/201802/05/1517819196_683815.png][/img]rn[img=https://img-bbs.csdn.net/upload/201802/05/1517819205_395711.png][/img]rn
oracle 语法问题,萌新
先拜谢各位,小弟刚上手,问个小白问题,n我用查询出了一个结果集,nA B C D四列,其中D列为金额,我现在想用最简单的方法,使现有结果集数据不变,加入E列,E列为D列的所有值之和,E列每行数据一样即可,该如何写呢?
ecplise的问题,萌新求教
[img=https://img-bbs.csdn.net/upload/201505/17/1431841757_794840.jpg][/img]rn这是怎么回事呢,??rn
萌新求助,裸机问题
操作系统课设,想实现能在裸机运行的简易小操作系统,怎么实现裸机环境呢,是用虚拟机实现吗,可是用虚拟机不是也要选系统吗,真的萌新,求大佬解释
急急,萌新关于web项目配置的问题
我创建和搭建好tomcat服务器后写了一个简单的html文件发现在web project中运行不了rn 但只单独点击html文件中运行却可以!rn![图片说明](https://img-ask.csdn.net/upload/201811/09/1541771443_897673.png)rn![图片说明](https://img-ask.csdn.net/upload/201811/09/1541770846_664683.png)rn 我发现在web project上点击运行只能到http://localhost:8080/cn.itcastrn 而在html文件中运行却可以到http://localhost:8080/cn.itcast/demo.htmlrn 这可能是什么原因导致的rn ?????????
(萌新求助)关于反射的问题
萌新入坑,最近在自学反射的问题,感觉好难理解[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/onion/47.gif][/img]rn然后有个关于Invoke的问题:rn[img=https://img-bbs.csdn.net/upload/201712/11/1512973357_917753.png][/img]rn但是我看参数都是object[]类型了呀。。。rn大概代码是酱:rnMain:rn[code=csharp]rnvar run = new Func();rnList methodsList = new List();rnforeach (var methods in run.GetType().GetMethods())rnrn Console.WriteLine(methods.Name);rn methodsList.Add(methods);rnrnvar params= new object[] ...//一些字符串...;rnrnvar methods = methodsList.Find(p=>p.Name == name)rnmethods?.Invoke(run,params); //错误提示说在这行rn[/code]rnFunc类:rn[code=csharp]rnclass Funcrnrn public void 想调用的方法(object[] params)...//...;rnrn[/code]rn这里说不能把string转成object[],但是我感觉这里用的都是object[]的数组来着。。。rn刚入坑,感觉看什么都一知半解的。。。求大神指点一下[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/onion/47.gif][/img]
链表问题,萌新求助
[img=https://img-bbs.csdn.net/upload/201604/10/1460300246_929218.png][/img]#includern#includerntypedef struct Nodern char stuName[10];rn int age;rn struct Node *next;rn struct Node *pre;rnListNode, *ListPtr;rnListNode *head1,*head2,*head3;rnrnListPtr List_Init1()rnrn head1= (ListNode *)malloc(sizeof(ListNode));rn if (head1 == NULL)rn rn printf("申请空间失败!");rn exit(0);rn rn head1->next = NULL;rn ListNode *tail = head1;rn int num;rn int iCount = 1;rn while (1)rn rn ListNode *p;rn p = (ListNode *)malloc(sizeof(ListNode));rn if (p == NULL)rn rn printf("申请空间失败!");rn exit(0);rn rn printf("请输入第%d个学生的姓名:", iCount++);rn scanf("%s", p->stuName);rn printf("请输入该学生的年龄:");rn scanf("%d", &p->age);rn p->next = NULL;rn tail->next = p;rn tail = p;rn printf("继续输1,退出输0:");rn scanf("%d", &num);rn if (num == 0)rn break;rn rn return head1;rnrnrnrnListPtr List_Init2()rnrn head2 = (ListNode *)malloc(sizeof(ListNode));rn if (head2 == NULL)rn rn printf("申请空间失败!");rn exit(0);rn rn head2->next = NULL;rn ListNode *tail = head2;rn int num;rn int iCount = 1;rn while (1)rn rn ListNode *p;rn p = (ListNode *)malloc(sizeof(ListNode));rn if (p == NULL)rn rn printf("申请空间失败!");rn exit(0);rn rn printf("请输入第%d个学生的姓名:", iCount++);rn scanf("%s", p->stuName);rn printf("请输入该学生的年龄:");rn scanf("%d", &p->age);rn p->next = NULL;rn tail->next = p;rn tail = p;rn printf("继续输1,退出输0:");rn scanf("%d", &num);rn if (num == 0)rn break;rn rn return head2;rnrnrnrnListPtr Merge()rnrnrn ListNode*p1, *p2,*p3;rn p1 = head1->next;rn p2 = head2->next;rn head3 = head1;rn p3 = head3;rn while ((p1 != NULL) && (p2 != NULL))rn rn if (p1->age <= p2->age)rn rn p3->next = p1;rn p3 = p1;rn p1 = p1->next;rn rn elsern rn p3->next = p2;rn p3 = p2;rn p2 = p2->next;rn rn rn if (p1 != NULL) p3 = p1->next;rn else p3 = p2->next;rn free(p2);rn return head3;rnrnrnrnvoid show()rnrn ListPtr p = head3->next;rn while (p != NULL)rn printf("%s/%d\n", p->stuName, p->age);rn p = p->next;rn rnrnrnint main()rnrn List_Init1();rn List_Init2();rn show();rn return 0;rn
全排列问题--萌新的方法
作为一个刚接触C程不久的学生,我表示CSDN里大神们用的解题方式好多都不明其意所以我决定用自己的想法来尝试at first:我意图降低难度,编写一个可以有重复的全排列。因此我想把它做成一个数,是以n(个数)为进制数的一串数,输出然而我发现要做未知量进制的进制转化代码太过麻烦second:我想用二位数组解决,但是并没*用;然后我开始看了一下大神们的代码233#include&amp;lt;cstdio&amp;gt...
(萌新求助)关于文件读取的问题
最近在做一个检测文件的工具,要读取文件内容(文件数量多但比较小),然后想问几个问题,感觉找了好久都找不到答案(或者是因为对一些语法还有机制什么的不太熟悉,找不到思路)[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/onion/47.gif][/img]rn1.因为是边学边写的,所以经常在调试找原因,然后(每次修改代码之后)第一次调试的时候,(检测文件的)速度都比较慢,然后我直接再去进行调试的话,速度就只有第一次的一半左右,想问下这是什么原因。。是文件读取出来之后保存在哪里了吗(我是用FileStream+StreamReader读取的成字符串,再去检测内容的,然后每次读取完文件我都有关闭流)rn2.因为感觉速度有点慢(我是按顺序去一个一个文件读取然后检测),所以想用任务来同时检测多个文件,自己想的方法是把Task添加到一个List里头去,但是调试的时候发现有很多文件被跳过去了,而且是随机的,这是为啥。。我原本以为是任务没有执行完就过去了,就加了个WaitAll的方法,但是还是没有检测完全部文件。。
萌新求教,关于内存分配的问题
#includernstrcut name rn char * fname;rn;rn------------------------------------------------------------------------------------rnint main(void) rn struct name * my_name;rn my_name->fname=(char *)malloc(10*sizeof(char));rn return 0;rnrn当然这样是错的 (为什么)rn-------------------------------------------------------------------------------------rnint main(void) rn struct name * my_name;rn my_name=(struct name *)malloc(siezeof(struct name));rn return 0;rnrn这是对的rn-------------------------------------------------------------------------------------rnint main(void) rn struct name my_name;rn my_name.fname=(char *)malloc(10*sizeof(char));rn return 0;rnrn这是对的。rn
萌新求助:关于button空指针问题
代码大部分按照书上来的,开始用的imagebutton 后来改用button都报错。rn报错行数大概在button.onclickliestener那一行,萌新不懂为什么会报错。QAQ明明xml里有这个控件的呀rnrn代码如下:rn主函数:rn[code=java]package com.example.call;rnrnimport java.util.ArrayList;rnimport java.util.HashMap;rnimport java.util.List;rnimport java.util.Map;rnrnimport android.app.ListActivity;rnimport android.content.Intent;rnimport android.net.Uri;rnimport android.os.Bundle;rnimport android.view.View;rnimport android.widget.Button;rnimport android.widget.ImageButton;rnimport android.widget.SimpleAdapter;rnrnpublic class MainActivity extends ListActivity rn rnrn @Overridern protected void onCreate(Bundle savedInstanceState) rn super.onCreate(savedInstanceState);rn final Button bImageButton =(Button) findViewById(R.id.callphone);rn SimpleAdapter adapter=new SimpleAdapter(this, getDate(), R.layout.activity_main, rn new String[]"name","number","img",rn new int[]R.id.peoplename,R.id.peoplenumber,R.id.callphones);rn setListAdapter(adapter);rn bImageButton.setOnClickListener(new Button.OnClickListener()rnrn @Overridern public void onClick(View v) rn // TODO 自动生成的方法存根rn Intent intent=new Intent(Intent.ACTION_CALL, Uri.parse("tel://1502203"));rn startActivity(intent);rn );rn rnrn rn public List> getDate()rn List> list=new ArrayList>();rn Map map=new HashMap();rn rn map.put("name","sue" );rn map.put("number", "13012259133");rn map.put("img", R.drawable.imgcall_phone);rn list.add(map);rn rn map=new HashMap();rn map.put("name","alice" );rn map.put("number", "15022037651");rn map.put("img", R.drawable.imgcall_phone);rn list.add(map);rn rn return list;rn rn rnrn[/code]rnrnxml:rn[code=java] rn rn rn rn rn rn rn rnrnrn rn rn rn rn rnrnrn[/code]
关于qt5数据库连接错误的问题
main函数中的代码如下:nQSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");nn db.setDatabaseName("fyk.db");nn bool op = db.open();n qDebug() << db.tables();n QSqlQuery query;nn n bool success = query.exec("CREATE TABLE student(id INT PRIMARY KEY,name VARCHAR(20)");n if (success)n n qDebug() << QObject::tr("success");n n elsen n qDebug() << QObject:: tr("fail");n qDebug() << query.lastError().type();n QMessageBox::critical(0, QObject::tr("Database Error"),n query.lastError().text());n n n 运行后提示的错误是table student already exists unable to execute statement,本人刚接触qt,困扰了很久,求大神解答
关于.net与mysql数据库连接的问题??
请问.net如何连接mysql数据库???
关于数据库连接提示错误的问题!
我在连接ACCESS数据库时系统老是提示“系统不支持这种排序方式,DBE引擎错误了”,不知是什么原因,我建好了别名,也能够连接到数据库,能看到表的字段,但一打开就提示错误,用DBGRID能看到字段,但表的数据都看不到,我重装过系统还是不行,到底是什么问提啊。
关于jdbc数据库连接的问题(MySQL)
我是这样做的:rnrn[顶]基于MySQL的JAVA JDBC数据库访问(Statement接口篇)完结~rn第一步:编辑Servlet文件CreateDBServlet.java,源代码如下: rn[code=Java]package yuzhengzhong; rnimport java.io.IOException; rnimport java.io.PrintWriter; rnimport java.sql.Connection; rnimport java.sql.DriverManager; rnimport java.sql.SQLException; rnimport java.sql.Statement; rnimport javax.servlet.ServletException; rnimport javax.servlet.UnavailableException; rnimport javax.servlet.http.HttpServlet; rnimport javax.servlet.http.HttpServletRequest; rnimport javax.servlet.http.HttpServletResponse; rnrnpublic class CreateDBServlet extends HttpServlet rn private String url; rn private String user; rn private String password; rn rn public void init() throws ServletException rn rn String driverClass=getInitParameter("driverClass"); rn url=getInitParameter("url"); rn user=getInitParameter("user"); rn password=getInitParameter("password"); rn try rn rn Class.forName(driverClass); rn catch(ClassNotFoundException ce) rn throw new UnavailableException("加载数据库驱动失败!"); rn rn rn rn public void doGet(HttpServletRequest req,HttpServletResponse resp) throws ServletException,IOException rn rn Connection conn=null; rn Statement stmt=null; rn try rn rn conn=DriverManager.getConnection(url,user,password); rn stmt=conn.createStatement(); rn stmt.executeUpdate("create database bookstore"); rn stmt.executeUpdate("use bookstore"); rn stmt.executeUpdate("create table bookinfo(id INT not null primary key,title VARCHAR(50) not " + rn "null,author VARCHAR(50) not null,bookconcern VARCHAR(50) not null,publish_date DATE " + rn "not null,price FLOAT(4,2) not null,amount SMALLINT,remark VARCHAR(200)) ENGINE=InnoDB"); rn stmt.addBatch("insert into bookinfo values(1,'JAVA 从入门到精通','张三','张三出版社','2004-6-1',34.00,35,null)"); rn stmt.addBatch("insert into bookinfo values(2,'JSP 深入编程','李四','李四出版社','2004-10-1',56.00,20,null)"); rn stmt.addBatch("insert into bookinfo values(3,'J2EE 高级编程','王五','王五出版社','2005-3-1',78.00,10,null)"); rn rn stmt.executeBatch(); rn rn PrintWriter out=resp.getWriter(); rn out.println("success!"); rn out.close(); rn catch(SQLException se) rn rn se.printStackTrace(); rn finally rn if(stmt!=null) rn rn try rn stmt.close(); rn catch(SQLException se) rn se.printStackTrace(); rn rn stmt=null; rn rn if(conn!=null) rn rn try rn conn.close(); rn catch(SQLException se) rn se.printStackTrace(); rn rn conn=null; rn rn rn rn rn [/code]rn源代码分析:先声明要用到的三个私有变量;在servlet的初始化方法中,先调用getInitParameter得到驱动类名,再从web.xml的配置中得到url,user和password值。然后通过forName方法加载并注册数据库驱动。接下来编写servlet的处理方法doGet。传入url,uesr,password三个参数,调用DriverManager.getConnection方法构造connection对象,取得与数据库的连接,再调用connection的createStatement方法构造statement对象,这样子就可以像数据库传递SQL语句了。接下来创建bookstore表,使用bookstore表,创建表的各个键,addPatch向数据库插入数据。最后,如果成功,输出success,后面是java的异常处理。 rnrn第二步:编译CreateDBServlet文件,得到class类文件 rnrn第三步:部署servlet。这一次,因为是任意目录下的web程序,所以要在%CATALINA_HOME%\conf\Catalina\localhost目录下为该web程序配置运行目录---建立yuzhengzhong.xml文件,代码如下: rn rn 然后就可以部署servlet的目录层次了,在“E:\web”目录下新建WEB-INF目录,在WEB-INF目录下新建classes目录和web.xml文件,把编译后的CreateDBServlet类文件放进classes的yuzhengzhong文件夹中,web.xml的代码如下: rnrn[code=XML] rn rn rn CreateDBServlet rn yuzhengzhong.CreateDBServlet rn rn rn driverClass rn com.mysql.jdbc.Driver rn rn rn rn url rn jdbc:mysql://localhost:3306/mysql rn rn rn rn user rn root rn rn rn rn password rn 12345678 rn rn rn rnrn rn CreateDBServlet rn /createdb rn rn rn[/code]rn第四步:配置数据库驱动。下载数据库驱动程序MySQL Connector/J,解压缩后找到mysql-connector-java-5.1.6-bin.jar,放到%CATALINA_HOME%\common\lib目录下。 rnrn第五步:启动tomcat服务器,打开IE,输入http://localhost:8080/yuzhengzhong/createdb,如果看到"success",则表明创建数据库和表已经成功。 rnrn我照上面那么做了,出现错误,错误如下:rndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnjavax.servlet.ServletException: No servlet class has been specified for servlet CreateDBServletrn org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)rn org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)rn org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)rn org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)rn java.lang.Thread.run(Unknown Source)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/6.0.16 logs.rnrn为什么会出现错误呢,如果你觉得上面都没错,那么是不是我的MySQL下得不完全,在开始菜单里它是这样的:所有程序-MySQL-MySQL Server 5.0-MySQL Command Line Client和MySQL Manual和MySQL Server Instance Config Wizard。rn
关于mysql数据库连接异常的问题
请教:用JNDI连接MYSQL数据库时出现下列异常是何原因? rnCannot create PoolableConnectionFactory (Could not create connection to database server. Attempted reconnect 3 times. Giving up.)
关于html与mysql数据库连接的问题
小弟是web数据库开发的新手,遇到一个大问题请教各位数据库界的大虾.现用dreamweaver做了一个网页,将其代码存为.htm文件,作为模板.如何在其中嵌入php代码,作为接口,使其能与已创建的mysql数据库连接?谢谢各位!
求助!!!关于mysql数据库连接的问题
今天遇到这样的一个问题,mysql连接不上(数据库能正常工作)!特此求助!!!rn背景:Tomcat5.5+Jdk 1.5, JSPrnTomcat中的server文件我添加了如下代码:rn[code=XML] rnrn[/code]rn主目录的web.xml文件中相应的添加了:rn[code=XML]rnrn Testrn jdbc/wlpsrn javax.sql.DataSourcern Containerrnrn[/code]rn我链接数据库的代码是:rn[code=Java]rnContext initCtx = new javax.naming.InitialContext(); rnContext envCtx = (Context) initCtx.lookup("java:comp/env"); rnDataSource ds = (DataSource)envCtx.lookup("jdbc/wlps"); ;rnreturn ds.getConnection();rn[/code]rn报错如下:rnorg.apache.jasper.JasperException: Cannot create JDBC driver of class '' for connect URL 'null'rn org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:460)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn com.jspdev.filter.EncodingFilter.doFilter(EncodingFilter.java:37)rnrnjava.sql.SQLException: No suitable driverrn java.sql.DriverManager.getDriver(Unknown Source)rn org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143)rn org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)rn com.jspdev.util.DatabaseConn.getConnection(DatabaseConn.java:17)rn com.jspdev.login.LoginBean.(LoginBean.java:13)rn org.apache.jsp.signin_005fdo_jsp._jspService(signin_005fdo_jsp.java:120)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn com.jspdev.filter.EncodingFilter.doFilter(EncodingFilter.java:37)rnrn今天已经折腾6-7小时了,没找出什么错误,望大侠们仗义出手!!!
求帮助,关于MYSQL插入数据失败问题
楼主是跟着书做的美食天下那个项目,数据库这里插入总是错误,是怎么回事?rnrn我工具是用的Navicat for MYSQL ,表已经建好,rnrn共有两句提示,提示如下:rn…………………………………………………………………………………………………………………………rn一、rnrn[SQL] EXPLAIN INSERT INTO mstx_head (tid, tname, tdis, uid)rnVALUESrn (rn 0,rn "默认头像",rn "这是个默认的头像,并没有数据",rn 0rn );rnrn[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO mstx_head (tid, tname, tdis, uid)rnVALUESrn (rn 0,rn "默认头像' at line 1rn……………………………………………………………………………………………………………………………………rnrnrn二、rn[SQL] EXPLAIN INSERT INTO mstx_user (rn uid,rn u_name,rn u_qq,rn u_Email,rn u_dis,rn u_head,rn u_pwd,rn u_admin,rn u_mood,rn u_integral,rn u_hobby,rn u_level,rn u_numberrn)rnVALUESrn (rn 0,rn "管理员账号",rn "250178767",rn "250178767@qq.com",rn "这是个测试管理用户",rn 0,rn 111,rn TRUE,rn "快乐",rn 376,rn "电脑",rn 3,rn 23rn );rnrn[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO mstx_user (rn uid,rn u_name,rn u_qq,rn u_Email,rn u_dis,rn u_head,rn' at line 1rnrn……………………………………………………………………………………………………………………rnrn提示在某行错误,可是我不清楚到底是哪里错误,楼主是新人,请说清楚些,谢谢了rnrn
关于telnet账号密码问题
不知道为什么连接telnet服务的账号密码自己就变了,问一下在linux下怎样修改telnet的用户名和密码
tomcat数据库连接问题
我使用jsp+hibernate+struts开发一个网站,用的MyEclips开发,服务器用的tomcat,数据库是sqlserver有下面的一个问题: rnrn我的注册功能会把用户的简历信息填入简历表,同时在数据库中触发一个触发器将自动生成的简历号填到用户表中.可是现在用户提交注册后,数据库里简历表和用户表都已经有了相应的内容(简历号也填到了用户表中).可是用这个用户名登录时总是抛出异常,说找不到简历号(简历号是用户表里引用简历表的一个外键).只能是重启tomcat服务器后才能登录.这是怎么回事呢?该怎么解决呢? rn我怀疑是tomcat没有及时刷新由数据库触发器自动更改的表的内容,可是不太清楚到底怎么回事,我该怎么解决这个问题,希望各位大侠多指点!rn问题补充:rn数据库里的各表关系已经建立了,数据库的存储肯定没问题,以为我从企业管理器可以看到加进去的数据 rn
高分 Tomcat数据库连接问题
向各位求教TOMCAT与数据库断开后自动重连机制, 改怎么设置,多谢了,告诉我资料看看也行。
tomcat的数据库连接问题
本人想在普通的JAVA应用程序中访问tomcat中建立的数据源,程序如下rnpublic class Testrn public DataSource getDataSource(String jndi) rn DataSource ds = null;rn try rn Hashtable ht = new Hashtable();rn ht.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.naming.java.javaURLContextFactory");rn ht.put(Context.PROVIDER_URL,"iiop://localhost:8080" );rn ht.put(Context.URL_PKG_PREFIXES,"org.apache.naming");rn rn Context ctx=new InitialContext(ht);rn //查找JNDI对应的数据源rn ds = (DataSource) ctx.lookup(jndi);rn catch (NamingException ex) rn ex.printStackTrace();rn catch (Exception e) rn e.printStackTrace();rn rn return ds;rn rn public static void main(String[] args)rn Test t=new Test();rn tryrn DataSource ds=t.getDataSource("jdbc/testjndi");rn Connection conn=ds.getConnection();rn Statement es=conn.createStatement();rn ResultSet rs = es.executeQuery(sql);rn while (rs.next()) rn System.out.println(rs.getString(1));rn rn catch(Exception e)rn e.printStackTrace();rn rn rnrn在tomcat中的全局datasource中配置了数据源jdbc/testjndi,用程序连接时报错:rnjavax.naming.NameNotFoundException: Name jdbc is not bound in this Contextrn at org.apache.naming.NamingContext.lookup(NamingContext.java:815)rn at org.apache.naming.NamingContext.lookup(NamingContext.java:198)rn at javax.naming.InitialContext.lookup(InitialContext.java:347)rn ...rnrn请问该如何解决此问题????
关于数据库连接问题-在线等
我建立了一个OleDb的数据库连接,接入到Access数据库。但在配置OleDbDataAdapter时测试连接老是不成功,说什么“无法打开工作组信息文件中的表‘MSysAccounts'..”请问这是什么原因啊?