社区微信群开通啦,扫一扫抢先加入社区官方微信群
社区微信群
解决方法:
file–》other settings–》settings for new project
Maven home directory: 你的maven安装位置
User settings file: maven 安装位置的conf – settings文件位置
Local repository: 中央仓库存储的你所需要的jar包文件
勾选完之后,再创建springboot就不会重新下载Maven了,他只会加载 你本地没有的jar文件
解决方法:
1、在资源配置文件中,修改url
spring.datasource.url=jdbc:mysql://localhost:3306/trainning?characterEncoding=utf-8&&serverTimezone=UTC
server.port = 8889
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/trainning?characterEncoding=utf-8&&serverTimezone=UTC
spring.datasource.username=root
spring.datasource.password=xxxxx
mybatis.mapper-locations=classpath:mapper/*.xml
一、无妨访问
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Wed Apr 29 21:30:08 CST 2020
There was an unexpected error (type=Not Found, status=404).
No message available
解决方法:
查看pom文件中的依赖,
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>
二、templates文件夹下无法创建***.ftl文件
操作步骤:1、file–settings–file type
添加一个*.ftl**的文件格式
解决方法:
打开dos命令窗口(快捷键windows+r)输入cmd
查找已开启的端口号:netstat -ano
之后打开任务管理器,选择详细信息,根据dos窗口的端口号对应的pid找到任务管理器的pid然后将其关闭。问题解决
解决方法:
1、可能是路径的问题,换成绝对路径试一下。
2、配置文件的问题,可以看看自己的配置文件,一定要修改成自己的不要方便,直接copy,会出现问题的
Description:
A component required a bean of type 'com.project01.project01.dao.UserDao' that could not be found.
Action:
Consider defining a bean of type 'com.project01.project01.dao.UserDao' in your configuration.
扫描的时候找不到userdao的接口
解决方法:
方法1、注释掉pom中多余的依赖
方法2、在userdao的接口加一个注解@Mapper
如图所示:
就可以解决这个问题
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!