org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'person' defined in file [D:\code\download\SpringBoot-master\annotation\target\classes\com\example\annotation\bean\Person.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'java.lang.String' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
今天在打印Bean時候報了這樣一個錯誤,查了網上的方法。
需要在Person類中添加一個無參構造函數
成功解決