I have two objects from the AmazonS3UploadService and DatabaseUploadService classes, and both implement the UploadService interface. The Uploading class has both objects injected by the Spring container.
The problem is that the container can not inject dependencies correctly and the following error occurs:
Can not set br.com.manager.domain.service.AmazonS3UploadService field br.com.manager.domain.service.ConfiguracaoService.amazonS3UploadService to com.sun.proxy.$Proxy67
I tried to use other annotations as @Resource, @Inject, @Qualifier
and I currently use @Autowired
Note: I do not know if it's a good idea to put files in the database for various reasons, but since it's a study project, I've put it as an option.