ssh整合后配置事物,出现错误,下面为配置内容<?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:context="http://www.springframework.org/schema/context"  
    xmlns:tx="http://www.springframework.org/schema/tx"  
    xmlns:aop="http://www.springframework.org/schema/aop"  
    xsi:schemaLocation="   
        http://www.springframework.org/schema/beans    
        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd   
        http://www.springframework.org/schema/context    
        http://www.springframework.org/schema/context/spring-context-3.0.xsd   
        http://www.springframework.org/schema/tx   
        http://www.springframework.org/schema/tx/spring-tx-3.0.xsd   
        http://www.springframework.org/schema/aop   
        http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">        <context:component-scan base-package="com">
      <context:exclude-filter type="annotation" expression="org.springframework.stereotype.controller"/>
      </context:component-scan>
      
      <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
      <property name="locations">
      <list>
        <value>/WEB-INF/prop/database.properties</value>
      </list>
      </property>
      </bean> <bean id="datasource"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName"
value="com.mysql.jdbc.Driver">
</property>
<property name="url" value="jdbc:mysql://localhost:3306/ly"></property>
<property name="username" value="root"></property>
<property name="password" value="123456"></property>
</bean>
<bean id="SessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="datasource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>com/ly/entity/Lytab.hbm.xml</value>
<value>com/ly/entity/Returnly.hbm.xml</value>
</list>
</property></bean>


<bean id="myHibTransactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="SessionFactory" />
</bean> <tx:advice id="txAdvice"
transaction-manager="myHibTransactionManager">
<tx:attributes>
<tx:method name="int*" propagation="REQUIRED" />
<tx:method name="del*" propagation="REQUIRED" />
<tx:method name="update*" propagation="REQUIRED" />
<tx:method name="do*" propagation="REQUIRED" />
<tx:method name="*" propagation="SUPPORTS" read-only="true" />
</tx:attributes>
</tx:advice>
<aop:config>
<aop:pointcut id="bizMethods"
expression="execution(* com.ly.dao.impl.*.*(..))" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="bizMethods" />
</aop:config>

<bean id="Basedao" class="com.ly.dao.impl.Basedao" abstract="true">
<property name="sessionFactory" ref="SessionFactory"></property>
</bean>

<bean id="lydaoimpl" class="com.ly.dao.impl.lydaoimpl" parent="Basedao"></bean>

<bean id="bizimpl" class="com.ly.biz.impl.bizimpl">
<property name="lydaoimpl" ref="lydaoimpl"></property>
</bean>

<bean name="/base" id="baseauction" class="com.ly.auction.Baseauction" ></bean>

<bean name="/tj" class="com.ly.auction.lyauction" parent="baseauction">
<property name="bizimpl" ref="bizimpl"></property>
</bean>
</beans>
严重: action: null
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/context]
Offending resource: ServletContext resource [/WEB-INF/applicationContext.xml][/i]
........
2010-8-19 18:15:17 org.apache.catalina.core.ApplicationContext log
信息: Marking servlet action as unavailable
2010-8-19 18:15:17 org.apache.catalina.core.StandardContext loadOnStartup
严重: Servlet /Ssh threw load() exception
javax.servlet.UnavailableException
at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:880)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
......

解决方案 »

  1.   

    你的配置文件是Spring3 的哦,你的jar有没有对应Spring3的版本呢?
      

  2.   


    <?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:context="http://www.springframework.org/schema/context"   
      xmlns:tx="http://www.springframework.org/schema/tx"   
      xmlns:aop="http://www.springframework.org/schema/aop"   
      xsi:schemaLocation="   
      http://www.springframework.org/schema/beans   
      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd   
      http://www.springframework.org/schema/context   
      http://www.springframework.org/schema/context/spring-context-3.0.xsd   
      http://www.springframework.org/schema/tx   
      http://www.springframework.org/schema/tx/spring-tx-3.0.xsd   
      http://www.springframework.org/schema/aop   
      http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">   
    这个头不合适 重新从别的地方拷一份过去就好了! 我出现过好几次 我也不知道怎么回事!