spring配置文件怎么也找不出是哪错了,虽然提示信息明显

这是提示的错误信息:
大致意思是缺少id为sessionFactory的元素,但我明明定义了呀,真得找不出是哪错了……
·································································································
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanDefinitionStoreException: Line 97 in XML document from ServletContext resource [/WEB-INF/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: An element with the identifier "sessionFacotry" must appear in the document.
org.xml.sax.SAXParseException: An element with the identifier "sessionFacotry" must appear in the document.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:222)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:173)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:148)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:128)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:144)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:126)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:89)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:262)
at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:139)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1116)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1214)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Unknown Source)
2009-7-5 23:31:42 org.apache.catalina.core.StandardContext start
严重: Error listenerStart
2009-7-5 23:31:42 org.apache.catalina.core.StandardContext start
严重: Context [/SSH2] startup failed due to previous errors
2009-7-5 23:31:42 org.apache.catalina.core.ApplicationContext log
信息: Closing Spring root WebApplicationContext
··································································································
这是我的spring配置文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans-2.0.dtd">

<!-- 配置数据源与事务 -->
<bean id = "dataSource" 
              class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
    <property name="driverClassName">
        <value>oracle.jdbc.driver.OracleDriver</value>
    </property>
    <property name="url">
        <value>jdbc:oracle:thin:@localhost:1521:ora92</value>
    </property>
    <property name="username" value="asfd" />
    <property name="password" value="sadf" />
</bean>


<!-- 配置Hibernate -->
<bean id="sessionFactory" 
              class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    <property name="dataSource">
        <ref local="dataSource" />
    </property>
    <property name="mappingResources">
        <list>
            <value>hibernate/bean/Usertable.hbm.xml</value>
        </list>
    </property>
    <property name="hibernateProperties">
        <props>
           <prop key="hibernate.dialect">
                                 org.hibernate.dialect.OracleDialect</prop>
           <prop key="hibernate.show_sql">true</prop>
        </props>
    </property>
</bean>

<!-- 配置事务 -->
<bean id="transactionManager" 
              class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    <property name="sessionFactory">
        <ref local="sessionFactory" />
    </property>
</bean>

<!-- 配置DAO -->
<!-- usertableDAO" -->
<bean id="userDAO" class="hibernate.dao.StudentDAO">
    <property name="sessionFactory">
        <ref local="sessionFacotry"/>
    </property>
</bean>

<!-- 配置DAO事务 -->
<bean id="useDAOProxy" 
              class="org.springframework.transaction.interceptor.TransacionProxyBean">
    <property name="transactionmanager">
        <ref bean="transactionManager" />
    </property>
    <property name="target">
        <ref local="userDAO"/>
    </property>
    <property name="transactionAttributes">
        <props>
            <prop key="insert*">PROPAGATION_REQUIRED</prop>
            <prop key="*">PROPAGATION_REQUIRED, readOnly</prop>
        </props>
    </property>
</bean>

<!-- 配置拦截器 -->
<bean name="logger" class="com.demo.spring.aop.LoggingInterceptor"></bean>

<!-- 配置拦截器代理 -->
<bean name="logginAutoProxy"  
              class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
    <property name="beanNames">
        <list>
            <value>/login</value>
            <value>/register</value>
        </list>
    </property>
    <property name="interceptorNames">
        <list>
            <value>logger</value>
        </list>
    </property>
</bean>

<!-- Action配置 -->
<bean name="Login" class="strtus2.actions.LoginAction"> 
    <property name="userDAO">
        <ref local="userDAO" />
    </property>
</bean>
<bean name="Register" class="struts2.actions.Register"> 
    <property name="userDAO">
        <ref local="userDAO" />
    </property>
</bean>


································································································
有时间帮一下忙,真得被它搞死了
谢谢了

1个回答

[code="java"]<!-- 配置DAO -->





[/code]

拼写错误了吧
sessionFacotry 还是 sessionFactory

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