java - 由于 LSP 导致的 Spring Boot 问题(无法从进程中刷新实时数据......)
问题描述
我刚开始使用spring boot。我新创建的项目无法成功运行。我想用“作为 Spring Boot App 运行”来运行 Spring Boot 应用程序,但我遇到了与 @Vinay Vaishnav 相同的错误。我已经尝试了回复中涵盖的所有内容。
我的第一个错误是:无法从进程中刷新实时数据...
之后,我在 pom.xml 中包含以下依赖项:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
由于增加了依赖,错误消失了,但是我得到了 404
我还在 applicationProperties 中添加了 livereload devtools。是否添加此行无关紧要。
这是我现在的代码:
AppConfiguration.java:
package com.example.demo;
import org.springframework.web.bind.annotation.RequestMapping;
public class AppConfiguration {
@RequestMapping("/hello")
public String hello() {
return "Hello World";
}
}
应用程序属性:
spring.devtools.livereload.enabled=true
server.port=8081
HelloWorldApplication.java:
package com.example.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RestController;
@RestController
@SpringBootApplication
public class HelloWorldApplication {
public static void main(String[] args) {
SpringApplication.run(HelloWorldApplication.class, args);
}
}
我的版本:
- 阿帕奇 Maven 3.6.3
- 春季启动 2.2.6
- JDK 13.0.2
解决方案
推荐阅读
- python-3.x - 在不同的目录中运行 python 文件
- excel - 将小数四舍五入为整数
- amazon-web-services - 如何向 Amazon.EC2.Model.AddPrefixListEntry 添加多个条目?
- flutter - Flutter sqflite中的where子句
- youtube-analytics-api - 为什么subscribersGained -subscribersLost 与我当前的订阅人数不同?
- javascript - 将 HTML 项动态添加到上一项的右侧而不是下方
- laravel - 尝试链接我的按钮时未定义 Laravel 路由
- r - map_dfr to bind_rows 全局环境中的所有数据框
- c# - 使用 Installer Project 创建 MSI,安装项目后软件无法启动
- c++ - 推回二维向量的数据