spring 加载hibernate配置文件时候tomcat无法启动

我在做一个web项目的入门小例子,可是tomcat无法启动 。

服务器为 :tomcat 5
开发环境为: spring+hibernate+struts

spring的配置文件如下: 红色的地方是出问题的地方。把红色的地方注释掉才能启动。
?xml version="1.0" encoding="UTF-8"?>

xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">






class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">

[color=red] <property  name = "mappingResources"> 
    <list>
    <value>/Login.hbm.xml</value>
    </list>

    </property> [/color]   

    <!--   <property name ="hibernateProperties">
    <props>
    <prop key = "hibernate.dialect">org.hibernate.dialect.MySQLDBDialect</prop>
    </props>
    </property>  -->
</bean>

<!-- 

<bean id="LoginDAO" class="com.advertisement.login.dao.LoginDAO">
    <property name="sessionFactory">
        <ref bean="sessionFactory"></ref>
    </property>
</bean>

<bean id = "facadeManager"  class = "com.advertisement.login.manager.FacadeManager">
<property name = "loginDAO" ref = "LoginDAO"/>
</bean>                


-->

<bean name = "/loginAction"  class = "com.advertisement.login.action.LoginAction">
<!--  <property name = "facadeManager"  ref = "facadeManager"/>-->
</bean>

</beans>

struts的配置文件如下 。 从struts中启动spring

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd">







type= "com.advertisement.login.action.LoginAction"
name = "loginForm"
validate="false"
input = "/login1.jsp">




hibernate的映射文件如下::

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">




















2个回答

org.springframework.orm.hibernate3.LocalSessionFactoryBean可没有mappingResources属性




classpath*:Login.hbm.xml



看看各种写法
http://hlbng.iteye.com/blog/397266



Login.hbm.xml

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问