当前位置: 代码迷 >> Java Web开发 >> MappingException: Could not read mappings from resource:
  详细解决方案

MappingException: Could not read mappings from resource:

热度:51   发布时间:2016-04-17 14:58:20.0
hibernate 错误,求助
错误信息:
%%%%   Error   Creating   SessionFactory   %%%%
org.hibernate.MappingException:   Could   not   read   mappings   from   resource:   blog/href/dao/Hreftab.hbm.xml
at   org.hibernate.cfg.Configuration.addResource(Configuration.java:485)
at   org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1465)
at   org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1433)
at   org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1414)
at   org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1390)
at   org.hibernate.cfg.Configuration.configure(Configuration.java:1310)
at   blog.hibernate.HibernateSessionFactory.rebuildSessionFactory(HibernateSessionFactory.java:59)
at   blog.hibernate.HibernateSessionFactory.getSession(HibernateSessionFactory.java:43)
at   blog.hibernate.BaseHibernateDAO.getSession(BaseHibernateDAO.java:22)
at   blog.login.dao.UserInfoDAO.findByProperty(UserInfoDAO.java:256)
at   blog.login.dao.UserInfoDAO.findByUsername(UserInfoDAO.java:272)
at   blog.login.action.LoginAction.execute(LoginAction.java:61)
at   org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at   org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at   org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at   org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at   javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at   filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:33)
at   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at   org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at   org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at   org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at   org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at   org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at   org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at   org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at   org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at   org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at   java.lang.Thread.run(Thread.java:595)
Caused   by:   org.hibernate.DuplicateMappingException:   Duplicate   class/entity   mapping   blog.href.dao.Hreftab
at   org.hibernate.cfg.Mappings.addClass(Mappings.java:118)
at   org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:154)
at   org.hibernate.cfg.Configuration.add(Configuration.java:386)
at   org.hibernate.cfg.Configuration.addInputStream(Configuration.java:427)
at   org.hibernate.cfg.Configuration.addResource(Configuration.java:482)
  相关解决方案