1.mybatis
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.i7i8i9.base1.mapper.SysUserMapper.queryList
原因:yml配置错误
错误配置:
#数mybatis
mybatis:
mapper-locations:
classpath: /mapper/*.xml
正确配置:
mybatis:
mapper-locations: classpath:/mapper/*.xml
2.HHH000342: Could not obtain connection to query metadata
后端和数据库都是docker运行的,且docker之间建了网络
在后端连接数据库docker时可以用内网ip,但要注意可以要用数据库docker自身端口,而不是映射服务器的端口
2.SpringBoot
Controller 请求报错
No primary or single unique constructor found for interface javax.servlet.http.HttpServletRequest
原因:导入错了包
错误的
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
正确的
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
声明未加@AutoWired
Cannot invoke "com.i7i8i9.ebook3.weixin.service.WeiXinService.initJSSDKConfigInfo(String)" because "this.weiXinService" is null
3.Vue3 TS导入文件报错
Internal server error: Failed to resolve import "./router" from "src/main.ts". Does the file exist?
修改配置
vite.config.ts
主要是extensions这一行
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from "path"
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
// 为了实现@可以跳转
resolve: {
extensions:['.js','.vue','.json','.ts'],
alias: {
'@': path.resolve(__dirname, 'src') // 兼容src目录下的文件夹可通过 @/components/HelloWorld.vue写法
// '@': path.join(__dirname, 'src') // 兼容src目录下的文件夹可通过 @/components/HelloWorld.vue写法
}
},
})