TypeMismatchException: Provided id of the wrong type for class zhongfucheng.user.entity.User.
今天在使用SSH框架做项目的时候出现了这个错误,找了我非常非常多的时间!!!!!!!
Struts Problem Report
Struts has detected an unhandled exception:
Messages: 1.Provided id of the wrong type for class zhongfucheng.user.entity.User. Expected: class java.lang.String, got class zhongfucheng.user.entity.User
2.Provided id of the wrong type for class zhongfucheng.user.entity.User. Expected: class java.lang.String, got class zhongfucheng.user.entity.User; nested exception is org.hibernate.TypeMismatchException: Provided id of the wrong type for class zhongfucheng.user.entity.User. Expected: class java.lang.String, got class zhongfucheng.user.entity.User
File: org/hibernate/event/def/DefaultLoadEventListener.java
Line number: 135
去网上搜也有类似的,一般都是Integer和String匹配不同。。。而我明明要的是String,给了我一个User对象。
Expected: class java.lang.String, got class zhongfucheng.user.entity.User
原来我在Service层的时候根据id删除记录,我把对象传递过去了。因为我的User对象也实现了Serializable接口!!!!这样就没有报任何错误!!!
原本我只要把id传递过去就行了!!!!!!我传了对象!!!很烦!!!!!
TypeMismatchException: Provided id of the wrong type for class zhongfucheng.user.entity.User.的更多相关文章
- org.hibernate.TypeMismatchException: Provided id of the wrong type for class cn.itcast.entity.User. Expected: class java.lang.String, got class java.lang.Integer at org.hibernate.event.internal.Defau
出现org.hibernate.TypeMismatchException: Provided id of the wrong type for class cn.itcast.entity.User ...
- org.hibernate.TypeMismatchException: Provided id of the wrong type for class *** Expected ***
今天上生产发现warn日志有异常,就查看了下: 2018-12-05 10:05:05.666 [pool-4-thread-1] ERROR org.springframework.batch.co ...
- Provided id of the wrong type for class pojo.Books. Expected: class java.lang.Integer, got class java.lang.Long
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment). log4j:WARN Please ...
- iOS Assigning to 'id<XXXDelegate>' from incompatible type 'BViewController *__strong'
在使用代理的时候, BViewController *BVC = [[BViewController alloc]init]; self.delegate = BVC; 出现这样的警告Assignin ...
- JSP页面使用EL表达式出现的问题:javax.el.PropertyNotFoundException: Property 'ID' not found on type java.lang.Str
问题描述: 1. 后台返回到JSP前台的的list,在jsp页面使用EL表达式遍历时出现如下问题:javax.el.PropertyNotFoundException: Property 'ID' n ...
- System.Security.SecurityException The type initializer for 'System.Data.Entity.Internal.AppConfig' threw an exception
[15/08/19 00:03:10] [DataManager-7292-ERROR] System.Reflection.TargetInvocationException: Exception ...
- Attaching an entity of type 'xxx' failed because another entity of the same type already has the same primary key value.
问题的详细描述: Attaching an entity of type 'xxxxx' failed because another entity of the same type already ...
- 警告:Assigning to 'id<Delegate>' from incompatible type 'ViewController *const_st
原因: 你自己写了代理,设置了 delegate = self.但是self 没有遵守这个协议 只需要遵守这个协议就可以消除警告.
- Property 'id' not found on type java.lang.String
改为 忘写了$符,取不出来,因此报错!
随机推荐
- 关于error C2872: 'LONG_PTR' : ambiguous symbol
今天用VS2010创建了一个add-in工程,使用常量INVALID_HANDLE_VALUE时,编译器就提示如下错误: error C2872: 'LONG_PTR' : ambiguous sym ...
- JavaScript之去除前后空格//g
使用正则表达式"//g"去除字符串中的前后空格."//"表示所要匹配的字符串,如前后空格为/^\s*|\s*$/,这里"^"表示以" ...
- Vue2.0父子组件之间和兄弟组件之间的数据交互
熟悉了Vue.js的同级组件之间通信,写此文章,以便记录. Vue是一个轻量级的渐进式框架,对于它的一些特性和优点,请在官网上进行查看,不再赘述. 使用NPM及相关命令行工具初始化的Vue工程,目录结 ...
- Netty SSL安全配置
Netty SSL安全配置 [TOC] 摘要 在研发蜂鸟部署平台的过程中,涉及到平台网关和前置agent的通信加密,虽然目前软件在内网中,但是由于蜂鸟平台和agent的特殊性,一旦被控制,部署的软件就 ...
- javaweb中重定向和请求转发(response.sendRedirect()和request.getRequestDispatcher(rul).forward(request,response)))的区别
先来两张图,方便理解: 可以看出,重定向时,是服务器向游览器重新发送了一个response命令,让游览器再次向url2发送请求,以获取url2的资源 而请求转发时,类似于是服务器自己向自己发了一个跳转 ...
- Java线程池之ThreadPoolExecutor
前言 线程池可以提高程序的并发性能(当然是合适的情况下),因为对于没有线程的情况下,我们每一次提交任务都新建一个线程,这种方法存在不少缺陷: 1. 线程的创建和销毁的开销非常高,线程的创建需要时间, ...
- 面试技巧,如何通过索引说数据库优化能力,内容来自Java web轻量级开发面试教程
上星期写了一个篇文章,数据库方面的面试技巧,如何从建表方面展示自己能力,承蒙管理员抬举,放入首页,也承蒙各位厚爱,两天内收获了将近770个点击,也一度进入48小时热榜. 为了感谢管理员和大家的支持,再 ...
- 迈向angularjs2系列(1):typescript指南
typescript指南 前言 typescript是angularjs2推荐使用的脚本语言.它由微软2012年首次发布. 一. typescript和javascript的区别 1.从遵循的规 ...
- MySQL插入、更新、删除数据
1.插入数据:由于下表的id会自增,故赋值null. 注意:字符串用' '单引号,不能双引号,英文状态下. 可以写上部分属性名进行插入操作,如bookTypeId没写,默认NULL. 也可以写上所 ...
- Centos7.2部署.Net Core2.0 WebApi
部署前准备 1.VisualStudio2017+.netcore2.0SDK 2.Centos7.2 3.SecureCRT,Xftp(根据自己喜好) 创建WebApi项目 修改Program.cs ...