Java 找不到资源com/rl/ecps/sqlMap/EBItemMapper.xml

Java 找不到资源com/rl/ecps/sqlMap/EBItemMapper.xml,java,spring,mybatis,Java,Spring,Mybatis,当我使用Maven在sqlMapConfig.xml文件中构建项目时,代码如下: <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration> <mappers> <mapper resource="com/rl/ecps/sql

当我使用Maven在sqlMapConfig.xml文件中构建项目时,代码如下:

  <!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
    <mappers>
        <mapper resource="com/rl/ecps/sqlMap/EbBrandMapper.xml"/>
        <mapper resource="com/rl/ecps/sqlMap/EbItemMapper.xml"/> 
    </mappers>
</configuration>
但是,当我按如下方式配置时,Tomcat不会异常启动 详情如下:

Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource com/rl/ecps/sqlMap/EbItemMapper.xml
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:288)
 <!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
    <mappers>
        <mapper resource="com/rl/ecps/sqlMap/EbBrandMapper.xml"/>
<!--        <mapper resource="com/rl/ecps/sqlMap/EbItemMapper.xml"/>  -->
    </mappers>
</configuration>

在我查看官方文件后,我确信这个配置没有问题。我不知道为什么会出错?请告诉我,谢谢

IOException:找不到资源com/rl/ecps/sqlMap/EbItemMapper.xml

错误很明显。找不到文件“com/rl/ecps/sqlMap/EbItemMapper.xml”。检查你的路径。看起来您在“com”之前忘记了一个正斜杠


使用“/com/rl/ecps/sqlMap/EbItemMapper.xml”。

首先,非常感谢。我使用eclipse开发工具。按住Ctrl键并用鼠标左键单击配置/com/rl/ecps/sqlMap/EbItemMapper.xml我可以访问此文件,但我发现我的真实文件是com/rl/ecps/sqlMap/EbItemMapper.xml。如果我使用此方法,eclipse对该文件不敏感name@LPGAD. 不客气。很高兴我能帮上忙。如果您将来有任何其他问题,请随时通知我们。