0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Type definition error: [simple type, class org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor]

Last updated at Posted at 2022-08-30

CRUDでいうところのUPDATEで常に失敗するようになった(Spring Data Jpa使用)

以下、ログ画像スクリーンショット 2022-08-30 21.46.59.png

結論:Entityに@JsonIgnoreProperties({"hibernateLazyInitializer"}) を追加

参考:Spring Data JPA で hibernateLazyInitializer を Jackson が JSON シリアライズできなくてエラーになる

以下は余談

最初はType definition errorという部分から型違いが原因かとおもったのだけど合わせても一向にエラーがでるので

through reference chain: com.smd.api.entity.TodoEntity$HibernateProxy$KRg8OCOW["hibernateLazyInitializer"])] with root cause
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.smd.api.entity.TodoEntity$HibernateProxy$KRg8OCOW["hibernateLazyInitializer"])

No serializerとか言ってる部分が原因かなと追求したら先ほどの記事にいきついた

参考記事を上げてくださった方に感謝を!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?