You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2020/04/07 12:24:17 UTC

[GitHub] [servicecomb-java-chassis] zhongyi-tim opened a new issue #1695: CSE和Tomcat监听同一个端口,启动工程报错,端口冲突。请问如何处理?

zhongyi-tim opened a new issue #1695: CSE和Tomcat监听同一个端口,启动工程报错,端口冲突。请问如何处理?
URL: https://github.com/apache/servicecomb-java-chassis/issues/1695
 
 
   microservice.yml定义
   cse:
     service:
       registry:
         address: http://127.0.0.1:30100
     rest:
       address: 0.0.0.0:20662
       servlet:
         urlPattern: ""
   
   application.yml
   server:
     address: 127.0.0.1
     port: 20662
     servlet:
       context-path: /
     max-http-header-size: 1024KB
   
   报错:
   严重: Failed to start connector [Connector[HTTP/1.1-20662]]
   org.apache.catalina.LifecycleException: Failed to start component [Connector[HTTP/1.1-20662]]
   	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
   	at org.apache.catalina.core.StandardService.addConnector(StandardService.java:225)
   	at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.addPreviouslyRemovedConnectors(TomcatWebServer.java:263)
   	at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:195)
   	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.startWebServer(ServletWebServerApplicationContext.java:296)
   	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:162)
   	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552)
   	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)
   	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:742)
   	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:389)
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:311)
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1213)
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1202)
   	at com.huawei.m2m.cmp.base.starter.AbstractApplicationStarter.beforeProcess(AbstractApplicationStarter.java:65)
   	at com.huawei.m2m.cmp.global.simcard.SimMgmtApplication.main(SimMgmtApplication.java:48)
   Caused by: org.apache.catalina.LifecycleException: Protocol handler start failed
   	at org.apache.catalina.connector.Connector.startInternal(Connector.java:1020)
   	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
   	... 14 more
   Caused by: java.net.BindException: Address already in use: bind
   	at sun.nio.ch.Net.bind0(Native Method)
   	at sun.nio.ch.Net.bind(Net.java:433)
   	at sun.nio.ch.Net.bind(Net.java:425)
   	at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
   	at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
   	at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:219)
   	at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:1191)
   	at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:591)
   	at org.apache.catalina.connector.Connector.startInternal(Connector.java:1018)
   	... 15 more

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #1695: CSE和Tomcat监听同一个端口,启动工程报错,端口冲突。请问如何处理?

Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #1695: CSE和Tomcat监听同一个端口,启动工程报错,端口冲突。请问如何处理?
URL: https://github.com/apache/servicecomb-java-chassis/issues/1695#issuecomment-610357748
 
 
   这个错误要看下初始化顺序了, 可能在初始化 tomcat 前, 进行了其他的加载,比如加载 servicecomb。 在 spring boot embeded tomcat 场景, 应该由 spring boot 加载 java-chassis, 才不会出现这种情况。 也可以先看下 [例子](https://github.com/apache/servicecomb-samples/tree/master/porter_springboot) 和 [文档](http://liubao68.gitee.io/servicecomb-java-chassis-doc/java-chassis/zh_CN/using-java-chassis-in-spring-boot/components-for-spring-boot/)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services