您好,登錄后才能下訂單哦!
本篇內容主要講解“怎么解決Java中的Type definition error問題”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實用性強。下面就讓小編來帶大家學習“怎么解決Java中的Type definition error問題”吧!
<html><body><h2>Whitelabel Error Page</h2><p>This application has no explicit mapping for /error, so you are seeing this as a fallback.</p><div id='created'>Tue Jul 09 09:31:20 CST 2019</div><div>There was an unexpected error (type=Internal Server Error, status=500).</div><div>Type definition error: [simple type, class org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: com.jpadata.entity.User$HibernateProxy$W5saRQuh["hibernateLazyInitializer"])</div></body></html>
這個錯誤的解決方案: JsonIgnoreProperties({"hibernateLazyInitializer","handler"})//添加這一行
@Entity
@Table(name = "tbl_user")//可以省略 public class User {
[@Id](https://my.oschina.net/u/3451001)@GeneratedValue(strategy = GenerationType.IDENTITY) private Integer id; @Column(name = "last_name",length = 50) private String lastName; @Column //省略的寫法 private String email;
到此,相信大家對“怎么解決Java中的Type definition error問題”有了更深的了解,不妨來實際操作一番吧!這里是億速云網站,更多相關內容可以進入相關頻道進行查詢,關注我們,繼續學習!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。