Alguém poderia me ajudar. Quando rodo o código dá esse erro:
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.projeto.forum.repository.TopicoRepository defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a managed type: class br.com.projeto.forum.model.Topico
Coloquei. Mas apareceu outro erro agora :
Error creating bean with name ‘entityManagerFactory’ defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: No identifier specified for entity: br.com.projeto.forum.repository.TopicoRepository
Segui um passo a passo encontrado em um forum. Aparente esse erro resolveu agora apareceu outro. Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'topico' defined in file [C:\Users\KerolenRodrigues\Documents\Estudos\forum\target\classes\br\com\projeto\forum\model\Topico.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'java.lang.String' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
Uai, parece que o spring está tentando carregar o Topico como um bean gerenciado. Estranho. Nessa classe Topico tem alguma anotação @Component ou @Service?
Arrumei. Só que agora veio outro erro Error creating bean with name ‘entityManagerFactory’ defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: Use of @OneToMany or @ManyToMany targeting an unmapped class: br.com.projeto.forum.model.Topico.respostas[br.com.projeto.forum.model.Resposta]