休言女子非英物,夜夜龙泉壁上鸣。这篇文章主要讲述运行Spring Boot APP时出现Spring Boot问题相关的知识,希望能为你提供帮助。
我正在尝试运行我的春季启动应用程序。这次我收到错误,如下所示:
._______ _ _
/ / ___'_ __ _ _(_)_ ____ _
( ( )\___ | '_ | '_| | '_ / _` |
/___)| |_)| | | | | || (_| |) ) ) )
'|____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
[32m :: Spring Boot :: [39m[2m (v1.3.3.RELEASE)[0;
39m[2m2016-04-13 19:56:36.427[0;
39m [32m INFO[0;
39m [35m4756[0;
39m [2m---[0;
39m [2m[main][0;
39m [36mcom.example.SampleApplication[0;
39m [2m:[0;
39m Starting SampleApplication on kasi-PC with PID 4756 (E:WSSample argetclasses started by kasi in E:WSSample)
[2m2016-04-13 19:56:36.429[0;
39m [32m INFO[0;
39m [35m4756[0;
39m [2m---[0;
39m [2m[main][0;
39m [36mcom.example.SampleApplication[0;
39m [2m:[0;
39m No active profile set, falling back to default profiles: default
[2m2016-04-13 19:56:36.505[0;
39m [32m INFO[0;
39m [35m4756[0;
39m [2m---[0;
39m [2m[main][0;
39m [36mationConfigEmbeddedWebApplicationContext[0;
39m [2m:[0;
39m Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@10b48321: startup date [Wed Apr 13 19:56:36 IST 2016];
root of context hierarchy
[2m2016-04-13 19:56:37.313[0;
39m [32m INFO[0;
39m [35m4756[0;
39m [2m---[0;
39m [2m[main][0;
39m [36mo.s.b.f.s.DefaultListableBeanFactory[0;
39m [2m:[0;
39m Overriding bean definition for bean 'beanNameViewResolver' with a different definition: replacing [Root bean: class [null];
scope=;
abstract=false;
lazyInit=false;
autowireMode=3;
dependencyCheck=0;
autowireCandidate=true;
primary=false;
factoryBeanName=org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration;
factoryMethodName=beanNameViewResolver;
initMethodName=null;
destroyMethodName=(inferred);
defined in class path resource [org/springframework/boot/autoconfigure/web/ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration.class]] with [Root bean: class [null];
scope=;
abstract=false;
lazyInit=false;
autowireMode=3;
dependencyCheck=0;
autowireCandidate=true;
primary=false;
factoryBeanName=org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter;
factoryMethodName=beanNameViewResolver;
initMethodName=null;
destroyMethodName=(inferred);
defined in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.class]]
[2m2016-04-13 19:56:38.100[0;
39m [32m INFO[0;
39m [35m4756[0;
39m [2m---[0;
39m [2m[main][0;
39m [36ms.b.c.e.t.TomcatEmbeddedServletContainer[0;
39m [2m:[0;
39m Tomcat initialized with port(s): 8080 (http)
[2m2016-04-13 19:56:38.118[0;
39m [32m INFO[0;
39m [35m4756[0;
39m [2m---[0;
39m [2m[main][0;
39m [36mo.apache.catalina.core.StandardService[0;
39m [2m:[0;
39m Starting service Tomcat
[2m2016-04-13 19:56:38.120[0;
39m [32m INFO[0;
39m [35m4756[0;
39m [2m---[0;
39m [2m[main][0;
39m [36morg.apache.catalina.core.StandardEngine [0;
39m [2m:[0;
39m Starting Servlet Engine: Apache Tomcat/8.0.32
[2m2016-04-13 19:56:38.280[0;
39m [32m INFO[0;
39m [35m4756[0;
39m [2m---[0;
39m [2m[ost-startStop-1][0;
39m [36mo.a.c.c.C.[Tomcat].[localhost].[/][0;
39m [2m:[0;
39m Initializing Spring embedded WebApplicationContext
[2m2016-04-13 19:56:38.280[0;
39m [32m INFO[0;
39m [35m4756[0;
39m [2m---[0;
39m [2m[ost-startStop-1][0;
39m [36mo.s.web.context.ContextLoader[0;
39m [2m:[0;
39m Root WebApplicationContext: initialization completed in 1779 ms
[2m2016-04-13 19:56:38.677[0;
39m [32m INFO[0;
39m [35m4756[0;
39m [2m---[0;
39m [2m[ost-startStop-1][0;
39m [36mo.s.b.c.e.ServletRegistrationBean[0;
39m [2m:[0;
39m Mapping servlet: 'dispatcherServlet' to [/]
[2m2016-04-13 19:56:38.682[0;
39m [32m INFO[0;
39m [35m4756[0;
39m [2m---[0;
39m [2m[ost-startStop-1][0;
39m [36mo.s.b.c.embedded.FilterRegistrationBean [0;
39m [2m:[0;
39m Mapping filter: 'characterEncodingFilter' to: [/*]
[2m2016-04-13 19:56:38.683[0;
39m [32m INFO[0;
39m [35m4756[0;
39m [2m---[0;
39m [2m[ost-startStop-1][0;
39m [36mo.s.b.c.embedded.FilterRegistrationBean [0;
39m [2m:[0;
39m Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
[2m2016-04-13 19:56:38.683[0;
39m [32m INFO[0;
39m [35m4756[0;
39m [2m---[0;
39m [2m[ost-startStop-1][0;
39m [36mo.s.b.c.embedded.FilterRegistrationBean [0;
39m [2m:[0;
39m Mapping filter: 'httpPutFormContentFilter' to: [/*]
[2m2016-04-13 19:56:38.683[0;
39m [32m INFO[0;
39m [35m4756[0;
39m [2m---[0;
39m [2m[ost-startStop-1][0;
39m [36mo.s.b.c.embedded.FilterRegistrationBean [0;
39m [2m:[0;
39m Mapping filter: 'requestContextFilter' to: [/*]
[2m2016-04-13 19:56:39.030[0;
39m [32m INFO[0;
39m [35m4756[0;
39m [2m---[0;
39m [2m[main][0;
39m [36ms.w.s.m.m.a.RequestMappingHandlerAdapter[0;
39m [2m:[0;
39m Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@10b48321: startup date [Wed Apr 13 19:56:36 IST 2016];
root of context hierarchy
[2m2016-04-13 19:56:39.107[0;
39m [32m INFO[0;
39m [35m4756[0;
39m [2m---[0;
39m [2m[main][0;
39m [36ms.w.s.m.m.a.RequestMappingHandlerMapping[0;
39m [2m:[0;
39m Mapped "{[/get]}" onto java.lang.String com.example.SampleApplication.get()
[2m2016-04-13 19:56:39.110[0;
39m [32m INFO[0;
39m [35m4756[0;
39m [2m---[0;
39m [2m[main][0;
39m [36ms.w.s.m.m.a.RequestMappingHandlerMapping[0;
39m [2m:[0;
39m Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<
java.util.Map<
java.lang.String, java.lang.Object>
>
org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
[2m2016-04-13 19:56:39.111[0;
39m [32m INFO[0;
39m [35m4756[0;
39m [2m---[0;
39m [2m[main][0;
39m [36ms.w.s.m.m.a.RequestMappingHandlerMapping[0;
39m [2m:[0;
39m Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
[2m2016-04-13 19:56:39.142[0;
39m [32m INFO[0;
39m [35m4756[0;
39m [2m---[0;
39m [2m[main][0;
39m [36mo.s.w.s.handler.SimpleUrlHandlerMapping [0;
39m [2m:[0;
39m Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
[2m2016-04-13 19:56:39.142[0;
39m [32m INFO[0;
39m [35m4756[0;
39m [2m---[0;
39m [2m[main][0;
39m [36mo.s.w.s.handler.SimpleUrlHandlerMapping [0;
39m [2m:[0;
39m Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
[2m2016-04-13 19:56:39.193[0;
39m [32m INFO[0;
39m [35m4756[0;
39m [2m---[0;
39m [2m[main][0;
39m [36mo.s.w.s.handler.SimpleUrlHandlerMapping [0;
39m [2m:[0;
39m Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
[2m2016-04-13 19:56:39.322[0;
39m [32m INFO[0;
39m [35m4756[0;
39m [2m---[0;
39m [2m[main][0;
39m [36mo.s.j.e.a.AnnotationMBeanExporter[0;
39m [2m:[0;
39m Registering beans for JMX exposure on startup
[2m2016-04-13 19:56:39.383[0;
39m [31mERROR[0;
39m [35m4756[0;
39m [2m---[0;
39m [2m[main][0;
39m [36mo.a.coyote.http11.Http11NioProtocol[0;
39m [2m:[0;
39m Failed to start end point associated with ProtocolHandler ["http-nio-8080"]java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind0(Native Method) ~[na:1.8.0_77]
at sun.nio.ch.Net.bind(Unknown Source) ~[na:1.8.0_77]
at sun.nio.ch.Net.bind(Unknown Source) ~[na:1.8.0_77]
at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source) ~[na:1.8.0_77]
at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source) ~[na:1.8.0_77]
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:340) ~[tomcat-embed-core-8.0.32.jar:8.0.32]
at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:765) ~[tomcat-embed-core-8.0.32.jar:8.0.32]
at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:473) ~[tomcat-embed-core-8.0.32.jar:8.0.32]
at org.apache.catalina.connector.Connector.startInternal(Connector.java:986) [tomcat-embed-core-8.0.32.jar:8.0.32]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) [tomcat-embed-core-8.0.32.jar:8.0.32]
at org.apache.catalina.core.StandardService.addConnector(StandardService.java:239) [tomcat-embed-core-8.0.32.jar:8.0.32]
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.addPreviouslyRemovedConnectors(TomcatEmbeddedServletContainer.java:194) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:151) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:293) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:141) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541) [spring-context-4.2.5.RELEASE.jar:4.2.5.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at com.example.SampleApplication.main(SampleApplication.java:20) [classes/:na][2m2016-04-13 19:56:39.385[0;
39m [31mERROR[0;
39m [35m4756[0;
39m [2m---[0;
39m [2m[main][0;
39m [36mo.apache.catalina.core.StandardService[0;
39m [2m:[0;
39m Failed to start connector [Connector[HTTP/1.1-8080]]org.apache.catalina.LifecycleException: Failed to start component [Connector[HTTP/1.1-8080]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153) ~[tomcat-embed-core-8.0.32.jar:8.0.32]
at org.apache.catalina.core.StandardService.addConnector(StandardService.java:239) ~[tomcat-embed-core-8.0.32.jar:8.0.32]
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.addPreviouslyRemovedConnectors(TomcatEmbeddedServletContainer.java:194) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:151) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:293) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:141) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541) [spring-context-4.2.5.RELEASE.jar:4.2.5.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at com.example.SampleApplication.main(SampleApplication.java:20) [classes/:na]
Caused by: org.apache.catalina.LifecycleException: service.getName(): "Tomcat";
Protocol handler start failed
at org.apache.catalina.connector.Connector.startInternal(Connector.java:993) ~[tomcat-embed-core-8.0.32.jar:8.0.32]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) ~[tomcat-embed-core-8.0.32.jar:8.0.32]
... 13 common frames omitted
Caused by: java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind0(Native Method) ~[na:1.8.0_77]
at sun.nio.ch.Net.bind(Unknown Source) ~[na:1.8.0_77]
at sun.nio.ch.Net.bind(Unknown Source) ~[na:1.8.0_77]
at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source) ~[na:1.8.0_77]
at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source) ~[na:1.8.0_77]
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:340) ~[tomcat-embed-core-8.0.32.jar:8.0.32]
at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:765) ~[tomcat-embed-core-8.0.32.jar:8.0.32]
at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:473) ~[tomcat-embed-core-8.0.32.jar:8.0.32]
at org.apache.catalina.connector.Connector.startInternal(Connector.java:986) ~[tomcat-embed-core-8.0.32.jar:8.0.32]
... 14 common frames omitted[2m2016-04-13 19:56:39.395[0;
39m [32m INFO[0;
39m [35m4756[0;
39m [2m---[0;
39m [2m[main][0;
39m [36mo.apache.catalina.core.StandardService[0;
39m [2m:[0;
39m Stopping service Tomcat
[2m2016-04-13 19:56:39.406[0;
39m [31mERROR[0;
39m [35m4756[0;
39m [2m---[0;
39m [2m[main][0;
39m [36mo.s.boot.SpringApplication[0;
39m [2m:[0;
39m Application startup failedorg.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat servlet container
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:165) ~[spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:293) ~[spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:141) ~[spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541) ~[spring-context-4.2.5.RELEASE.jar:4.2.5.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118) ~[spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at com.example.SampleApplication.main(SampleApplication.java:20) [classes/:na]
Caused by: java.lang.IllegalStateException: Tomcat connector in failed state
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:159) ~[spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
... 10 common frames omitted[2m2016-04-13 19:56:39.409[0;
39m [32m INFO[0;
39m [35m4756[0;
39m [2m---[0;
39m [2m[main][0;
39m [36m.b.l.ClasspathLoggingApplicationListener[0;
39m [2m:[0;
39m Application failed to start with classpath: [file:/E:/WS/Sample/target/classes/, file:/C:/Users/kasi/.m2/repository/org/springframework/boot/spring-boot-starter-web/1.3.3.RELEASE/spring-boot-starter-web-1.3.3.RELEASE.jar, file:/C:/Users/kasi/.m2/repository/org/springframework/boot/spring-boot-starter/1.3.3.RELEASE/spring-boot-starter-1.3.3.RELEASE.jar, file:/C:/Users/kasi/.m2/repository/org/springframework/boot/spring-boot/1.3.3.RELEASE/spring-boot-1.3.3.RELEASE.jar, file:/C:/Users/kasi/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/1.3.3.RELEASE/spring-boot-autoconfigure-1.3.3.RELEASE.jar, file:/C:/Users/kasi/.m2/repository/org/springframework/boot/spring-boot-starter-logging/1.3.3.RELEASE/spring-boot-starter-logging-1.3.3.RELEASE.jar, file:/C:/Users/kasi/.m2/repository/ch/qos/logback/logback-classic/1.1.5/logback-classic-1.1.5.jar, file:/C:/Users/kasi/.m2/repository/ch/qos/logback/logback-core/1.1.5/logback-core-1.1.5.jar, file:/C:/Users/kasi/.m2/repository/org/slf4j/slf4j-api/1.7.16/slf4j-api-1.7.16.jar, file:/C:/Users/kasi/.m2/repository/org/slf4j/jcl-over-slf4j/1.7.16/jcl-over-slf4j-1.7.16.jar, file:/C:/Users/kasi/.m2/repository/org/slf4j/jul-to-slf4j/1.7.16/jul-to-slf4j-1.7.16.jar, file:/C:/Users/kasi/.m2/repository/org/slf4j/log4j-over-slf4j/1.7.16/log4j-over-slf4j-1.7.16.jar, file:/C:/Users/kasi/.m2/repository/org/yaml/snakeyaml/1.16/snakeyaml-1.16.jar, file:/C:/Users/kasi/.m2/repository/org/springframework/boot/spring-boot-starter-tomcat/1.3.3.RELEASE/spring-boot-starter-tomcat-1.3.3.RELEASE.jar, file:/C:/Users/kasi/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/8.0.32/tomcat-embed-core-8.0.32.jar, file:/C:/Users/kasi/.m2/repository/org/apache/tomcat/embed/tomcat-embed-el/8.0.32/tomcat-embed-el-8.0.32.jar, file:/C:/Users/kasi/.m2/repository/org/apache/tomcat/embed/tomcat-embed-logging-juli/8.0.32/tomcat-embed-logging-juli-8.0.32.jar, file:/C:/Users/kasi/.m2/repository/org/apache/tomcat/embed/tomcat-embed-websocket/8.0.32/tomcat-embed-websocket-8.0.32.jar, file:/C:/Users/kasi/.m2/repository/org/springframework/boot/spring-boot-starter-validation/1.3.3.RELEASE/spring-boot-starter-validation-1.3.3.RELEASE.jar, file:/C:/Users/kasi/.m2/repository/org/hibernate/hibernate-validator/5.2.4.Final/hibernate-validator-5.2.4.Final.jar, file:/C:/Users/kasi/.m2/repository/javax/validation/validation-api/1.1.0.Final/validation-api-1.1.0.Final.jar, file:/C:/Users/kasi/.m2/repository/org/jboss/logging/jboss-logging/3.3.0.Final/jboss-logging-3.3.0.Final.jar, file:/C:/Users/kasi/.m2/repository/com/fasterxml/classmate/1.1.0/classmate-1.1.0.jar, file:/C:/Users/kasi/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.6.5/jackson-databind-2.6.5.jar, file:/C:/Users/kasi/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.6.5/jackson-annotations-2.6.5.jar, file:/C:/Users/kasi/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.6.5/jackson-core-2.6.5.jar, file:/C:/Users/kasi/.m2/repository/org/springframework/spring-web/4.2.5.RELEASE/spring-web-4.2.5.RELEASE.jar, file:/C:/Users/kasi/.m2/repository/org/springframework/spring-aop/4.2.5.RELEASE/spring-aop-4.2.5.RELEASE.jar, file:/C:/Users/kasi/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar, file:/C:/Users/kasi/.m2/repository/org/springframework/spring-beans/4.2.5.RELEASE/spring-beans-4.2.5.RELEASE.jar, file:/C:/Users/kasi/.m2/repository/org/springframework/spring-context/4.2.5.RELEASE/spring-context-4.2.5.RELEASE.jar, file:/C:/Users/kasi/.m2/repository/org/springframework/spring-webmvc/4.2.5.RELEASE/spring-webmvc-4.2.5.RELEASE.jar, file:/C:/Users/kasi/.m2/repository/org/springframework/spring-expression/4.2.5.RELEASE/spring-expression-4.2.5.RELEASE.jar, file:/C:/Users/kasi/.m2/repository/org/springframework/spring-core/4.2.5.RELEASE/spring-core-4.2.5.RELEASE.jar]
我是春季靴子的新手,所以我没有想到解决这个问题。请告诉我如何解决它?
我可以知道这个问题。
提前致谢。
答案
java.net.BindException: Address already in use: bind
表示服务器的端口(8080)已在使用中。确保您的网络服务器不再在以前的任何启动中运行。
还要检查该端口上是否还有其他应用程序在运行。尝试打开http://localhost:8080/以获得在那里运行的提示。
另一答案使用以下命令检查正在运行的处理。 netstat -ano | findstr:
如果在以下命令中找到任何结果,则使用以下命令终止进程。
taskkill / PID / F注意:/ F用于强制终止进程
另一答案【运行Spring Boot APP时出现Spring Boot问题】转到任务管理器 - > 进程并结束Java(TM)Platform SE二进制进程(这将停止tomcat)并再次运行spring boot应用程序。
另一答案
文章图片
在运行Spring Boot App之前,单击如上所示的红色“stop”按钮,首先停止服务器运行,以便可以重新使用该端口。然后运行Spring Boot App。
希望能帮助到你!
另一答案面对同样的问题。您实际上可以通过在src / main / resources下包含application.properties来覆盖tomcat端口
application.properties文件可能看起来像
server.port = 8443
#below lines for SSL
#server.ssl.key-store = classpath:sample.jks
#server.ssl.key-store-password = secret
#server.ssl.key-password = password
问候,
Shrinidhi
另一答案使用所使用的端口运行命令:example:
lsof -i : 8080(Port number)
现在杀了这个过程。命令 - :
kill -9 <
PID>
(例如:kill -9 8080
)。另一答案Spring Boot使用端口8080作为内置Apache Tomcat容器的默认端口。我们可以通过多种方式覆盖它。一种这样的方式,它以编程方式进行,如下所示。
创建此组件。并编译并运行您的应用程序。根据要求更改端口。
@Component
public class CustomizationBean implements EmbeddedServletContainerCustomizer {
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
container.setPort(8085);
// Use port of your choice that is available
}
}
另一答案如果要运行同一应用程序的2个实例,首先检查两者的端口配置是否不同,然后确保用于运行它的插件不检查文件中的更改并重新加载第一个实例,因为可能发生的情况是,当您为第二个实例更改端口时,插件已经使用此端口重新启动第一个端口,因此当您运行第二个实例时,端口已经很忙。
另一答案解决了!我也遇到过这个问题。它有很多导致两个实例在同一个端口上运行。并检查jsp匹配中的表达式语言的属性与控制器模型属性。还要检查请求映射是否正确。在我的情况下只丢失'/'符号,这就是它抛出此错误的原因。
另一答案按照步骤终止端口上的进程
1]在命令行界面中
netstat -aon | find /i "listening"
2]查找端口8080 Ctrl + F并输入8080(要杀死的进程的端口号)
3]杀死它的相关进程ID。
Taskkill / PID ProcessNumber / F.
Taskkill /PID 3440 /F
并重新运行程序
参考文献:List Processes,Kill a Process
推荐阅读
- application.properties中的SpringBoot未知属性
- 在Android SQLITE中删除多行
- 如何从表1中检索列数据并使用SQLite数据库将该列值插入到Android Studio的表2中()
- 为什么考虑重新设计网站-提示和建议
- 设计的推动力–网站重新设计案例研究
- 可读性设计– Web排版指南(带有信息图)
- 视觉保存期限–为什么网页设计插图会过时
- 跃入VR/AR设计
- 面向大众的UX测试(保持简单且经济高效)