問題タブ [spring-webflux]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
spring-boot - アプリケーション タイプをリアクティブに設定すると、Spring Boot 統合テストを開始できませんでした
Spring Boot 2.0.0.M3 経由で Spring Webflux を使用するアプリケーションがあります。
アプリケーションは、実行時にREACTIVEタイプとして設定されます。
メイン アプリケーションを実行している場合、リアクティブ アプリは正常に動作します。しかし、春のブート統合テストでこのアプリを起動できませんでした。
以下のようにテストを宣言しました。
テスト ケースを実行すると、以下のエラーが発生しました。
java.lang.IllegalStateException: ApplicationContext のロードに失敗しました
intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51) com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) com.intellij.rt.execution. junit.JUnitStarter.main(JUnitStarter.java:70) 原因: org.springframework.context.ApplicationContextException: リアクティブ Web サーバーを起動できません。ネストされた例外は org.springframework.context.ApplicationContextException: Unable to start ReactiveWebApplicationContext due to missing ReactiveWebServerFactory Bean です。org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.onRefresh(ReactiveWebServerApplicationContext.java:64) で org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) で org.springframework.boot.ReactiveWebServerFactory Bean が見つからないため、ReactiveWebApplicationContext を開始できません。 org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.getWebServerFactory(ReactiveWebServerApplicationContext.java:103) で org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.createWebServer(ReactiveWebServerApplicationContext.java:87) で org.springframework .boot.web.reactive.context.ReactiveWebServerApplicationContext.onRefresh(ReactiveWebServerApplicationContext.java:61) ... 44 詳細
webflux でスプリング ブート統合テストを実行するための構成上の問題はありますか?
ここから完全なデモ プロジェクトにアクセスできます。
spring - jetty を使用した新しい機能的 Web フレームワーク
Spring 5 の New: Functial Web Frameworkの例をセットアップしたかったので、以下をセットアップ
しましたRouteConfiguration
。
jetty を使用してアプリケーションを開始しましたが、最初はうまくいくように見えました...メソッドの 1 つを呼び出したいと思うまでlocalhost:8080/first
は、404
.
ルート構成を間違って定義したか、それともルートにアクセスできないのはなぜですか?
編集
netty では、次のようなサーバー構成を提供する必要があります。
しかし、桟橋についてはこのようなものを見つけることができませんでした。
編集2
私の依存関係:
スプリングブート バージョン:2.0.0.M3