eclipse中SpringBoot访问页面报错Description:The Tomcat connector configured to listen on port 8080 failed to start. The port may already be in use or the connector may be misconfigured.

问题描述

controller代码片段

package com.bjpowernode.springboot.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller

public class HelloController {

@RequestMapping("/boot/hello")
public  @ResponseBody String hello()	
{
	return "hello spring boot";
}

}

application代码片段

package com.bjpowernode.springboot;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class SpringbootlearningApplication {

public static void main(String[] args) {
	SpringApplication.run(SpringbootlearningApplication.class, args);
}

}
运行提示:
springboot学习系列问题:Tomcat启动报错
浏览器输入localhost:8080/boot/hello显示错误:This application has no explicit mapping for /error…

问题思考

端口被占用;application启动类未放置在最外层

解决方法

查看任务管理器,关掉其他正在运行的eclipse程序

相关文章:

  • 2021-07-11
  • 2021-06-11
  • 2021-08-06
  • 2022-01-13
  • 2022-12-23
  • 2021-04-20
  • 2022-12-23
猜你喜欢
  • 2021-07-05
  • 2022-12-23
  • 2021-08-11
  • 2022-02-19
  • 2021-07-20
  • 2021-08-02
  • 2021-06-15
相关资源
相似解决方案