Could not parse mapping document from resource com

实体类: 
public class bbsAdmin { 
private int aid; 
private String anumber; 
private String apassword; 
private int state; 
//为节省空间,此处省去get和set 


配置文件: 
 
 
 
 
 
 
 
 
 
 
 
 

报错: 
%%%% Error Creating SessionFactory %%%% 
org.hibernate.InvalidMappingException: Could not parse mapping document from resource com/entity/bbsAdmin.hbm.xml 
at org.hibernate.cfg.Configuration.addResource(Configuration.java:569) 
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1587) 
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1555) 
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1534) 
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1508) 
at org.hibernate.cfg.Configuration.configure(Configuration.java:1428) 
at com.dao.HibernateSessionFactory.rebuildSessionFactory(HibernateSessionFactory.java:70)
at com.dao.HibernateSessionFactory.getSession(HibernateSessionFactory.java:53) 
at com.dao.bbsUsersDao.selectAll(bbsUsersDao.java:74) 
at com.biz.bbsUsersDaoBiz.selectAll(bbsUsersDaoBiz.java:65) 
at com.web.Servlet.doPost(Servlet.java:60) 
at com.web.Servlet.doGet(Servlet.java:44) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) 
        ................... 
请问这个配置文件那里写的有问题? 


问题补充:只使用了Hibernate框架。


问题补充:

Wind_ZhongGang 写道

如果你使用的是Spring框架集成的Hibernate  那你应该把那段配置文件贴出来,报错原因说无法解析你的持久化实体配置文件 

 
         
         
             
                classpath:/hibernate_mappings/* 
           
 
       
 
         
             
                ${hibernate.dialect} 
                ${hibernate.show_sql} 
                ${hibernate.hbm2ddl.auto} 
                ${hibernate.jdbc.batch_size} 
           
 
       
 
   


只用了一个单独的Hibernate。


转载于:https://my.oschina.net/u/2341995/blog/400730

你可能感兴趣的:(java)