开发者

FileNotFoundException while running Spring and Ibatis based application on Tomcat

开发者 https://www.devze.com 2023-02-12 16:51 出处:网络
I am using Spring, ibatis for ORM. My app-config.xml look like <bean id=\"dataSource\" class=\"org.apache.commons.dbcp.BasicDataSource\"

I am using Spring, ibatis for ORM. My app-config.xml look like

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
    destroy-method="close">
    <property name="driverClassName" value="com.mysql.jdbc.Driver" />
    <property na开发者_运维问答me="url" value="jdbc:mysql://192.168.10.50/lmexdb_v1" />
    <property name="username" value="lmexdba" />
    <property name="password" value="lmexdba123#" />
</bean>

<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
    <property name="configLocation"
        value="classpath:com/platysgroup/lmex/server/mobile/dao/ibatis/SqlMapConfig.xml" />
</bean>


<bean id="mobileController" class="com.platysgroup.lmex.server.controller.MobileController">
    <property name="announcementService" ref="announcementService"></property>
    <property name="courseService" ref="courseService"></property>
    <property name="userService" ref="userService"></property>
</bean>

and I have my sqlmapconfig.xml file in src/webapp/spring.

But when I run my application on tomcat it show me a exception:

java.io.FileNotFoundException: class path resource [com/platysgroup/lmex/server/mobile/dao/ibatis/SqlMapConfig.xml] cannot be opened because it does not exist


put it in src , and it will be available

if you are using maven project then add it to resource

0

精彩评论

暂无评论...
验证码 换一张
取 消