Could not instantiate bean class: Specified class is an interface

后端 未结 1 1046
有刺的猬
有刺的猬 2021-01-17 15:09

I know there are threads similar to this issue. Below is my class and I am configuring it in spring.xml file. Actually HumanResourceService is an interface having only one m

相关标签:
1条回答
  • 2021-01-17 15:51

    You can't, Spring needs something it can make an instance from, the interface isn't enough.

    In your spring.xml, the value of the class attribute for your bean with id="humanResourceService" should be the name of your implementation class, not the interface. Spring needs you to tell it what implementation class you want it to use for this.

    0 讨论(0)
提交回复
热议问题