开发者社区> 问答> 正文

struts spring 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>

展开
收起
小旋风柴进 2016-03-04 14:55:56 2296 0
1 条回答
写回答
取消 提交回答
  • 找不到这个applicationContext.xml文件,你的文件配置路径不对,查一下

    2019-07-17 18:52:19
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
workshop专场-微服务专场-开发者动手实践营-微服务-Spring Cloud Alibaba 微服务全家桶体验 立即下载
云栖社区特邀专家徐雷Java Spring Boot开发实战系列课程(第20讲):经典面试题与阿里等名企内部招聘求职面试技巧 立即下载
微服务架构模式与原理Spring Cloud开发实战 立即下载

相关实验场景

更多