前提・実現したいこと
Visual studio codeでspring bootを正常に起動させたい。
http://localhost:8080に接続できない。
発生している問題・エラーメッセージ
エラーの原因、内容を調べてもわからない。
[Error - 12:31:58 PM] Connection to server is erroring. Shutting down server. [Error - 12:31:58 PM] Connection to server is erroring. Shutting down server. [Error - 12:31:58 PM] Connection to server is erroring. Shutting down server. [Error - 12:31:58 PM] Connection to server is erroring. Shutting down server. [Error - 12:31:58 PM] Connection to server is erroring. Shutting down server. [Error - 12:31:58 PM] Connection to server is erroring. Shutting down server. [Error - 12:31:58 PM] Connection to server is erroring. Shutting down server. [Error - 12:31:58 PM] Connection to server is erroring. Shutting down server.
実行すると下記ログは出力される。
/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/bin/java -Dfile.encoding=UTF-8 -cp /var/folders/bf/3rntzwys027gfr5wshnwmllh0000gn/T/cp_bmzp9e9hovy7k2ir0mgh4gry7.jar com.example.demo.DemoApplication . ____ _ __ _ _ /\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ / _` | \ \ \ \ \/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.2.6.RELEASE) 2020-04-14 12:51:40.916 INFO 1245 --- [ restartedMain] com.example.demo.DemoApplication : Starting DemoApplication on mbp.local with PID 1245 (/Users/bessho/Documents/Programing/demo/target/classes started by bessho in /Users/bessho/Documents/Programing/demo) 2020-04-14 12:51:40.918 INFO 1245 --- [ restartedMain] com.example.demo.DemoApplication : No active profile set, falling back to default profiles: default 2020-04-14 12:51:40.972 INFO 1245 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable 2020-04-14 12:51:40.972 INFO 1245 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG' 2020-04-14 12:51:41.667 INFO 1245 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) 2020-04-14 12:51:41.677 INFO 1245 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2020-04-14 12:51:41.677 INFO 1245 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.33] 2020-04-14 12:51:41.734 INFO 1245 --- [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2020-04-14 12:51:41.734 INFO 1245 --- [ restartedMain] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 762 ms 2020-04-14 12:51:41.879 INFO 1245 --- [ restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor' 2020-04-14 12:51:41.973 WARN 1245 --- [ restartedMain] ion$DefaultTemplateResolverConfiguration : Cannot find template location: classpath:/templates/ (please add some templates or check your Thymeleaf configuration) 2020-04-14 12:51:42.019 INFO 1245 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729 2020-04-14 12:51:42.062 INFO 1245 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path '' 2020-04-14 12:51:42.065 INFO 1245 --- [ restartedMain] com.example.demo.DemoApplication : Started DemoApplication in 1.396 seconds (JVM running for 1.722) ^C2020-04-14 12:51:48.712 INFO 1245 --- [extShutdownHook] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor'
該当のソースコード
package com.example.demo; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } }
使用環境
OS:Mac
JDK:AdoptOpenJDK 1.8
エディタ:Visual studio code
プロジェクト作成方法
1.Mavenプロジェクト
2.Java
3.spring boot 2.2.6
4.依存にはSprint boot DevTool、loombok、spring web、thymeleaf
回答1件
あなたの回答
tips
プレビュー