web.xml内容:
<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>

<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>

解决方案 »

  1.   

    applicationContext.xml内容:
    <?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"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
    <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"></property>
    <property name="url" value="jdbc:oracle:thin:@se02:1521:KJ509"></property>
    <property name="username" value="user_509"></property>
    <property name="password" value="system"></property>
    <property name="maxActive" value="100"></property>
    <property name="maxIdle" value="30"></property>
    <property name="maxWait" value="500"></property>
    <property name="defaultAutoCommit" value="true"></property>
    </bean>

    <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    <property name="dataSource" ref="dataSource"></property>
    <property name="hibernateProperties">
    <props>
    <prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>
    <prop key="hibernate.show_sql">true</prop>
    </props>
    </property>
    <property name="mappingResources">
    <list>
    <value>com/testSpring3/bean/User.hbm.xml</value>
    </list>
    </property>
    </bean>

    <bean id="userDao" class="com.testSpring3.dao.impl.UserDAOImpl" scope="singleton">
    <property name="sessionFactory">
    <ref bean="sessionFactory"/>
    </property>
    </bean>

    <bean id="userService" class="com.testSpring3.service.impl.UserServiceImpl">
    <property name="userDao" ref="userDao"></property>
    </bean>

    <bean id="saveUserAction" class="com.testSpring3.action.user.SaveUserAction" scope="prototype">
    <property name="service" ref="userService"></property>
    </bean>

    <bean id="listUserAction" class="com.testSpring3.action.user.ListUserAction" scope="prototype">
    <property name="service" ref="userService"></property>
    </bean></beans>
      

  2.   

    注意
    dataSoursedataSource
      

  3.   

    貌似我的代码里面没有'dataSourse'啊...
      

  4.   

    请问这个dataSourse是在哪里的...
      

  5.   

    我感觉是这里<property name="url" value="jdbc:oracle:thin:@se02:1521:KJ509"></property>
    url貌似不对吧,thin:@后面应该是ip地址啊
      

  6.   

    这个se02就是数据库服务器的名字,之前可以连上这么写是没问题的,而且我试过改成ip地址也是同样的错误
      

  7.   

    Cannot resolve reference to bean 'dataSourse' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'dataSourse' is defined
    dataSourse--------引用的时候有些地方把dataSource写成了dataSourse
      

  8.   

    很明显你有地方把dataSource写成了dataSourse