我的Web應用程序上運行localhost.but以及不斷變化的本地主機後XX.X.XX.X即泊塢窗的IP在hibernate.properties我獲得以下錯誤錯誤org.hibernate.util.JDBCExceptionReporter - 無法創建PoolableConnectionFactory
AbandonedObjectPool用於
([email protected])
LogAbandoned:真
RemoveAbandoned:真
RemoveAbandonedTimeout:90
進入後XX.X.XX.X:1112 /學生登錄頁面或主頁來,但登錄後我得到的命令提示符下面的錯誤(從我開始的tomcat)
57521 [HTTP-APR-8080 -exec-11]錯誤org.hibernate.util.JDBCExceptionReporter - 無法創建PoolableConnectionFactory
57522 [HTTP-APR-8080-EXEC-11] ERROR org.hibernate.util.JDBCExceptionReporter - 無法創建PoolableConnectionFactory
命令使用啓動tomcat服務器是docker run -it --rm -p 7008:8080 -v //d/docker_tomcat/tomcat-users.xml:/usr/local/tomcat/conf/tomcat-users.xml:ro - v // d/docker_tomcat/webapps:/ usr/local/tomcat/webapps:rw tomcat:7.0
我相信在上面的命令中沒有問題。
這裏是我的hibernate.properties文件: -
hibernate.dialect=org.hibernate.dialect.MySQLDialect
hibernate.connection.driver_class=com.mysql.jdbc.Driver
hibernate.connection.username=root
hibernate.connection.password=root
hibernate.connection.url=jdbc:mysql://<ip of docker>:3306/studentdb?autoreconnect=true&zeroDateTimeBehavior=convertToNull&jdbcCompliantTruncation=false
show_sql=false
hibernate.jdbc.use_streams_for_binary=false
hibernate.dbcp.testOnBorrow=true
hibernate.dbcp.validationQuery=SELECT 1 FROM DUAL
hibernate.dbcp.testOnReturn=false
hibernate.dbcp.maxWait=2000
hibernate.dbcp.testWhileIdle=true
hibernate.dbcp.minEvictableIdleTimeMillis=1800000
hibernate.dbcp.timeBetweenEvictionRunsMillis=300000
hibernate.dbcp.numTestsPerEvictionRun=5
hibernate.dbcp.removeAbandoned=true
hibernate.dbcp.removeAbandonedTimeout=90
hibernate.dbcp.logAbandoned=true