org.hibernate.MappingException

LOVEZI 发布于 2012/05/27 15:21
阅读 389
收藏 0
log4j:WARN No appenders could be found for logger (org.hibernate.type.BasicTypeRegistry).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Exception in thread "main" java.lang.ExceptionInInitializerError
    at com.bhbh.beizi.hibernate.Many2Many.add(Many2Many.java:62)
    at com.bhbh.beizi.hibernate.Many2Many.main(Many2Many.java:16)
Caused by: org.hibernate.MappingException: An association from the table teacher_student refers to an unmapped class: Teacher
    at org.hibernate.cfg.Configuration.secondPassCompileForeignKeys(Configuration.java:1794)
    at org.hibernate.cfg.Configuration.originalSecondPassCompile(Configuration.java:1726)
    at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1393)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1826)
    at com.bhbh.beizi.dao.HibernateUtil.<clinit>(HibernateUtil.java:20)
    ... 2 more

求各路大侠指教,帮我看看是什么问题,我刚刚开始学习hibernate,现在被卡主了,谢谢啦.....

加载中
0
喜之郎
喜之郎
大概是因为log4j的配置文件没配置正确引起的,在网上找个典型 配置。
0
LOVEZI
LOVEZI
嗯嗯...我看看,谢谢啦
返回顶部
顶部