Tuesday, September 11, 2018

Spring: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ...: Unsatisfied dependency expressed through field


>PROBLEM
Starting the application, it stops working throwing the following exception:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'ulteringController': Unsatisfied dependency expressed through field 'stateSvc'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'estadoSvc': Unsatisfied dependency expressed through field 'estadoRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'estadoRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Could not create query metamodel for method public abstract br.com.ultering.model.State br.com.ultering.model.repository.EstadoRepository.findBySigla(java.lang.String)!
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588) ~[spring-beans-4.3.9.RELEASE.jar:4.3.9.RELEASE]


>SOLUTION

@Autowired
private StateSvc stateSvc;

ORIGINAL

@Service("estadoSvc")
@Transactional
public class StateSvcImpl extends AbstractSvc implements StateSvc {

FIXED

@Service("stateSvc")
@Transactional
public class StateSvcImpl extends AbstractSvc implements StateSvc {


>ENV
Windows
Spring Boot

VMware Workstation: configuring shared folders for Debian 11-12 and Ubuntu

  1. Configure the shared folders. - Before starting the virtual machine, set the VMware shared files config. Example: NOTE: Debian 11 works...