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
改为 忘写了$符,取不出来,因此报错!
随机推荐
- JavaJavaScript小问题系列之JSON解析
1.错误消息及截图 这个很搞笑也很纠结,今天一开发妹子,发现一个问题: 服务端返回字符串"{\"phone\":\"15000000000\"}&qu ...
- Wincc flexable的按钮组态
1.题目 2.画面切换按钮组态 1)新建变量 2)组态画面进行命名 3)组态按钮常规 4)组态按钮属性 5)在事件中选择单击,系统函数中选择画面中的ActivateScreen函数切换画面 3.给变量 ...
- logstash结合zabbix报警安装部署
cd /usr/share/logstash/ vim Gemfile source "https://ruby.taobao.org/" ##修改成国内镜像站 source &q ...
- JavaWeb(三)servlet
Servlet * 什么是Servlet 是运行在web服务器端的Java应用程序,它使用JAVA语言编写,具有Java语言的优点.与Java程序的区别:Servlet对象主要封装了对Http请求的处 ...
- c#Reverse字符串
class Program { static void Main(string[] args) { // 输出 ypoc si yek eht string str = "the key i ...
- 关于request、response转发与重定向的简述
在做页面的请求与响应的时候我们多用request与response进行操作,而我们大家也知道,request是表示用户发向服务器的请求,而response是对用户请求的一个响应. 关于转发和重定向,通 ...
- webpack教程(六)——分离组件代码
先来运行一下webpack命令, 看到app.js才4k. 安装一下react npm install react --sava-dev 在app/index.js文件内引入react 运行webpa ...
- Java基础---网络编程
第一讲 概述 1.网络模型:OSI参考模型和TCP/IP参考模型 图示: 一般来说开发处于传输层和网际层,应用层为:FTP和HTTP协议等,传输层为:UDP和TCP等,网际层为:IP. 通常用 ...
- MySQL(五)DDL(数据定义语言)
SHOW CREATE TABLE 表名\G前言 前面在数据库的讲解中,其实很多东西都非常的细节,在以前的学习过程中我都是没有注意到的.可能在以后的工作中会碰到所以都是做了记录的. 接下来,我将分享的 ...
- C++中const关键字用法
为什么使用const?采用符号常量写出的代码更容易维护:指针常常是边读边移动,而不是边写边移动:许多函数参数是只读不写的.const最常见用途是作为数组的界和switch分情况标号(也可以用枚举符代替 ...