Robertas Setkus
Robertas Setkus

Reputation: 3161

Mybatis(iBatis) XML mapping configuration

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.

Upvotes: 3

Views: 10157

Answers (1)

MattSenter
MattSenter

Reputation: 3120

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>

Upvotes: 3

Related Questions