I have such classes and Spring context.
How to fix this wrong Java configuration, not xml?
I'd tried some solutions from other posts, but without success.
@Service
@Transactional
public class XCalculationService implements VoidService<X> {
}
public interface VoidService<Input> {
}
@AllArgsConstructor
public class XService {
private XCalculationService calculationService;
}
@Configuration
public class ServiceConfiguration {
@Bean
public OrderService orderService(XCalculationService calculationService) {
return new XService(calculationService);
}
@Bean
public XCalculationService calculationService() {
return new XCalculationService ();
}
}
Error
BeanNotOfRequiredTypeException: Bean named 'calculationService' is expected to be of type 'com.x.XCalculationService' but was actually of type 'com.sun.proxy.$Proxy