日期:2014-05-17  浏览次数:20772 次

SSH整合问题
报错:Error creating bean with name 'sessionFactory' defined in class path resource [DatabaseApplicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: Could not parse mapping document in input stream

我就是从零开始搭建一个SSH的框架,没有实体类,只是写了一个返回success的action和一个对应的jsp页面,但在tomcat下运行一直报错,请大家帮忙看下,谢谢了
web.xml:
XML code

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <!-- <display-name>SSO</display-name> -->
    <!-- spring+hibernate -->
      <filter>
        <filter-name>hibernateFilter</filter-name>
        <filter-class>
            org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
        </filter-class>
    </filter>
    <filter-mapping>
        <filter-name>hibernateFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <!-- spring监听器 -->
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <listener>
        <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
    </listener>
    <!-- struts核心控制 -->
    <filter>
          <filter-name>struts2</filter-name>
        <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
      </filter>
      <filter-mapping>
          <filter-name>struts2</filter-name>
          <url-pattern>/*</url-pattern>
      </filter-mapping>
      
      
      
      <!-- 数据库连接池 -->
      <resource-ref> 
        <description>
        </description> 
        <res-ref-name>SSOPool</res-ref-name> 
        <res-type>javax.sql.DataSource</res-type> 
        <res-auth>Container</res-auth>
        <res-sharing-scope>Shareable</res-sharing-scope> 
    </resource-ref>
    
      <!--  -->
      <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/applicationContext.xml</param-value>
    </context-param>
      
      <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
      
</web-app>


applicationContext.xml:
XML code

<?xml version="1.0" encoding="UTF-8"?>
<beans
    xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
    xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
    xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="
            http://www.springframework.org/schema/aop http:/