BaelSnake
BaelSnake
2016-08-01 07:30

出什么问题了,我看不出来。求大神指点迷津!!!

错误报告:
Exception in thread "main" org.hibernate.MappingException: Unable to load class [ com.sun.hiberante.model.TeacherModel] declared in Hibernate configuration entry
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:2369)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:2310)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2290)
at org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:242)
at org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:71)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2243)
at org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:230)
at org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:71)
at org.hibernate.cfg.Configuration.configure(Configuration.java:2158)
at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:212)
at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:71)
at org.hibernate.cfg.Configuration.configure(Configuration.java:2137)
at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:206)
at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:71)
at com.sun.hibernate.model.TeacherModelTest.main(TeacherModelTest.java:24)
Caused by: java.lang.ClassNotFoundException: com.sun.hiberante.model.TeacherModel
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:195)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:2366)
... 14 more

hibernate.cfg.xml文件中:

    <!-- 指定映射文件为“StudentModel.hbm.xml” -->
<mapping resource="com/sun/hibernate/model/StudentModel.hbm.xml"/>
<mapping class="com.sun.hiberante.model.TeacherModel"/>
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

3条回答