classloader - Tomcat Unable to create initial connections of pool -
so have web app deploy / redeploy on remote tomcat server instance. sometimes, deploy , redeploy (by redeploy mean moving root.war through sftp , leave tomcat redeploy it) work expected, no issues whatsoever database connection. unfortunately, other times, after redeploy, refuses connect database, apparently doesn't recognize mysql driver anymore. mysql connector lib inside tomcat's lib folder, not package war.
pom.xml:
<dependency> <groupid>mysql</groupid> <artifactid>mysql-connector-java</artifactid> <version>5.1.36</version> <scope>provided</scope> </dependency> webapp/web-inf/web.xml:
<resource-ref> <description>app mysql</description> <res-ref-name>jdbc/app_mysql</res-ref-name> <res-type>javax.sql.datasource</res-type> <res-auth>container</res-auth> </resource-ref> webapp/meta-inf/context.xml:
<context> <watchedresource>web-inf/web.xml</watchedresource> <resourcelink name="jdbc/app_mysql" global="jdbc/app_mysql" type="javax.sql.datasource"/> </context> var/lib/tomcat7/conf:
<globalnamingresources> <resource name="jdbc/app_mysql" auth="container" type="javax.sql.datasource" username="root" password="root_password" driverclassname="com.mysql.jdbc.driver" description="app database" url="jdbc:mysql://localhost:3306/" maxactive="15" maxidle="3"/> </globalnamingresources> full error below:
severe: unable create initial connections of pool. java.sql.sqlexception @ org.apache.tomcat.jdbc.pool.pooledconnection.connectusingdriver(pooledconnection.java:254)
Comments
Post a Comment