I have a temporal activity class under package
com.x.nl.y.customercare.processes.activity.subscription
Class looks like
@Slf4j
@AllArgsConstructor
@Component
public class ServiceActivitiesImpl implements ServiceActivities {
private final Service service;
@Override
public canBeSavedResponse canBeSaved(CanBeSavedRequest request) {
return service.canBeSaved(request);
}
}
The injected Service bean class is under the package
com.x.nl.y.customercare.service
The issue is Spring cannot inject this service bean into activity due to
org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.x.nl.y.customercare.service.Service'
But if I move it into com.x.nl.y.customercare.processes or any subpackage of it then it works.
What's wrong with the service package ?
are you missing @Autowired ? spring scans packages looking for specific annotations. maybe the service is in a package out of the default scope