2017-04-11 2 views
-1

자바 하이버 네이트를 연구 중이지만 아래와 같은 오류가 발생한다. 제 실수를 찾도록 도와주세요. 감사.자바 하이버 네이트 오류 ConfigurationException

Apr 11, 2017 11:32:46 AM org.hibernate.Version logVersion 
INFO: HHH000412: Hibernate Core {5.2.9.Final} 
Apr 11, 2017 11:32:46 AM org.hibernate.cfg.Environment <clinit> 
INFO: HHH000206: hibernate.properties not found 
Failed to create sessionFactory object.org.hibernate.internal.util.config.ConfigurationException: Could not locate cfg.xml resource [hibernate.cfg.xml] 
Exception in thread "main" java.lang.ExceptionInInitializerError 
    at testhibernate.ManageEmployee.main(ManageEmployee.java:20) 
Caused by: org.hibernate.internal.util.config.ConfigurationException: Could not locate cfg.xml resource [hibernate.cfg.xml] 
    at org.hibernate.boot.cfgxml.internal.ConfigLoader.loadConfigXmlResource(ConfigLoader.java:53) 
    at org.hibernate.boot.registry.StandardServiceRegistryBuilder.configure(StandardServiceRegistryBuilder.java:163) 
    at org.hibernate.cfg.Configuration.configure(Configuration.java:258) 
    at org.hibernate.cfg.Configuration.configure(Configuration.java:244) 
    at testhibernate.ManageEmployee.main(ManageEmployee.java:17) 
+0

프로젝트에 'hibernate.cfg.xml' 파일이 있습니까? – Jens

+0

hibernate.cfg.xml 파일을'src \ main \ webapp \ WEB-INF' 폴더에 추가하고 디스패처 서블릿에서이를 참조한다고 가정합니다. –

+0

@ Jens hibernate.cfg.xml 파일은 src/testhibernate /에 있습니다. testhibernate는 pkgage –

답변

1

src-> main-> resources 폴더에 xml 파일을 넣습니다. 리소스 폴더를 IDE에서 리소스로 표시하는 것을 잊지 마십시오.