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
改为 忘写了$符,取不出来,因此报错!
随机推荐
- 从零宽断言说起到用python匹配html标签内容
版权声明:本文为博主原创文章,转载请附带原文网址http://www.cnblogs.com/wbchanblog/p/7411750.html ,谢谢! 提示:本文主要是讲解零宽断言,所以阅读本文需 ...
- Python输入函数 raw_input( ) 与 input()
一. raw_input() 在Python中,获取键盘输入的数据的方法是采用 raw_input 函数,那么这个 raw_input 怎么用呢? 注意: raw_input()的小括号中放入的是,提 ...
- linux学习网站
centos中文站 cnblogs.com/bethal/p/6007962.html 最火软件 veryhuo.com 学网资讯 xue163.com/Network/ linux大神 linux ...
- Java 环境设置
Java 环境设置 本地环境设置 如果你依然想要为 Java 编程语言设置环境,那么本节将指导你如何在你的电脑上下载和设置 Java.请按照以下步骤进行环境设置. Java SE 可以从下载 Java ...
- 如何生成转储(dmp)文件--工具篇
转储文件也就是我们常说的dump文件.可以把转储文件看成软件的某个时刻的一个快照.转储文件一般都是在软件出现问题时手动生成或者程序自动生成.下面我们介绍几种生成转储文件的方法. 1. 任务管理器 任务 ...
- [2017-07-18]logstash配置示例
提醒 /etc/logstash/conf.d/下虽然可以有多个conf文件,但是Logstash执行时,实际上只有一个pipeline,它会将/etc/logstash/conf.d/下的所有con ...
- spring-session 共享
Spring session 共享 一.引入依赖 <dependency> <groupId>redis.clients</groupId> <artifac ...
- FileDetector-基于java开发的照片整理工具
1. 项目背景 开发这个功能的主要原因如下: 1. 大学期间拍摄了约50G的照片,照片很多 2. 存放不规范,导致同一张照片出现在不同的文件夹内,可读性差,无法形成记忆线. 3. 重复存放过多,很多照 ...
- 快速排序/快速查找(第k个, 前k个问题)
//快速排序:Partition分割函数,三数中值分割 bool g_bInvalidInput = false; int median3(int* data, int start, int end) ...
- ORACLE SEQUENCE的简单介绍
先假设有这么一个表: create table S_Depart ( DepartId INT not null, DepartName NVARCHAR2() not null, DepartOrd ...