当我使用MySql数据库将Spring-Boot应用程序部署到AWS EC2时遇到此错误。我已经将数据库上传到具有ec2-54-169-121-181.ap-southeast-1.compute.amazonaws.com的公共DNS的服务器上。 我得到的错误是:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating
bean with name
'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration':
Unsatisfied dependency expressed through constructor parameter 0; nested exception
is org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'dataSource' defined in class path resource
[org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]:
Bean instantiation via factory method
failed; nested exception is org.springframework.beans.BeanInstantiationException:
Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method
'dataSource' threw exception; nested exception is
org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCrea
tionException:
Failed to determine a suitable driver class
## Spring DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties)
spring.datasource.url = jdbc:mysql://ec2-54-169-121-181.ap-southeast-1.compute.amazonaws.com:3306/notes_app
spring.datasource.username = root
spring.datasource.password = root
## Hibernate Properties
# The SQL dialect makes Hibernate generate better SQL for the chosen database
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
# Hibernate ddl auto (create, create-drop, validate, update)
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
我一直在尝试许多在线解决方案,但没有找到任何帮助。