When I first learned Mybatis, I encountered the problem of Error building SqlSession

ps: In the process of learning the association mapping of Mybatis, I used Mybatis to handle many-to-many table relationships. Before that, I processed one-to-one and one-to-many table relationships respectively, and the code can run normally. In the many-to-many association mapping The problem of Error building SqlSession occurred . I searched many articles on the Internet and none of them matched my problem. Finally, I carefully checked the code and found the problem.

The error message is as follows:

The problem is that the <mapper> element forgot to set the namespace attribute

The namespace attribute of the <mapper> element specifies the namespace of the <mapper> element.

The problem was solved after adding the namespace attribute

Guess you like

Origin blog.csdn.net/qq_44575770/article/details/129532677