<bean ></property>
 </bean>

//*************************************************************************************************************************

上面这段配置中一直抛出一下异常

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [spring/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.InvalidMappingException: Unable to read XML

弄了一上午也找不到原因,头都炸了

后面看到一个贴说是*.hbm.xml 中内容有错,我就一行一行检查,可是还是没发现有什么错误,最后。。。。。。最后,竟然是因为dtd后面多以一个空格导致的

<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd ">把dtd后面的空格删除,就把问题解决了

相关文章:

  • 2021-08-10
  • 2022-12-23
  • 2021-07-30
  • 2022-12-23
  • 2022-12-23
  • 2021-11-22
  • 2021-10-31
  • 2021-09-24
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-12
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案