怎么解決Java中的Typedefinitionerror問題

本篇內容主要講解“怎么解決Java中的Type definition error問題”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實用性強。下面就讓小編來帶大家學習“怎么解決Java中的Type definition error問題”吧!

創(chuàng)新互聯(lián)公司專注于建德網站建設服務及定制,我們擁有豐富的企業(yè)做網站經驗。 熱誠為您提供建德營銷型網站建設,建德網站制作、建德網頁設計、建德網站官網定制、微信小程序開發(fā)服務,打造建德網絡公司原創(chuàng)品牌,更為您提供建德網站排名全網營銷落地服務。

<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[&quot;hibernateLazyInitializer&quot;])</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問題”有了更深的了解,不妨來實際操作一番吧!這里是創(chuàng)新互聯(lián)網站,更多相關內容可以進入相關頻道進行查詢,關注我們,繼續(xù)學習!

分享文章:怎么解決Java中的Typedefinitionerror問題
瀏覽地址:http://bm7419.com/article2/pcdcic.html

成都網站建設公司_創(chuàng)新互聯(lián),為您提供建站公司、服務器托管、云服務器、網站策劃、全網營銷推廣、ChatGPT

廣告

聲明:本網站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)

小程序開發(fā)