IDEA遇到毛病集锦:
1. Mapper 中遇到:
The content of element type "mapper" must match "(cache-ref|cache|resultMap*|parameterMap*|sql*|
insert*|update*|delete*|select*)+".
这是因为标签不完整,或者是因为注释的那部分不完整;
2. 运行项目中遇到问题:
Failed to load ApplicationContext
运行Tomcat , 遇到一个问题,can't found application-context.xml
class path resource [springmvc.xml] cannot be opened because it does not exist
--第一种:在网上找了很多答案,说是因为 mybatis 中的web.xml 文件中的位置放错了,这是指向的位置classpath,她会找到第一个匹配的文件,加个*号,会找更多,所以有人通过这个解决了。
这个classpath 所指向的位置,一定要准确,自己先好好看看自己放在了哪里哈~~
--第二种:没有配置resource 资源指向的位置(好像这个为第一种。。无所谓啦~~)
--第三种:gradle 错误,重新把项目导进来就可以了(我是第三种)
--第四种:emmmm,看了网上的教程,还有一种是自己实例化application-context.xml 的位置
ApplicationContext applicationContext=new ClassPathXmlApplicationContext("application-context.xml");
如果是多重目录的话(比如是放在resources下的spring文件下的),括号里就变成:
"spring/application-context.xml"
3. 还有一个待解决的问题:
Disconnected from the target VM, address: '127.0.0.1:51443', transport: 'socket'
明天再看看咋了。。。这个好烦啊~~~~