1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Autowiredの定義忘れ

Posted at

起こった事象

以下のようなエラーが出力

Description:

Field サービスクラス内のAutowiredしている変数 in サービスクラス required a bean of type 'Daoインターフェース(Autowiredしているインターフェース)' that could not be found.

The injection point has the following annotations:
	- @org.springframework.beans.factory.annotation.Autowired(required=true)


Action:

Consider defining a bean of type 'Daoインターフェース(Autowiredしているインターフェース)' in your configuration.

原因

インターフェース実装クラスのアノテーションが漏れていたため、Autowiredする時に対象が見つからなかったためエラーが発生していた。

public class UserDaoJdbcImpl implements UserDao

@Repository
public class UserDaoJdbcImpl implements UserDao
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?