Hibernate enhancer NoSuchMethodError 수정#145
Merged
eastshine2741 merged 2 commits intoJul 22, 2026
Merged
Conversation
dev 환경 전역에서 발생한 java.lang.NoSuchMethodError:
BaseEntity.$$_hibernate_write_id(java.lang.Long) 수정.
Hibernate bytecode enhancer(7.2.4)가 @MappedSuperclass의 Kotlin val(final
필드)에는 $$_hibernate_write_* 메서드를 생성하지 않으면서, 자식 엔티티의
enhanced 코드에는 해당 메서드 호출을 삽입해 런타임에 NoSuchMethodError가
발생한다 (HHH-17418 변종, 상속 필드 케이스). id/createdAt/updatedAt을
var로 바꿔 writer가 생성되도록 한다.
enableLazyInitialization = true 명시는 제거 (7.2.4 기본값이 true).
enhancement {} 블록 자체는 enhancement opt-in 트리거이므로 유지.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
eastshine2741
commented
Jul 22, 2026
| apply(plugin = "org.hibernate.orm") | ||
| configure<org.hibernate.orm.tooling.gradle.HibernateOrmSpec> { | ||
| enhancement { enableLazyInitialization = true } | ||
| enhancement { } |
Contributor
Author
There was a problem hiding this comment.
이렇게만 해놔도 enableLazyInitialization 기본값 true로 들어간대서 지웠습니다
그리고 찾아보니 enableDirtyTracking 이런것들도 별도로 있었음.. 걔네도 기본값으로 들어가고있었으니 달라지는건 없습니다 그냥 공유
https://docs.hibernate.org/orm/5.4/topical/html_single/bytecode/BytecodeEnhancement.html
eastshine2741
deleted the
fix/hibernate-enhancer-mapped-superclass-writer
branch
July 22, 2026 16:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
이해한 만큼만 주절주절썼는데 저도 잘 모르겠어서,, 궁금하신분은 이 description을 클로드에 넣고 이해하시는게 좋으실수도요..
문제
snutt-dev/snutt-ev:7, native image)에서 엔티티id를 읽는 API들이 500 발생원인
요약: Hibernate 플러그인 버그임
org.hibernate.ormbytecode enhancement 플러그인(7.2.4.Final)에 버그가 있음org.hibernate.orm플러그인을 적용하고,enhancement {}블록을 두는 식으로 적용할 수 있다. 우리도 그렇게 되어있다final이라면, kotlin 용어로는val이라면) $$_hibernate_write{필드명} 함수는 생성하지 않는다해결
Native image는 2월28일에 배포됐는데 왜 이제야 문제가됐는가?