3

I'm using MyBatis 3.2.2 and I have problems loading XML mappers as resources.

<mappers>
    <mapper resource="src/main/resources/Conference.xml" />
</mappers>

Exception

nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource src/main/resources/Conference.xml

Project is builed by Maven.

1
  • 1
    Try specifying the package name by itself, if your source folder is "src", it would just be main/resources/Conference.xml Commented Nov 1, 2013 at 22:23

1 Answer 1

3

You are using Maven, so you can leave off the src/main/resources path altogether, as Conference.xml will be found at the root of your classpath. This should work:

<mappers>
    <mapper resource="Conference.xml" />
</mappers>
Sign up to request clarification or add additional context in comments.

1 Comment

Cause I got exception parsing Conference.xml so I think problem is solved. The resource was found. And mybatis-config.xml, and all mappers xml configs are in the same src/main/resources folder.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.