我正在使用Spring,ibatis for ORM。我app-config.xml
樣子在Tomcat上運行基於Spring和Ibatis的應用程序時FileNotFoundException
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="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>
,我有我的sqlmapconfig.xml
文件中src/webapp/spring.
但是當我在Tomcat上運行我的應用程序它告訴我一個例外:
java.io.FileNotFoundException:類路徑資源[com/platysgroup/lmex/server/mobile/dao/ibatis/SqlMapConfig.xml]無法打開,因爲它不存在
你會試圖在開始添加一個「/」這將是可用的
?像那個類路徑:/com/platysgroup/lmex/server/mobile/dao/ibatis/SqlMapConfig.xml – 2011-02-23 14:28:31