log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" org.hibernate.HibernateException: /hibernate.cfg.xml not found
at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:147)
at org.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:1324)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1346)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1333)
at com.imti.hibernate.Bean.main(Bean.java:19)不知道哪里出错了
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" org.hibernate.HibernateException: /hibernate.cfg.xml not found
at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:147)
at org.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:1324)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1346)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1333)
at com.imti.hibernate.Bean.main(Bean.java:19)不知道哪里出错了
已经很明显的抛出错误了呀,hibernate.cfg.xml找不到,你把它丢哪里去了,还是根本就没建立这个文件?
给楼主一个彻底解决问题的方法
将hibernate.cfg.xml文件设置到CLASSPATH里,主要路径要对而且文件名不要写错!