In my spring-ibatis.xml, I need to config sqlMapClient:
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation" value="com/rujuanmodel/SqlMapConfig.xml" />
<property name="dataSource" ref="dataSource" />
</bean>
When I deploy it to tomcat, it always gives me an error:
Could not open PortletContext resource [/com/rujuan/model/SqlMapConfig.xml]
The thing is when it deploys to webapp, the path has changed. So we need to config like this:
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation" value="classpath:com/rujuan/model/SqlMapConfig.xml" />
<property name="dataSource" ref="dataSource" />
</bean>
then it works!