今天在使用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.的更多相关文章

  1. 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 ...

  2. 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 ...

  3. 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 ...

  4. iOS Assigning to 'id<XXXDelegate>' from incompatible type 'BViewController *__strong'

    在使用代理的时候, BViewController *BVC = [[BViewController alloc]init]; self.delegate = BVC; 出现这样的警告Assignin ...

  5. 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 ...

  6. 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 ...

  7. 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 ...

  8. 警告:Assigning to 'id<Delegate>' from incompatible type 'ViewController *const_st

    原因: 你自己写了代理,设置了   delegate = self.但是self 没有遵守这个协议 只需要遵守这个协议就可以消除警告.

  9. Property 'id' not found on type java.lang.String

    改为 忘写了$符,取不出来,因此报错!

随机推荐

  1. 解决WebUploader在谷歌浏览器中反应缓慢迟钝

    修改  初始化webuploader的 js accept: null/*{ title: 'Images', extensions: 'gif,jpg,jpeg,bmp,png', mimeType ...

  2. 【Ubuntu 16】启动Eclipse Indigo报错 error code1 jdk没有配置好

    在/etc/profile下配置好JAVA_HOME CLASSPATH PATH 这些变量后 eclipse启动jvm并不能直接按照这些变量来启动 需要使用命令 update-alternative ...

  3. 【Ubuntu 16】安装net-snmp

    使用tar.gz压缩包安装mongodb时报错,没有库文件 libnetsnmpmibs.so.3o cannot open file or directory 在网上找了一篇文章 需要安装net-s ...

  4. jquery layer弹窗弹层插件 (转)

    /* 先去官网下载最新的js  http://sentsin.com/jquery/layer/ ①引用jquery ②引用layer.min.js */ 触发弹层的事件可自由绑定,如: $('#id ...

  5. 阿里云ECS部署ES

    背景 最近越来越多的公司把业务搬迁到云上,公司也有这个计划,自己抽时间在阿里云和Azure上做了一些小的尝试,现在把阿里云上部署ES和kibana记录下来.为以后做一个参考,也希望对其他人有帮助. 这 ...

  6. 注册WinEdt 7

    1. 先用crack算出注册码(crack在这里下载:http://download.csdn.net/detail/setoy/4384553) 放到winedt安装目录下,用管理员权限运行,点pa ...

  7. thinkjs 文件上传

    采用thinkjs框架写前后端 let formdata = new FormData($('form')[0]); $('#fileUpload').submit(function (e) { e. ...

  8. vue.js路由参数简单实例讲解------简单易懂

    vue中,我们构建单页面应用时候,一定必不可少用到vue-router vue-router 就是我们的路由,这个由vue官方提供的插件 首先在我们项目中安装vue-router路由依赖 第一种,我们 ...

  9. MVC配置伪静态

    提出需求 伪静态能提高搜索引擎收录,还不影响硬盘寿命,是一个不错的选择,但是会增加CPU和内存开销,由于时候也需要实现伪静态. web.config配置 <system.webServer> ...

  10. Eclipse注释模板设置方法

    设置注释模板的入口:Window->Preference->Java->Code Style->Code Template 然后展开Comments节点就是所有需设置注释的元素 ...