Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.InvalidMappingException: Could not parse mapping document from input stream(无法解析从输入的数据流映射文件)。
刚开始连index.action页面都是报404错误,检查了半天strut2.xml配置文件,后来才看到启动tomcat的时候,控制台就报错了:
Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.InvalidMappingException: Could not parse mapping document from input stream。
翻译过来:(错误创建bean名称“SessionFactory的定义在类路径资源[ ApplicationContext.XML ]:init方法调用失败;嵌套异常org.hibernate.invalidmappingexception:无法解析从输入的数据流映射文件)
根据最后一句话,无法从输入数据流映射文件,所以问题出现在hbm.xml文件,果然去看 many-to-one结点多了一条去错误属性。