zhucezhanghu1
zhucezhanghu1
2015-09-28 12:19

struts spring mybatis 整合出问题

  • spring
  • struts
  • mybatis

报错:
IOException parsing XML document from ServletContext resource [/applicationContext.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/applicationContext.xml]

配置文件applicationContext.xml

</beans>
<!-- 数据库连接池 -->
 <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
    <property name="driverClass" value="com.mysql.jdbc.Driver"/>
    <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/test" />
    <property name="user" value="root" />
    <property name="password" value="admin" />
    <property name="initialPoolSize" value="10" />
    <property name="minPoolSize" value="5" />
    <property name="maxPoolSize" value="30" />
    <property name="acquireIncrement" value="10" />
    <property name="maxIdleTime" value="10" />
    <property name="maxStatements" value="0" />
</bean>

<!-- 使用spring的会话管理 -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
    <property name="dataSource" ref="c3p0dataSource" />
    <property name="configLocation" value="classpath:Configuration.xml" />
</bean>

<!-- 使用spring的事务管理 -->
 <bean name="transactionManager"
    class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
    <property name="dataSource" ref="dataSource"></property>
</bean>
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

4条回答

为你推荐