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

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





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

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

pom 配置:


  
    
        src/main/java
        
            **/*.xml
        
    
  

错误信息:

 

严重: 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

你可能感兴趣的:(could not find resource ***/xxxxMap.xml,无法找到Java文件下的sqlMap.xml文件)