汤圆拌饺子
2021-08-02 23:40
采纳率: 50%
浏览 44
已结题

#学习笔记:springboot集成JSP模板时要访问到jsp,通过引入spring-boot-maven-plugin插件,通过run启动应用报以下错误

run指令:启动后报以下错误:
Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.5.3:run (default-cli) on project springboot_2: Application finished with exit code: 1【无法在项目springboot_2:应用程序上执行目标org.springframework.boot:spring boot maven插件:2.5.3:run(默认cli),退出代码:1】
run执行代码:

"C:\Program Files\Java\jdk1.8.0_181\bin\java.exe" -Dmaven.multiModuleProjectDirectory=C:\IDEA_Project\springboot_2 -DarchetypeCatalog=internal "-Dmaven.home=C:\Program Files\apache-maven-3.6.3" "-Dclassworlds.conf=C:\Program Files\apache-maven-3.6.3\bin\m2.conf" "-Dmaven.ext.class.path=C:\Program Files\JetBrains\IntelliJ IDEA 2020.3\plugins\maven\lib\maven-event-listener.jar" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2020.3\lib\idea_rt.jar=20404:C:\Program Files\JetBrains\IntelliJ IDEA 2020.3\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\apache-maven-3.6.3\boot\plexus-classworlds-2.6.0.jar;C:\Program Files\apache-maven-3.6.3\boot\plexus-classworlds.license" org.codehaus.classworlds.Launcher -Didea.version=2020.3 -s "C:\Program Files\apache-maven-3.6.3\conf\settings.xml" -Dmaven.repo.local=C:\Users\阿拉\.m2\repository org.springframework.boot:spring-boot-maven-plugin:2.5.3:run
[INFO] Scanning for projects...
[INFO] 
[INFO] -----------------------< com.bdqn:springboot_2 >------------------------
[INFO] Building springboot_2 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] >>> spring-boot-maven-plugin:2.5.3:run (default-cli) > test-compile @ springboot_2 >>>
[INFO] 
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ springboot_2 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ springboot_2 ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ springboot_2 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory C:\IDEA_Project\springboot_2\src\test\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ springboot_2 ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] <<< spring-boot-maven-plugin:2.5.3:run (default-cli) < test-compile @ springboot_2 <<<
[INFO] 
[INFO] 
[INFO] --- spring-boot-maven-plugin:2.5.3:run (default-cli) @ springboot_2 ---
[INFO] Attaching agents: []

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v2.5.3)

2021-08-02 23:14:25.178  INFO 14424 --- [           main] com.bdqn.Springboot2Application          : Starting Springboot2Application using Java 1.8.0_181 on LAPTOP-SVSAV6NH with PID 14424 (C:\IDEA_Project\springboot_2\target\classes started by ���� in C:\IDEA_Project\springboot_2)
2021-08-02 23:14:25.181  INFO 14424 --- [           main] com.bdqn.Springboot2Application          : No active profile set, falling back to default profiles: default
2021-08-02 23:14:26.041  INFO 14424 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8081 (http)
2021-08-02 23:14:26.055  INFO 14424 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2021-08-02 23:14:26.056  INFO 14424 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.50]
2021-08-02 23:14:26.221  INFO 14424 --- [           main] org.apache.jasper.servlet.TldScanner     : At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
2021-08-02 23:14:26.226  INFO 14424 --- [           main] o.a.c.c.C.[.[localhost].[/springboot_2]  : Initializing Spring embedded WebApplicationContext
2021-08-02 23:14:26.226  INFO 14424 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1012 ms
2021-08-02 23:14:26.419  INFO 14424 --- [           main] o.s.b.a.w.s.WelcomePageHandlerMapping    : Adding welcome page template: index
2021-08-02 23:14:26.471  WARN 14424 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'; nested exception is org.springframework.boot.web.server.PortInUseException: Port 8081 is already in use
2021-08-02 23:14:26.474  INFO 14424 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2021-08-02 23:14:26.491  INFO 14424 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-08-02 23:14:26.500 ERROR 14424 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Web server failed to start. Port 8081 was already in use.

Action:

Identify and stop the process that's listening on port 8081 or configure this application to listen on another port.

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  10.835 s
[INFO] Finished at: 2021-08-02T23:14:26+08:00
[INFO] ------------------------------------------------------------------------
**[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.5.3:run (default-cli) on project springboot_2: Application finished with exit code: 1 -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 

[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

进程已结束,退出代码为 1**

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 收藏
  • 邀请回答

3条回答 默认 最新

  • CSDN专家-微编程 2021-08-03 05:50
    已采纳

    如果你是这个错误,则该项目正在运行,你再次运行冲突了。
    img
    解决办法就是 停掉服务,再次点击启动类里面运行run即可
    img

    评论
    解决 无用
    打赏 举报
  • 查看更多回答(2条)

相关推荐 更多相似问题