首页 > 其他 > 详细

Idea 启动 tomcat 报错

时间:2021-01-19 23:46:53      阅读:82      评论:0      收藏:0      [点我收藏+]

报错为

org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start: org.apache.catalina.LifecycleException: 无法启动组件[StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]

我这边往下翻发现

技术分享图片

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

由于pom.xml中添加了jpa依赖,所以需要加载datasource,手动在application.properties中添加datasouce相关信息即可

例如

#spring.datasource.url=jdbc:mysql://bj-cdb-nivnaury.sql.tencentcdb.com:****/lianmai?autoReconnect=true&useSSL=FALSE
#spring.datasource.username=lyc
#spring.datasource.password=****
#spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
## Specify the DBMS
#spring.jpa.database = MYSQL
## Show or not log for each sql query
#spring.jpa.show-sql = true
## Hibernate ddl auto (create, create-drop, update)
#spring.jpa.hibernate.ddl-auto = update
## Naming strategy
#spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy
## stripped before adding them to the entity manager)
#spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect

再次启动tomcat,正常启动

Idea 启动 tomcat 报错

原文:https://www.cnblogs.com/YC-L/p/14300231.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!