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)不知道哪里出错了

解决方案 »

  1.   

    Exception in thread "main" org.hibernate.HibernateException: /hibernate.cfg.xml not found 
    已经很明显的抛出错误了呀,hibernate.cfg.xml找不到,你把它丢哪里去了,还是根本就没建立这个文件?
      

  2.   

    你把hibernate.cfg.xml是不是丢在src下面
      

  3.   

    找不到对应的hibernate.cfg.xml文件,你可以将它放到你的项目下即可。
      

  4.   

    如果你没有创建这个文件的话,你可以到hibernate的发布包下拷一个,改一下就行了。
      

  5.   

    hibernate.cfg.xml应该是放在src下,部署时在classes下的
      

  6.   


    给楼主一个彻底解决问题的方法
    将hibernate.cfg.xml文件设置到CLASSPATH里,主要路径要对而且文件名不要写错!
      

  7.   

    没找到hibernate.cfg.xml文件!楼主放错位置了吧!