gpt4 book ai didi

java - Spring Boot 引用指南 - 从 app.groovy 示例中获取 404

转载 作者:太空宇宙 更新时间:2023-11-04 11:18:07 24 4
gpt4 key购买 nike

我关注Spring Boot Reference Guide并收到此错误

HTTP Status [404] – [Not Found]
Type Status Report
Message /
Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

这是代码

@RestController
class ThisWillActuallyRun {
@RequestMapping("/")
String home() {
"Hello World!"
}
}

我运行的命令。

spring run app.groovy

我得到的控制台日志。

  .   ____          _            __ _ _ /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/  ___)| |_)| | | | | || (_| |  ) ) ) )  '  |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot ::        (v1.5.4.RELEASE)2017-07-21 14:37:37.474  INFO 47637 --- [       runner-0] o.s.boot.SpringApplication               : Starting application on MacBook-Pro-2016.local with PID 47637 (started by moss in /Users/moss/java_ws/hello)2017-07-21 14:37:37.477  INFO 47637 --- [       runner-0] o.s.boot.SpringApplication               : No active profile set, falling back to default profiles: default2017-07-21 14:37:37.659  INFO 47637 --- [       runner-0] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@3a0184b7: startup date [Fri Jul 21 14:37:37 ICT 2017]; root of context hierarchy2017-07-21 14:37:38.831  INFO 47637 --- [       runner-0] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8080 (http)2017-07-21 14:37:38.844  INFO 47637 --- [       runner-0] o.apache.catalina.core.StandardService   : Starting service [Tomcat]2017-07-21 14:37:38.846  INFO 47637 --- [       runner-0] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/8.5.152017-07-21 14:37:38.923  INFO 47637 --- [ost-startStop-1] org.apache.catalina.loader.WebappLoader  : Unknown loader org.springframework.boot.cli.compiler.ExtendedGroovyClassLoader$DefaultScopeParentClassLoader@c0454ed class org.springframework.boot.cli.compiler.ExtendedGroovyClassLoader$DefaultScopeParentClassLoader2017-07-21 14:37:38.950  INFO 47637 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext2017-07-21 14:37:38.951  INFO 47637 --- [ost-startStop-1] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 1296 ms2017-07-21 14:37:39.020  INFO 47637 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'characterEncodingFilter' to: [/*]2017-07-21 14:37:39.605  INFO 47637 --- [       runner-0] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup2017-07-21 14:37:39.674  INFO 47637 --- [       runner-0] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)2017-07-21 14:37:39.678  INFO 47637 --- [       runner-0] o.s.boot.SpringApplication               : Started application in 12.556 seconds (JVM running for 14.572)

我做错了什么吗?

最佳答案

我只是使用 sdkman 切换回 Spring CLI v1.5.3.RELEASE 就可以了。

关于java - Spring Boot 引用指南 - 从 app.groovy 示例中获取 404,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45232100/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com