0
봄 부팅 + 최대 절전 모드 5 응용 프로그램에서 java.lang.IllegalArgumentException: Property 'sessionFactory' is required
받기. 나는이SessionFactory 예외
@Autowired
public void setupSessionFactory(SessionFactory sessionFactory) {
setSessionFactory(sessionFactory);
getHibernateTemplate().setCheckWriteOperations(false);
}
처럼 autowire하기 위해 노력 또한 내가 어떻게 내 설정 파일
@Bean
public HibernateJpaSessionFactoryBean getSessionFactory() {
return new HibernateJpaSessionFactoryBean();
}
@Bean
public SessionFactory sessionFactory(){
return new LocalSessionFactoryBean().getObject();
}
@Bean
public HibernateTransactionManager transactionManager(SessionFactory sf) {
return new HibernateTransactionManager(sf);
}
내 application.yml 파일
spring:
datasource:
url: jdbc:postgresql://localhost:5432/db
driver-class-name: org.postgresql.Driver
username: postgres
password: password
jpa:
hibernate:
ddl-auto: update
security:
basic:
enabled: false
어떤 아이디어에 같은 물건을 추가하려고 이거 해결해?
오류로 변경 com.jgang.realestate.service.OwnerServiceImpl에 필드 ownerRepository를 찾을 수 없습니다 '의 EntityManagerFactory'라는 이름의 빈을 요구했다. 작업 : 구성에서 'entityManagerFactory'라는 bean 정의를 고려하십시오. – MolecularMan
'com.jgang.realestate.service.OwnerServiceImpl'은 무엇인지 전혀 알지 못하지만 질문의 문제는 해결되지만 – Andremoniy
과 btw, 나는 datasource 및 hibernate 속성을 설정하기 위해 application.yml을 사용할 수 있습니까? – MolecularMan