我的springboot项目中使用了mybatis-flex,查询数据后报错:
2024-09-17 22:34:34.059 ERROR 6008 --- [nio-7073-exec-1] o.a.c.c.C.[.[.[.[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [/visitorbe] threw exception [Request processing failed; nested exception is java.lang.ClassCastException: com.cc.visitor.entity.UserWeixin cannot be cast to com.cc.visitor.entity.UserWeixin] with root cause
java.lang.ClassCastException: com.cc.visitor.entity.UserWeixin cannot be cast to com.cc.visitor.entity.UserWeixin
at com.cc.visitor.service.UserWeixinServiceImpl.select8Type(UserWeixinServiceImpl.java:40) ~[classes/:na]
at com.cc.visitor.controller.UserWeixinController.get8Type(UserWeixinController.java:30) ~[classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_171]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_171]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_171]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_171]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-5.3.23.jar:5.3.23]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) ~[spring-web-5.3.23.jar:5.3.23]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[spring-webmvc-5.3.23.jar:5.3.23]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) ~[spring-webmvc-5.3.23.jar:5.3.23]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.23.jar:5.3.23]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.23.jar:5.3.23]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1071) ~[spring-webmvc-5.3.23.jar:5.3.23]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:964) ~[spring-webmvc-5.3.23.jar:5.3.23]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.23.jar:5.3.23]
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) ~[spring-webmvc-5.3.23.jar:5.3.23]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:696) ~[tomcat-embed-core-9.0.68.jar:4.0.FR]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.3.23.jar:5.3.23]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:779) ~[tomcat-embed-core-9.0.68.jar:4.0.FR]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) ~[tomcat-embed-core-9.0.68.jar:9.0.68]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.68.jar:9.0.68]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.68.jar:9.0.68]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.68.jar:9.0.68]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.68.jar:9.0.68]
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.3.23.jar:5.3.23]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.23.jar:5.3.23]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.68.jar:9.0.68]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.68.jar:9.0.68]
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.3.23.jar:5.3.23]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.23.jar:5.3.23]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.68.jar:9.0.68]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.68.jar:9.0.68]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.23.jar:5.3.23]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.23.jar:5.3.23]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.68.jar:9.0.68]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.68.jar:9.0.68]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197) ~[tomcat-embed-core-9.0.68.jar:9.0.68]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) [tomcat-embed-core-9.0.68.jar:9.0.68]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) [tomcat-embed-core-9.0.68.jar:9.0.68]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) [tomcat-embed-core-9.0.68.jar:9.0.68]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.68.jar:9.0.68]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) [tomcat-embed-core-9.0.68.jar:9.0.68]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360) [tomcat-embed-core-9.0.68.jar:9.0.68]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399) [tomcat-embed-core-9.0.68.jar:9.0.68]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) [tomcat-embed-core-9.0.68.jar:9.0.68]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893) [tomcat-embed-core-9.0.68.jar:9.0.68]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1789) [tomcat-embed-core-9.0.68.jar:9.0.68]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.68.jar:9.0.68]
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) [tomcat-embed-core-9.0.68.jar:9.0.68]
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) [tomcat-embed-core-9.0.68.jar:9.0.68]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.68.jar:9.0.68]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_171]
实体类自己转换自己出错了?源码仓库是:https://gitee.com/chanchaw/visitor
mysql的脚本是
create table visitor.user_weixin
(
id int auto_increment comment '自增主键'
primary key,
open_id varchar(50) default '' null comment '微信openid,一般该长度为28个字符',
type int default 0 null comment '默认0表示普通访客,
10被访单位普通用户,11被访单位管理层,12被访单位总经理,13被访单位管理员,
20保安公司普通员工,21保安公司管理层,22保安公司总经理,23保安公司管理员,
30开发人员,31软件公司管理层,32软件公司总经理,33me',
nick_name varchar(100) default '' null comment '微信昵称',
real_name varchar(100) default '' null comment '真实姓名',
company varchar(100) default '' null comment '单位名称',
remark varchar(100) default '' null comment '备注',
seq float default 0 null comment '排序序号',
state int default 1 null comment '默认1有效,0停用,-1删除',
qr_scene varchar(300) default '' null comment '注册时扫描的二维码的内容',
subscribe_time datetime null comment '关注公众号的时间',
union_id varchar(100) default '' null comment '微信上多平台的联合id',
gender varchar(20) default '' null comment '性别',
wechat_id varchar(100) default '' null comment '微信账号',
avatar varchar(200) default '' null comment '用户头像文件路径',
create_time datetime default CURRENT_TIMESTAMP null comment '创建时间,DB自动填充',
last_time datetime null comment '最后一次修改时间',
last_user varchar(100) default '' null comment '最后一次修改人'
)
comment '微信用户表';
我用的mybatis-flex版本号是 1.7.5,试过最新版本1.9.7一样的报错
MyBatis-Flex与Devtools集成异常
同一个类被多个类加载器多次加载
上面是vite.config.ts的别名配置 1.测试过别名注释在运行项目会报路径找不到,加上注释页面正常渲染(@符号) import App from "@/App.vue";
问题内容: 我正在对Oracle模式(Oracle版本10)进行一些重构,并且看到了很多使用提示的视图。在其他视图中,还存在其他类型的提示。为什么我应该使用提示?数据库不是基于查询的最佳选择吗?非常感谢! 问题答案: 这是一个很好的问题,但是没有一个单一的答案,因为存在不同类别的提示,不同的提示将适用于这些提示。http://docs.oracle.com/cd/E11882_01/server.
我有这个密码: 这给我留下了编译器对我大喊大叫: 我花了很长时间才明白我必须改变Vec 代码现在编译,但我完全不明白这里到底有什么问题。为什么要在Vec定义中发送代码?我的意思是,这个特性已经实现了发送克隆。对我来说,这看起来相当多余。 有人能和我分享他的智慧吗,为什么我必须这样修改代码?
在这个例子之后,我创建了一个工具提示。 由于某种原因,当我移动鼠标时,我的工具提示会闪烁。据我所知,函数会找到最近的数据点;因此,只要鼠标在矩形上,工具提示就应该始终显示。 有什么想法吗?这是我的小提琴: http://jsfiddle.net/samselikoff/zhMQ8/1/
增加一个属性为什么会报错 class_name, class_name2 又可以
左侧的 import App from './App.vue' 有红色波浪号 vscode 提示所 Could not find a declaration file for module './App.vue'. '/home/pon/Desktop/code/me/noface/src/App.vue.js' implicitly has an 'any' type.ts(7016) 为什么?