Spring Boot Error: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.medical.hospital.auth.service.SysHosDisService' available
This error occurs when Spring is unable to find a bean of the required type during autowiring. In this case, the error message indicates that the 'HosUserClassroomController' class requires a bean of type 'SysHosDisService', but Spring is unable to find one.
To fix this error, you need to check that a bean of type 'SysHosDisService' is defined in your Spring configuration. If it is not defined, you need to define it. If it is defined, you need to make sure that it is being scanned and loaded by Spring.
One possible reason for this error is that the package containing the 'SysHosDisService' class is not being scanned by Spring. To fix this, you can add the package containing the 'SysHosDisService' class to the '@ComponentScan' annotation in your Spring configuration class.
Another possible reason for this error is that the 'SysHosDisService' class is not being instantiated by Spring. To fix this, you can add the '@Service' annotation to the 'SysHosDisService' class to indicate that it is a service bean that needs to be instantiated by Spring.
原文地址: https://www.cveoy.top/t/topic/nTg5 著作权归作者所有。请勿转载和采集!