Black November

ATÉ 50% OFF

TÁ ACABANDO!

0 dias

0 horas

0 min

0 seg

1
resposta

Api não retorna, o erro que esta dando.

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'topicosController': Unsatisfied dependency expressed through field 'topicoRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'topicoRepository' defined in br.com.alura.forum.repository.TopicoRepository defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration: Invocation of init method failed; nested exception is org.springframework.data.repository.query.QueryCreationException: Could not create query for public abstract br.com.alura.forum.modelo.Topico br.com.alura.forum.repository.TopicoRepository.findByNome(java.lang.String); Reason: Failed to create query for method public abstract br.com.alura.forum.modelo.Topico br.com.alura.forum.repository.TopicoRepository.findByNome(java.lang.String)! No property 'nome' found for type 'Topico'; nested exception is java.lang.IllegalArgumentException: Failed to create query for method public abstract br.com.alura.forum.modelo.Topico br.com.alura.forum.repository.TopicoRepository.findByNome(java.lang.String)! No property 'nome' found for type 'Topico'

Caused by: org.springframework.data.repository.query.QueryCreationException: Could not create query for public abstract br.com.alura.forum.modelo.Topico br.com.alura.forum.repository.TopicoRepository.findByNome(java.lang.String); Reason: Failed to create query for method public abstract br.com.alura.forum.modelo.Topico br.com.alura.forum.repository.TopicoRepository.findByNome(java.lang.String)! No property 'nome' found for type 'Topico'; nested exception is java.lang.IllegalArgumentException: Failed to create query for method public abstract br.com.alura.forum.modelo.Topico br.com.alura.forum.repository.TopicoRepository.findByNome(java.lang.String)! No property 'nome' found for type 'Topico'

Matricule-se agora e aproveite até 50% OFF

O maior desconto do ano para você evoluir com a maior escola de tecnologia

QUERO APROVEITAR
1 resposta

Oi Ariely,

O erro: No property 'nome' found for type 'Topico'; Verifica na sua classe Topico se tem o atributo chamado nome.

Caso não tenha, você deve renomear o método no repository para que tenha o mesmo nome do atributo que deseja realizar a consulta.