could not find resource ***/xxxxMap.xml,无法找到Java文件下的sqlMap.xml文件

在将Java工程转maven工程的时候,Java文件夹下的所有sqlMap.xml文件,启动项目的时候无法找到资源,第一时间,去看配置文件,spring有没有启动加载扫描,applicationContext.xml文件,

<!-- 自动扫描Bean -->
<context:component-scan base-package="cn.szyxt"/>


这个没问题,那就是项目pom配置,没有加载Java文件夹,在相应的项目pom下,加上下面的这些配置,应该就可以找到Java文件的xml资源了。

下面贴出配置,和遇到的错误信息。

pom 配置:

<build>
  <resources>
    <resource>
        <directory>src/main/java</directory>
        <includes>
            <include>**/*.xml</include>
        </includes>
    </resource>
  </resources>
</build>

错误信息:

 

严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'warnRecordsRptService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'warnRecordsRptDAOExtend': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlMapClient' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [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 cn/sqlmap/sms_server_config_SqlMap.xml

。。。中间错误信息。。。

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'warnRecordsRptDAOExtend': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlMapClient' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [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 cn/sqlmap/sms_server_config_SqlMap.xml

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值