Maven Project: Invalid bound statement

Source: Internet
Author: User

You will encounter this problem when using MAVEN to do mybatis projects.


Invalid bound statement (not found)

Reason:

1. An implementation class that lacks an interface when it is developed in the original way.

2. Use an XML file that is less mapped when the agent is developed.

I'm using agent development when I'm having this problem, but I have a mapped XML file.

Here we follow a principle of agent development, the mapping class and the corresponding XML file should be in the same package, after compiling we look at the results

Without seeing the XML file, this is the reason for the report exception.

A configuration is also required to use MAVEN, because MAVEN will only process the configuration files in the resources, and the mapper XML file is in the Java folder, so it is ignored by Maven.

Solve the problem of not copying mapper mapping files

You need to modify the Pom file for DAO Engineering. Add the following content:

<!--If you do not add this node, the MyBatis mapper.xml file will be omitted.  -<Build>    <Resources>        <Resource>            <Directory>Src/main/java</Directory>            <includes>                <include>**/*.properties</include>                <include>**/*.xml</include>            </includes>            <filtering>False</filtering>        </Resource>    </Resources></Build>

*.properties and *.xml configuration files under Src/main/java are placed in the resources.

Maven Project: Invalid bound statement

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.