エラー:classpath resource[com/qinkangdeid/mapping/]cannot be resolved to URL because it does not exist


参照先:http://www.jianshu.com/p/800fe918cc7a ssm統合時にエラーが発生しました:
Caused by: java.lang.IllegalArgumentException: Could not resolve resource location pattern [classpath:com/qinkangdeid/mapping/*.xml]: class path resource [com/qinkangdeid/mapping/] cannot be resolved to URL because it does not exist

at org.springframework.core.io.support.ResourceArrayPropertyEditor.setAsText(ResourceArrayPropertyEditor.java:140)
    at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:430)
    at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:403)
    at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:181)
    at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:459)
    ... 72 more

解決:プロファイルの下でxmlファイルがスキャンされません:元のファイル:

    
    
    


classpathをclasspathに変更*

    
    
    


テストの実行:org.apache.ibatis.binding.BindingException:Invalid bound statement(not found):com.qinkangdeid.dao.UserMapper.selectByPrimaryKey 报错:classpath resource [com/qinkangdeid/mapping/] cannot be resolved to URL because it does not exist_第1张图片
解決:warパッケージにはMapper対応のxmlファイルが欠けています.つまり、xmlファイルをパッケージ化していません.解決策はpom.xmlファイルのbuildラベルに次のコードを追加し、xmlファイルをwarパッケージに強制的に打ち込むことです.
报错:classpath resource [com/qinkangdeid/mapping/] cannot be resolved to URL because it does not exist_第2张图片
 
        <resources>
            <resource>
                <directory>src/main/javadirectory>
                <includes>
                    <include>**/*.xmlinclude>
                includes>
                <filtering>falsefiltering>
            resource>
        resources>

再テスト、成功:报错:classpath resource [com/qinkangdeid/mapping/] cannot be resolved to URL because it does not exist_第3张图片