2017-07-15 1 views
1

私は、次のような問題を抱えている:にClassNotFoundException

私はセットアップに春Webfluxと春のセキュリティを含む基本的な春ブーツ(2.0.0.M2)プロジェクトをしようとしています。

私のpom.xmlが(start.spring.ioを経由して生成された)次のようになります。私は、起動時に例外を取得するので、私はそれ以上になっていないです

@EnableWebFluxSecurity 
public class SecurityConfig extends WebFluxSecurityConfiguration {} 

<parent> 
    <groupId>org.springframework.boot</groupId> 
    <artifactId>spring-boot-starter-parent</artifactId> 
    <version>2.0.0.M2</version> 
    <relativePath/> <!-- lookup parent from repository --> 
</parent> 

<dependencies> 
    ... 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-security</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-webflux</artifactId> 
    </dependency> 
    ... 
</dependencies> 

SpringSecurityConfig :

Caused by: java.lang.ClassNotFoundException: org.springframework.security.web.server.context.SecurityContextRepository 

だから私は、全体のorg.springframework.security.web.serverパッケージがCLAではないことを理解しますsspathは、API docsに含まれているので、そこにあるはずです。

私は何か間違っているように見えますが、私は何が分かりません。

+0

あなたは依存関係を追加する必要があります。 Afaikのセキュリティフラックスジャーは 'spring-boot-starter-security'の一部ではありません。ローカルのリポジトリをパージして、依存関係をダウンロードしてみてください。 –

+0

あなたはそうです、それはそれの一部ではありません。私はそれがSpring Security 5.0.0.M2 API-docsに含まれているからだと思っていました。ありがとう! – Roen

+1

あなた自身の質問に答えることができますか?これはコミュニティの他の開発者を助けるはずです。 –

答えて

0

現在、スプリングブートのspring-boot-starter-securityにはspring-security-webfluxが含まれていません。

プロジェクト依存として明示的に追加します。

<dependency> 
    <groupId>org.springframework.security</groupId> 
    <artifactId>spring-security-webflux</artifactId> 
</dependency> 

これを参照してくださいissue : Provide auto-configuration for WebFlux-based securityを参照してください。

ところで、私の作業のコードをチェックしてください。https://github.com/hantsy/spring-reactive-sample/tree/master/boot

関連する問題