我目前在一个项目的中间,我想提取未读电子邮件的详细信息,并提取诸如Subject,Email之类的信息,并使用commandLineRunner
的run方法更新mySQL数据库。
进度
我成功地从电子邮件中提取了所有相关信息。但是,当我尝试在数据库上保存数据时,出现以下异常。
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration': Initialization of bean failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry' available
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'emailReceiver': Unsatisfied dependency expressed through field 'taxRepository'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.example.repo.TaxRepository' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
可以在另一个方法内实现CommandLineRunner的run()方法并直接调用