问题描述
SLF4J:ClasspathcontainsmultipleSLF4Jbindings.SLF4J:Foundbindingin[jar:file:/C:/Users/Administrator/AppData/Local/Genuitec/MyEclipse-8.6/configuration/org.eclipse.osgi/bundles/89/1/.cp/myeclipse-data/3.3/lib/required/slf4j-log4j12-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class]SLF4J:Foundbindingin[jar:file:/D:/Workspace/Hibernate/WebRoot/WEB-INF/lib/slf4j-log4j12-1.5.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]SLF4J:Seehttp://www.slf4j.org/codes.html#multiple_bindingsforanexplanation.log4j:WARNNoappenderscouldbefoundforlogger(org.hibernate.cfg.Environment).log4j:WARNPleaseinitializethelog4jsystemproperly.Exceptioninthread"main"java.lang.ExceptionInInitializerErroratcom.Grade.TestGrade.save(TestGrade.java:37)atcom.Grade.TestGrade.main(TestGrade.java:18)Causedby:org.hibernate.InvalidMappingException:Couldnotparsemappingdocumentfromresourcecom/Grade/Student.hbm.xmlatorg.hibernate.cfg.Configuration.addResource(Configuration.java:616)atorg.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1635)atorg.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1603)atorg.hibernate.cfg.Configuration.doConfigure(Configuration.java:1582)atorg.hibernate.cfg.Configuration.doConfigure(Configuration.java:1556)atorg.hibernate.cfg.Configuration.configure(Configuration.java:1476)atorg.hibernate.cfg.Configuration.configure(Configuration.java:1462)atcn.jbit.util.HibernateUtil.<clinit>(HibernateUtil.java:23)...2moreCausedby:org.hibernate.DuplicateMappingException:duplicateimport:Studentreferstobothcom.Grade.Studentandcn.jbit.entity.Student(tryusingauto-import="false")atorg.hibernate.cfg.Mappings.addImport(Mappings.java:164)atorg.hibernate.cfg.HbmBinder.bindPersistentClassCommonValues(HbmBinder.java:636)atorg.hibernate.cfg.HbmBinder.bindClass(HbmBinder.java:549)atorg.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:293)atorg.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:166)atorg.hibernate.cfg.Configuration.add(Configuration.java:716)atorg.hibernate.cfg.Configuration.addInputStream(Configuration.java:551)atorg.hibernate.cfg.Configuration.addResource(Configuration.java:613)...9more