Jwtトークンを使用してOAuth実装を開発しています。 それは一種の奇妙だが、クラスTokenAuthenticationService
のために、私は別のパッケージにAutowired
にこのクラスをしようとすると、私は Consider defining a bean of type 'com.company.security.TokenAuthenticationService' in your configuration.
を取得し、私は回避策を行なったし、そのクラスに@Bean TokenAuthenticationService
を追加しました。 TokenAuthenticationService
クラスのインターフェイスを初期化しようとすると、そのインターフェイスに対して同じタイプのエラーが発生します。 Consider defining a bean of type 'com.company.security.UserService' in your configuration.
Spring Boot:@Autowiredがクラスのいずれかで動作しない
ComponentScan注釈は、私がここに、なぜ行方不明です何@ComponentScan({"com.company"})
のように設定されていますか?
'TokenAuthentificationService'クラスはあなたのものですか?それは '@ Component'または等価注釈で注釈されていますか? –