搭建springboot项目能启动,但是访问controller时报错404

1.创建项目能启动,但是访问时报错404
我们发现他们两个在同级包下,也就是在启动类和controller不同级的目录下:搭建springboot项目能启动,但是访问controller时报错404
报错信息
搭建springboot项目能启动,但是访问controller时报错404
这里就要说一下springboot默认的扫描位置了
@SpringBootApplication默认的扫描位置就是启动类所在的同级目录和子目录,我们修改一下搭建springboot项目能启动,但是访问controller时报错404
这时候我们再看运行
搭建springboot项目能启动,但是访问controller时报错404
创建springboot项目建议使用工具:
1.开发工具:STS,IDEA (不建议使用eclipse)

启动服务报错The port may already be in use or the connector may be misconfigured.

1.进入cmd 输入(8761是启动服务时被禁止的端口)

netstat -ano|findstr 8761

2.查到端口号对应的进程号。输入

taskkill /f /t /im 进程号