我在控制台中打印了这种错误

时间:2019-03-14 09:27:33

标签: spring-boot console

我从昨天开始尝试解决此问题,但未能解决。请帮我解决。 我该如何解决? 我正在尝试部署我的第一个springboot Web应用程序

你期望什么 我在控制台中出错。 我从各个方面尝试了整个应用程序。 我认为这是服务器问题

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

    2019-03-14 14:22:33.105  INFO 4640 --- [  restartedMain] 
    com.application.StudentApplication       : Starting StudentApplication on A- 
    PC with PID 4640 
    (C:\Users\A\Desktop\sushovan_java\apringhibernatejpademo\target\classes 
    started by A in C:\Users\A\Desktop\sushovan_java\apringhibernatejpademo)
    2019-03-14 14:22:33.115  INFO 4640 --- [  restartedMain] 
    com.application.StudentApplication       : No active profile set, falling 
    back to default profiles: default
    2019-03-14 14:22:33.246  INFO 4640 --- [  restartedMain] 
    .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults 
    active! Set 'spring.devtools.add-properties' to 'false' to disable
2019-03-14 14:22:33.246  INFO 4640 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2019-03-14 14:22:35.509  INFO 4640 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
2019-03-14 14:22:35.549  INFO 4640 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 26ms. Found 0 repository interfaces.
2019-03-14 14:22:36.717  INFO 4640 --- [  restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$6f75cc55] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-03-14 14:22:37.776  INFO 4640 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2019-03-14 14:22:37.846  INFO 4640 --- [  restartedMain] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2019-03-14 14:22:37.853  INFO 4640 --- [  restartedMain] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.16]
2019-03-14 14:22:37.878  INFO 4640 --- [  restartedMain] o.a.catalina.core.AprLifecycleListener   : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\JAVA\jre1.8.0_202\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.8.0_202/bin/server;C:/Program Files/Java/jre1.8.0_202/bin;C:/Program Files/Java/jre1.8.0_202/lib/amd64;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\eclipse;;.]
2019-03-14 14:22:38.553  INFO 4640 --- [  restartedMain] 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.
2019-03-14 14:22:38.565  INFO 4640 --- [  restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2019-03-14 14:22:38.567  INFO 4640 --- [  restartedMain] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 5320 ms
2019-03-14 14:22:39.148  INFO 4640 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2019-03-14 14:22:39.529  INFO 4640 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
2019-03-14 14:22:39.668  INFO 4640 --- [  restartedMain] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [
    name: default
    ...]
2019-03-14 14:22:39.834  INFO 4640 --- [  restartedMain] org.hibernate.Version                    : HHH000412: Hibernate Core {5.3.7.Final}
2019-03-14 14:22:39.837  INFO 4640 --- [  restartedMain] org.hibernate.cfg.Environment            : HHH000206: hibernate.properties not found
2019-03-14 14:22:40.215  INFO 4640 --- [  restartedMain] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.0.4.Final}
2019-03-14 14:22:40.524  INFO 4640 --- [  restartedMain] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect
2019-03-14 14:22:41.156  INFO 4640 --- [  restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2019-03-14 14:22:41.200  INFO 4640 --- [  restartedMain] o.s.b.d.a.OptionalLiveReloadServer       : LiveReload server is running on port 35729
2019-03-14 14:22:41.812  INFO 4640 --- [  restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2019-03-14 14:22:41.933  WARN 4640 --- [  restartedMain] aWebConfiguration$JpaWebMvcConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2019-03-14 14:22:42.154  WARN 4640 --- [  restartedMain] ion$DefaultTemplateResolverConfiguration : Cannot find template location: classpath:/templates/ (please add some templates or check your Thymeleaf configuration)
2019-03-14 14:22:42.698 ERROR 4640 --- [  restartedMain] org.apache.catalina.util.LifecycleBase   : Failed to start component [Connector[HTTP/1.1-8080]]

org.apache.catalina.LifecycleException: Protocol handler start failed
    at org.apache.catalina.connector.Connector.startInternal(Connector.java:1008) ~[catalina.jar:9.0.16]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[catalina.jar:9.0.16]
    at org.apache.catalina.core.StandardService.addConnector(StandardService.java:226) [catalina.jar:9.0.16]
    at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.addPreviouslyRemovedConnectors(TomcatWebServer.java:259) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
    at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:197) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.startWebServer(ServletWebServerApplicationContext.java:311) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:164) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552) [spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
    at com.application.StudentApplication.main(StudentApplication.java:13) [classes/:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_202]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_202]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_202]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_202]
    at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-2.1.3.RELEASE.jar:2.1.3.RELEASE]
Caused by: java.net.BindException: Address already in use: bind
    at sun.nio.ch.Net.bind0(Native Method) ~[na:1.8.0_202]
    at sun.nio.ch.Net.bind(Unknown Source) ~[na:1.8.0_202]
    at sun.nio.ch.Net.bind(Unknown Source) ~[na:1.8.0_202]
    at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source) ~[na:1.8.0_202]
    at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source) ~[na:1.8.0_202]
    at org.apache.tomcat.util.net.NioEndpoint.initServerSocket(NioEndpoint.java:236) ~[tomcat-coyote.jar:9.0.16]
    at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:210) ~[tomcat-coyote.jar:9.0.16]
    at org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1085) ~[tomcat-coyote.jar:9.0.16]
    at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:1171) ~[tomcat-coyote.jar:9.0.16]
    at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:568) ~[tomcat-coyote.jar:9.0.16]
    at org.apache.catalina.connector.Connector.startInternal(Connector.java:1005) ~[catalina.jar:9.0.16]
    ... 19 common frames omitted

2019-03-14 14:22:42.723  INFO 4640 --- [  restartedMain] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2019-03-14 14:22:42.747  INFO 4640 --- [  restartedMain] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-03-14 14:22:42.751 ERROR 4640 --- [  restartedMain] o.s.b.d.LoggingFailureAnalysisReporter   : 

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

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.

Action:

Verify the connector's configuration, identify and stop any process that's listening on port 8080, or configure this application to listen on another port.

2019-03-14 14:22:42.762  INFO 4640 --- [  restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor  : Shutting down ExecutorService 'applicationTaskExecutor'
2019-03-14 14:22:42.766  INFO 4640 --- [  restartedMain] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2019-03-14 14:22:42.771  INFO 4640 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
2019-03-14 14:22:42.789  INFO 4640 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.

3 个答案:

答案 0 :(得分:0)

根据您的异常堆栈跟踪,

Caused by: java.net.BindException: Address already in use: bind

机器上的端口8080已被另一个进程使用。

解决方案

  • 您需要为应用程序使用另一个端口
  • 您可以找到其他进程并停止它

答案 1 :(得分:0)

  

解决方案:1设置没有正在运行的进程的端口。

为您的application.properties设置不同的端口

server.port=8088

  

解决方案2:终止特定端口上的进程

  1. 使用端口8080查找进程

  2. 使用进程ID终止进程 您可以在最右侧看到PID。在这里12345


netstat -ano | findstr :8080
taskkill /PID 12345 /F

答案 2 :(得分:0)

8080端口已被其他进程使用。

  1. 转到资源监视器。请找到屏幕截图,您可以找到使用此端口的进程。
  2. 或使用server.port = 7788更改/ src / main / resources /中application.properties中的端口

enter image description here