I created a project that consumes data from a queue in rabbitMQ. This part is all right and the application starts normally.
However, when I add the JPA + postgres dependency, the error below starts to appear:
Java: 21
Spring Boot: 3.2.4
Maven Project
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
Complete error
{"ts":"2025-03-25T22:54:52.389Z","logger":"org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext","severity":"WARN","thread":"main","message":"Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: org.hibernate.bytecode.spi.BytecodeProvider: org.hibernate.bytecode.internal.bytebuddy.BytecodeProviderImpl Unable to get public no-arg constructor"}
@Setter
@Getter
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "seller")
public class SellerEntity {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String name;
private String cnpj;
}
I didn’t add any other configuration classes. By default, spring boot should connect to the database only with the data from the datasource in application.yml, right?