Criei um projeto spring em Java que conectou a base de dados perfeitamente bem.
Decidi criar uma interface visual para ver conexão com base de dados, mas começou a retornar esse erro.
Segue os códigos
@EnableAutoConfiguration
@SpringBootApplication
public class Main implements CommandLineRunner{
public static void main(String[] args){
SpringApplication.run(Main.class, args);
}
@Override
public void run(String... args) throws Exception {
LoginView view = new LoginView();
view.setLocationRelativeTo(null);
view.setVisible(true);
}
}
Segue anotação feita no JFrame, usando o org.springframework.stereotype.Component
@Component
public class LoginView extends javax.swing.JFrame {
Erro apresentado:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Unsatisfied dependency expressed through method 'entityManagerFactory' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'entityManagerFactoryBuilder' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Unsatisfied dependency expressed through method 'entityManagerFactoryBuilder' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaVendorAdapter' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.orm.jpa.JpaVendorAdapter]: Factory method 'jpaVendorAdapter' threw exception; nested exception is java.lang.NoClassDefFoundError: org/hibernate/jpa/HibernatePersistenceProvider
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800) ~[spring-beans-5.3.15.jar:5.3.15]
Alguém saberia o que pode ser? Já adicionei algumas dependências no POM (solução proposta pela internet) e o erro permanecia.