idea xml file is not compiled error (continually updated)

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)


  Similarly, Baidu search program after they did not find the problem. Question roughly meaning: problem dao interface mapper profile appears in the mapped bindings do when mybatis in short, it is the interface with the xml is either not found or is found not to match it.

  Online solutions:

    Eleven perform the following steps:

    1: package name check xml file is located and whether the interface corresponding package name one by one

    2: namespace check whether xml file xml file name and the package of correspondence

    3: Check whether the function name corresponding to the

    4: remove the xml file Chinese comments

    5: free to add a space or blank line xml file and save

  But I repeat that order the investigation to no avail, and finally found in src / target / classes / ... .java file directory only, no corresponding xml file, meaning xml

File not compiled over.

  

 

  solution:

  1, copied directly to the corresponding xxxMapper.xml to src / target .java files in the same directory,

  

  2, the build pom.xml file add the following, attention <resource> write <resources> which:

  

  xxMapper.xml file so that later on will come to compile, run, success!

 

  Xml files belonging to the above resolved in src / main / java inside, if xml java in the same directory, as follows:

 

In mybatis hibernate and get the project, will sometimes xml java directory on the outside, but the idea did not compile, then also pom.xml configuration file:

Run, run up successfully.

Guess you like

Origin www.cnblogs.com/magict/p/11204150.html