2015-12-29 933 views
0

我在Openshift上有一個Tomcat7應用程序。我還添加了一個MySQL盒式磁帶和phpMyAdmin盒式磁帶。 .WAR文件部署正確,服務器啓動,但在我的URL我得到一個空白頁。我已經做了所有必要的steps.Here的日誌的副本:Openshift應用程序顯示空白頁

Caused by: java.net.ConnectException: Connection refused 
     at java.net.PlainSocketImpl.socketConnect(Native Method) 
     at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) 
     at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) 
     at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) 
     at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) 
     at java.net.Socket.connect(Socket.java:579) 
     at java.net.Socket.connect(Socket.java:528) 
     at java.net.Socket.<init>(Socket.java:425) 
     at java.net.Socket.<init>(Socket.java:241) 
     at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:257) 
     at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:300) 
     ... 20 more 
    WARN BasicResourcePool - Having failed to acquire a resource, [email protected] is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests. 
    WARN BasicResourcePool - Having failed to acquire a resource, [email protected] is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests. 
    WARN BasicResourcePool - Having failed to acquire a resource, [email protected] is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests. 
    WARN JdbcServicesImpl - HHH000342: Could not obtain connection to query metadata : Connections could not be acquired from the underlying database! 
    INFO Dialect - HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect 
    INFO LobCreatorBuilder - HHH000422: Disabling contextual LOB creation as connection was null 
    INFO TransactionFactoryInitiator - HHH000399: Using default transaction strategy (direct JDBC transactions) 
    INFO ASTQueryTranslatorFactory - HHH000397: Using ASTQueryTranslatorFactory 
    INFO UpdateTimestampsCache - HHH000250: Starting update timestamps cache at region: org.hibernate.cache.spi.UpdateTimestampsCache 
WARN AbstractEhcacheRegionFactory - HHH020003: Could not find a specific ehcache configuration for cache named [org.hibernate.cache.spi.UpdateTimestampsCache]; using defaults. 
INFO StandardQueryCache - HHH000248: Starting query cache at region: org.hibernate.cache.internal.StandardQueryCache 
WARN AbstractEhcacheRegionFactory - HHH020003: Could not find a specific ehcache configuration for cache named [org.hibernate.cache.internal.StandardQueryCache]; using defaults. 
WARN AbstractEhcacheRegionFactory - HHH020003: Could not find a specific ehcache configuration for cache named [org.web4thejob.security.Identity]; using defaults. 
WARN AbstractEhcacheRegionFactory - HHH020003: Could not find a specific ehcache configuration for cache named [org.web4thejob.orm.parameter.Parameter]; using defaults. 
WARN AbstractEhcacheRegionFactory - HHH020003: Could not find a specific ehcache configuration for cache named [org.web4thejob.orm.scheme.RenderElement]; using defaults. 
WARN AbstractEhcacheRegionFactory - HHH020003: Could not find a specific ehcache configuration for cache named [org.web4thejob.orm.query.OrderBy]; using defaults. 
WARN AbstractEhcacheRegionFactory - HHH020003: Could not find a specific ehcache configuration for cache named [org.web4thejob.security.RoleMembers]; using defaults. 
WARN AbstractEhcacheRegionFactory - HHH020003: Could not find a specific ehcache configuration for cache named [org.web4thejob.orm.query.Query]; using defaults. 
WARN AbstractEhcacheRegionFactory - HHH020003: Could not find a specific ehcache configuration for cache named [org.web4thejob.tjoblet.orm.DocumentType]; using defaults. 
WARN AbstractEhcacheRegionFactory - HHH020003: Could not find a specific ehcache configuration for cache named [org.web4thejob.security.AuthorizationPolicy]; using defaults. 
WARN AbstractEhcacheRegionFactory - HHH020003: Could not find a specific ehcache configuration for cache named [org.web4thejob.orm.scheme.RenderScheme]; using defaults. 
WARN AbstractEhcacheRegionFactory - HHH020003: Could not find a specific ehcache configuration for cache named [org.web4thejob.orm.query.Criterion]; using defaults. 
WARN AbstractEhcacheRegionFactory - HHH020003: Could not find a specific ehcache configuration for cache named [org.web4thejob.orm.PanelDefinition]; using defaults. 
WARN AbstractEhcacheRegionFactory - HHH020003: Could not find a specific ehcache configuration for cache named [org.web4thejob.orm.scheme.RenderScheme.elements]; using defaults. 
WARN AbstractEhcacheRegionFactory - HHH020003: Could not find a specific ehcache configuration for cache named [org.web4thejob.orm.query.Query.criteria]; using defaults. 
WARN AbstractEhcacheRegionFactory - HHH020003: Could not find a specific ehcache configuration for cache named [org.web4thejob.orm.query.Query.orderings]; using defaults. 
INFO HibernateTransactionManager - Using DataSource [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 -> 1bqop6w9d1uh6f8z1y57nu9|1124745, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1bqop6w9d1uh6f8z1y57nu9|1124745, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://localhost:3306?useUnicode=true&characterEncoding=UTF-8, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, userOverrides -> {}, usesTraditionalReflectiveProxies -> false ]] of Hibernate SessionFactory for HibernateTransactionManager 
WARN BasicResourcePool - com[email protected]10116ec -- 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: 
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure 
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. 
     at sun.reflect.GeneratedConstructorAccessor27.newInstance(Unknown Source) 
     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 
     at java.lang.reflect.Constructor.newInstance(Constructor.java:526) 
     at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) 
     at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1117) 
     at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:350) 
     at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2393) 
     at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2430) 
     at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2215) 
     at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:813) 
     at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47) 
     at sun.reflect.GeneratedConstructorAccessor25.newInstance(Unknown Source) 
     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 
     at java.lang.reflect.Constructor.newInstance(Constructor.java:526) 
     at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) 
     at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:399) 
     at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:334) 
     at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134) 
     at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:183) 
     at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:172) 
     at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:188) 
     at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1074) 
     at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1061) 
     at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32) 
     at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1798) 
     at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:636) 
Caused by: java.net.ConnectException: Connection refused 
     at java.net.PlainSocketImpl.socketConnect(Native Method) 
     at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) 
     at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) 
     at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) 
     at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) 
     at java.net.Socket.connect(Socket.java:579) 
     at java.net.Socket.connect(Socket.java:528) 
     at java.net.Socket.<init>(Socket.java:425) 
     at java.net.Socket.<init>(Socket.java:241) 
     at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:257) 
     at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:300) 
     ... 20 more 
WARN BasicResourcePool - com[email protected]1b7f01 -- 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: 
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure 
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. 
     at sun.reflect.GeneratedConstructorAccessor27.newInstance(Unknown Source) 
     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 
     at java.lang.reflect.Constructor.newInstance(Constructor.java:526) 
     at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) 
     at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1117) 
     at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:350) 
     at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2393) 
     at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2430) 
     at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2215) 
     at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:813) 
     at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47) 
     at sun.reflect.GeneratedConstructorAccessor25.newInstance(Unknown Source) 
     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 
     at java.lang.reflect.Constructor.newInstance(Constructor.java:526) 
     at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) 
     at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:399) 
     at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:334) 
     at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134) 
     at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:183) 
     at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:172) 
     at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:188) 
     at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1074) 
     at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1061) 
     at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32) 
     at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1798) 
     at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:636) 
Caused by: java.net.ConnectException: Connection refused 
     at java.net.PlainSocketImpl.socketConnect(Native Method) 
     at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) 
     at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) 
     at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) 
     at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) 
     at java.net.Socket.connect(Socket.java:579) 
     at java.net.Socket.connect(Socket.java:528) 
     at java.net.Socket.<init>(Socket.java:425) 
     at java.net.Socket.<init>(Socket.java:241) 
     at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:257) 
     at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:300) 
     ... 20 more 
WARN BasicResourcePool - com[email protected]d69f0d -- 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: 
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure 
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. 
     at sun.reflect.GeneratedConstructorAccessor27.newInstance(Unknown Source) 
     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 
     at java.lang.reflect.Constructor.newInstance(Constructor.java:526) 
     at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) 
     at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1117) 
     at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:350) 
     at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2393) 
     at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2430) 
     at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2215) 
     at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:813) 
     at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47) 
     at sun.reflect.GeneratedConstructorAccessor25.newInstance(Unknown Source) 
     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 
     at java.lang.reflect.Constructor.newInstance(Constructor.java:526) 
     at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) 
     at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:399) 
     at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:334) 
     at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134) 
     at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:183) 
     at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:172) 
     at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:188) 
     at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1074) 
     at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1061) 
     at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32) 
     at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1798) 
     at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:636) 
Caused by: java.net.ConnectException: Connection refused 
     at java.net.PlainSocketImpl.socketConnect(Native Method) 
     at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) 
     at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) 
     at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) 
     at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) 
     at java.net.Socket.connect(Socket.java:579) 
     at java.net.Socket.connect(Socket.java:528) 
     at java.net.Socket.<init>(Socket.java:425) 
     at java.net.Socket.<init>(Socket.java:241) 
     at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:257) 
     at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:300) 
     ... 20 more 
WARN BasicResourcePool - Having failed to acquire a resource, [email protected] is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests. 
WARN BasicResourcePool - Having failed to acquire a resource, [email protected] is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests. 
WARN BasicResourcePool - Having failed to acquire a resource, com.mc[email protected] is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests. 
WARN SqlExceptionHelper - SQL Error: 0, SQLState: null 
ERROR SqlExceptionHelper - Connections could not be acquired from the underlying database! 
ERROR ContextLoader - Context initialization failed 
org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Could not open connection 
     at org.springframework.orm.hibernate4.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:517) 
     at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373) 
     at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:420) 
     at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:257) 
     at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) 
     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) 
     at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) 
     at com.sun.proxy.$Proxy48.findUniqueByQuery(Unknown Source) 
     at org.web4thejob.security.SpringSecurityService.getAdministratorIdentity(SpringSecurityService.java:65) 
     at org.web4thejob.orm.MappingInitializer.ensureAdministratorExists(MappingInitializer.java:72) 
     at org.web4thejob.orm.MappingInitializer.onApplicationEvent(MappingInitializer.java:49) 
     at org.web4thejob.orm.MappingInitializer.onApplicationEvent(MappingInitializer.java:40) 
     at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:98) 
     at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:333) 
     at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:776) 
     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:485) 
     at org.web4thejob.context.ContextUtil.refresh(ContextUtil.java:318) 
     at org.web4thejob.context.ORMLauncher.onApplicationEvent(ORMLauncher.java:39) 
     at org.web4thejob.context.ORMLauncher.onApplicationEvent(ORMLauncher.java:31) 
     at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:98) 
     at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:333) 
     at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:776) 
     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:485) 
     at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:381) 
     at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:293) 
     at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106) 
     at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973) 
     at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467) 
     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:632) 
     at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1083) 
     at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1880) 
     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) 
     at java.util.concurrent.FutureTask.run(FutureTask.java:262) 
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
     at java.lang.Thread.run(Thread.java:745) 
Caused by: org.hibernate.exception.GenericJDBCException: Could not open connection 
     at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54) 
     at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126) 
     at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:112) 
     at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:235) 
     at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.getConnection(LogicalConnectionImpl.java:171) 
     at org.hibernate.internal.SessionImpl.connection(SessionImpl.java:446) 
     at org.springframework.orm.hibernate4.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:431) 
     ... 38 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:677) 
     at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128) 
     at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:139) 
     at org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:380) 
     at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:228) 
     ... 41 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:1406) 
     at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:594) 
     at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:514) 
     at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutAndMarkConnectionInUse(C3P0PooledConnectionPool.java:743) 
     at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:670) 
     ... 45 more 
Dec 29, 2015 4:14:37 PM org.zkoss.zk.ui.http.WebManager <init> 
INFO: Starting ZK 7.0.0 CE (build: 2013112611) 
Dec 29, 2015 4:14:37 PM org.zkoss.zk.ui.sys.ConfigParser parseConfigXml 
INFO: Loading system default 
Dec 29, 2015 4:14:37 PM org.zkoss.zk.ui.sys.ConfigParser parse 
INFO: Parsing jar:file:/var/lib/openshift/567a72f30c1e660388000150/jbossews/work/Catalina/localhost/twebapp/WEB-INF/lib/zul-7.0.0.jar!/metainfo/zk/zk.xml 
Dec 29, 2015 4:14:37 PM org.zkoss.zk.ui.sys.ConfigParser parse 
INFO: Parsing jndi:/localhost/twebapp/WEB-INF/zk.xml 
Dec 29, 2015 4:14:40 PM org.apache.catalina.core.StandardContext startInternal 
SEVERE: Error listenerStart 
Dec 29, 2015 4:14:40 PM org.apache.catalina.core.StandardContext startInternal 
SEVERE: Context [/twebapp] startup failed due to previous errors 
INFO XmlWebApplicationContext - Closing Root WebApplicationContext: startup date [Tue Dec 29 16:13:14 EST 2015]; root of context hierarchy 
INFO EhCacheManagerFactoryBean - Shutting down EhCache CacheManager 
Dec 29, 2015 4:14:41 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc 
SEVERE: The web application [/twebapp] 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. 
Dec 29, 2015 4:14:41 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 
SEVERE: The web application [/twebapp] 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. 
Dec 29, 2015 4:14:41 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks 
SEVERE: The web application [/twebapp] created a ThreadLocal with key of type [org.apache.log4j.helpers.ThreadLocalMap] (value [[email protected]]) and a value of type [java.util.Hashtable] (value [{}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. 
Dec 29, 2015 4:14:41 PM org.apache.catalina.startup.HostConfig deployWAR 
INFO: Deployment of web application archive /var/lib/openshift/567a72f30c1e660388000150/app-root/runtime/dependencies/jbossews/webapps/twebapp.war has finished in 114,969 ms 
Dec 29, 2015 4:14:41 PM org.apache.coyote.AbstractProtocol start 
INFO: Starting ProtocolHandler ["http-bio-127.3.4.1-8080"] 
Dec 29, 2015 4:14:41 PM org.apache.catalina.startup.Catalina start 
INFO: Server startup in 115412 ms 
+0

您可以提供關於如何從Tomcat連接到MySQL的信息 - 您是否使用env變量? – TheSteve0

+0

不,我不是。你是對的,那是我錯過的。我從哪說起呢? – Blitris

回答

0

此免費書籍 https://www.openshift.com/promotions/ebook.html

,然後轉到章節將DB連接到您的應用程序。有幾種方法可以獲得它們。我通常SSH進入齒輪,然後在提示類型

env |grep -i mysql 

你應該看到使用的環境變量。

+0

非常感謝!它看起來像環境變量是應該的。你有什麼其他的建議? – Blitris

+0

另外,有時當我使用rhc tail命令時,日誌在mysql處停止。 – Blitris