The infamous java.sql.SQLException: No suitable driver found

前端 未结 16 1562
广开言路
广开言路 2020-11-21 05:10

I\'m trying to add a database-enabled JSP to an existing Tomcat 5.5 application (GeoServer 2.0.0, if that helps).

The app itself talks to Postgres just fine, so I kn

16条回答
  •  -上瘾入骨i
    2020-11-21 05:22

    I was having the same issue with mysql datasource using spring data that would work outside but gave me this error when deployed on tomcat.

    The error went away when I added the driver jar mysql-connector-java-8.0.16.jar to the jres lib/ext folder

    However I did not want to do this in production for fear of interfering with other applications. Explicity defining the driver class solved this issue for me

        spring.datasource.driver-class-name: com.mysql.cj.jdbc.Driver
    

提交回复
热议问题