例外:
Caused by: org.springframework.core.NestedIOException: Failed to parse config resource: ServletContext resource [/WEB-INF/SqlMapConfig.xml]; nested exception is com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: java.io.IOException: Could not find resource WEB-INF/ADCampaignDetailsSQLMap.xml
SqlMapConfig.xml 文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMapConfig PUBLIC "-//iBATIS.com//DTD SQL MAP Config 2.0//EN" "http://www.ibatis.com/dtd/sql-map-config-2.dtd">
<sqlMapConfig>
<settings useStatementNamespaces="true"/>
<sqlMap resource="WEB-INF/ADCampaignDetailsSQLMap.xml"/>
</sqlMapConfig>
ADCampaignDetailsSQLMap.xml 放在我的项目文件夹的 WEB-INF 中
当我将战争文件复制到 webapps 文件夹时,会引发上述异常。
谁能给我解决这个问题?
提前致谢
编辑:
构建.xml
<?xml version="1.0" encoding="UTF-8"?>
<project
name="adblendservice"
default="war" >
<property environment="env" />
<property
name="builddir"
value="build/" />
<property
name="srcdir"
value="src/main/java/" />
<property
name="deploydir"
value="deploy/" />
<property
name="wardir"
value="src/main/webapp/" />
<property
name="libdir"
value="${wardir}/WEB-INF/lib/" />
<property file="build.properties" />
<path id="project-classpath" >
<fileset
dir="web/WEB-INF/lib"
includes="*.jar" />
<fileset
dir="${tomcat-home}/lib"
includes="*.jar" />
<!--
<fileset dir="${tomcat-home}/common/lib" includes="*.jar" />
<fileset dir="${tomcat-home}/server/lib" includes="*.jar" />
-->
</path>
<target name="clean" >
<delete
dir="${builddir}"
failonerror="true" />
<echo message="Creating build directories" />
</target>
<target name="war" >
<mkdir dir="${builddir}" />
<mkdir dir="${builddir}/adblendservice/WEB-INF/classes" />
<mkdir dir="${deploydir}" />
<path id="basepath" >
<fileset dir="${wardir}/WEB-INF/lib" >
<include name="**/*.jar" />
</fileset>
</path>
<javac
destdir="${builddir}/adblendservice/WEB-INF/classes"
includeantruntime="false"
srcdir="${srcdir}" >
<classpath refid="basepath" />
</javac>
<war
update="update"
warfile="${builddir}/adblendservice.war"
webxml="${wardir}/WEB-INF/web.xml" >
<classes dir="${builddir}/adblendservice/WEB-INF/classes" />
<fileset dir="${srcdir}" >
<include name="**/*.xml" />
</fileset>
<lib dir="${wardir}/WEB-INF/lib" />
<fileset dir="${wardir}" >
<include name="**/*.xml" />
</fileset>
</war>
</target>
<target
name="deploy"
depends="clean, war" >
<copy
file="${builddir}/adblendservice.war"
todir="${deploydir}" >
</copy>
</target>
</project>