2017-05-23 7 views
0

を聞くことができませんコンソールでの出力:私は、ブラウザを開いて、(私はapplication.propertiesに= 9999セットはserver.portによって9999にポートを変更)http://localhost:9999を訪問したときにSpringBootは私が空白のプロジェクトを生成し、基本的なRESTControllerを追加するSpringboot-CLIを使用MacOSのSierra.Andを使用しているポート

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

2017-05-23 23:54:19.470 INFO 3776 --- [   main] com.bonc.smallETL.ETLApp     : Starting ETLApp on SLs-Mac.local with PID 3776 (/Users/liuxiaoyang/Desktop/sourceCode/smallETL/smalletl-back/target/classes started by liuxiaoyang in /Users/liuxiaoyang/Desktop/sourceCode/smallETL/smalletl-back) 
2017-05-23 23:54:19.473 INFO 3776 --- [   main] com.bonc.smallETL.ETLApp     : No active profile set, falling back to default profiles: default 
2017-05-23 23:54:19.571 INFO 3776 --- [   main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot[email protected]2805c96b: startup date [Tue May 23 23:54:19 CST 2017]; root of context hierarchy 
2017-05-23 23:54:21.126 INFO 3776 --- [   main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 9999 (http) 
2017-05-23 23:54:21.142 INFO 3776 --- [   main] o.apache.catalina.core.StandardService : Starting service Tomcat 
2017-05-23 23:54:21.143 INFO 3776 --- [   main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.14 
2017-05-23 23:54:21.263 INFO 3776 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]  : Initializing Spring embedded WebApplicationContext 
2017-05-23 23:54:21.264 INFO 3776 --- [ost-startStop-1] o.s.web.context.ContextLoader   : Root WebApplicationContext: initialization completed in 1699 ms 
2017-05-23 23:54:21.401 INFO 3776 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/] 
2017-05-23 23:54:21.405 INFO 3776 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*] 
2017-05-23 23:54:21.405 INFO 3776 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*] 
2017-05-23 23:54:21.406 INFO 3776 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*] 
2017-05-23 23:54:21.407 INFO 3776 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*] 

はしかし、それは接続がカールを経由して(も拒否したことが判明します)。だから、lsof -i:9999コマンドでポートをチェックしても何もしません。

# liuxiaoyang @ SLs-Mac in ~ [0:08:14] 
$ lsof -i:9999 

# liuxiaoyang @ SLs-Mac in ~ [0:14:59] C:1 
$ sudo lsof -i:9999 
Password: 

# liuxiaoyang @ SLs-Mac in ~ [0:15:02] C:1 

しかし、すべてがうまく見え、プロジェクトJVMを表示しているjpsコマンドが開始されました。 enter image description here すべてが正しいと思われるときに、プログラムが設定されたポートをリッスンできない理由は何ですか?

+0

アプリケーションが起動すると、リッスンしているすべてのポートが一覧表示されます。そのリストに9999はありますか?スタートアップの出力を表示します。 – csmckelvey

+0

'server.port = 8090'で起動しようとしました。 – Reborn

+0

試しました。私もポートの問題だと思っていました。ポートを変更したときは何も変わりません。@ Reborn – CALTyang

答えて

0

私は会社に行ってプロジェクトを再実行するとうまくいきます。驚くべきことです。私は春のブートを埋め込んだTomcatの詳細を知らない。しかし、私の問題は、ネットワークインタフェースのバインディングに関連していると思います。私のコンピュータには、いくつかの仮想インタフェースを持つネットワークインタフェースがたくさんあるからです。

関連する問題