maven - Spring Boot w/o starter-parent pom not loading jdbc driver -
i have spring-boot server working using 'starter-parent' pom. problem i'd rather not use spring pom parent if @ possible. when include spring-boot-dependencies pom though (as described here), end driver not being loaded:
18:14:26.127 [localhost-startstop-1] warn o.a.t.jdbc.pool.pooledconnection - not loading jdbc driver driverclassname property null. 18:14:26.147 [localhost-startstop-1] error o.a.tomcat.jdbc.pool.connectionpool - unable create initial connections of pool. java.sql.sqlexception: no suitable driver found jdbc:mysql://localhost/mydb @ java.sql.drivermanager.getconnection(drivermanager.java:689) ~[na:1.8.0_45] @ java.sql.drivermanager.getconnection(drivermanager.java:208) ~[na:1.8.0_45] @ org.apache.tomcat.jdbc.pool.pooledconnection.connectusingdriver(pooledconnection.java:305) ~[tomcat-jdbc-8.0.23.jar:na] @ org.apache.tomcat.jdbc.pool.pooledconnection.connect(pooledconnection.java:200) ~[tomcat-jdbc-8.0.23.jar:na] ...
i'm pretty sure has driver not being loaded drivermanager & serviceloader bits, i'm not sure how force happen. suggestions appreciated.
fwiw: if try 'class.forname()' mysql jdbc driver end 'noclassdeffounderror', puzzling because mysql-connector in pom. multiple class loaders or something?
i believe issue related how maven importing vs. inheriting dependencies, provided company's parent pom , coming spring-boot. can't explain it, if comment out dependency management section of our parent pom seems work correctly. kind of mystical maven behavior, i'm working on separating dependency management , plugin configuration aspects of our parent pom. way can inherit plugin config, , not dependency management.
thanks :)
Comments
Post a Comment