TypeMismatchException: Provided id of the wrong type for class zhongfucheng.user.entity.User.
2017-05-23 20:25
746 查看
今天在使用SSH框架做项目的时候出现了这个错误,找了我非常非常多的时间!!!!!!!
去网上搜也有类似的,一般都是Integer和String匹配不同。。。而我明明要的是String,给了我一个User对象。
原来我在Service层的时候根据id删除记录,我把对象传递过去了。因为我的User对象也实现了Serializable接口!!!!这样就没有报任何错误!!!
原本我只要把id传递过去就行了!!!!!!我传了对象!!!很烦!!!!!
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
- hibernate.TypeMismatchException: Provided id of the wrong type for class
- SSH报错之 Provided id of the wrong type for class model.User. Expected: class java.lang
- Caused by: org.hibernate.TypeMismatchException: Provided id of the wrong type. Expected: class java.lang.Integer, got class [Lja
- Provided id of the wrong type for class pojo.Books. Expected: class java.lang.Integer, got class java.lang.Long
- Provided id of the wrong type for class
- hibernate 中 Provided id of the wrong type for class 异常
- hibernate 错误:Provided id of the wrong type for class com.lhaix.pojo.Test. Expected: class java.la
- Exception in thread "main" org.hibernate.TypeMismatchException: Provided id of the wrong type
- Hibernate异常:Provided id of the wrong type for class
- org.hibernate.WrongClassException: Object with id: 3 was not of the specified subclass
- java.lang.IllegalArgumentException: No converter found for return value of type: class
- java.lang.IllegalArgumentException: No converter found for return value of type: class java.util.Has
- java.lang.IllegalArgumentException: No converter found for return value of type: class java.util.Has
- java.lang.IllegalArgumentException: No converter found for return value of type: class java.util.Has
- The entity type FooterLogo is not part of the model for the current context.zai
- ReactJs 报错 Element type is invalid: expected a string (from built-in components) or a class/function (for composite components) but got: undefined. Check the render method of `Me`.
- java.lang.IllegalArgumentException: No converter found for return value of type: class Person
- This error is raised because the column 'type' is reserved for storing the class in case of inheritance