netflix zuul-simple-webapp.war在tomcat下啟動

來源:互聯網
上載者:User

標籤:

按照netflix 在github 的wiki的文檔使用

gradlew jettyRun

可以啟動jetty來進行測試。

在本地build war 以後,我放在tomcat 啟動並執行時候,卻不可以運行。

這裡遇到了一些問題,記錄如下:

1. Connection pool is shut down.

經查,這個是範例中groovy/filters/route/SimpleHostRoutingFilter 使用HttpClient 不當的問題。

在啟動jetty中也可以觀察到。

 2. url在tomcat 無法開啟的問題在github 的wiki 文檔中可以看到 localhost:8080/ 是可以看到apache.org的頁面的。而在tomcat中明顯需要 ContextPath. 於是切換成 localhost:8080/zuul/ 無法看到任何東西。 原因在於,其中routing 的時候,在 groovy/filters/route/SimpleHostRoutingFilter 中使用了request.getRequestUri()其中包含了 /zuul/於是本來是請求 http://apache.org/ 的,在tomcat中變成了 http://apache.org/zuul,於是tomcat中請求就無法正常相應了。 解決方案:修改groovy/filters/route/SimpleHostRoutingFilter 中代碼 

netflix zuul-simple-webapp.war在tomcat下啟動

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.