arquadrado (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *commented* on HHH-16475 (
https://hibernate.atlassian.net/browse/HHH-16475?atlOrigin=eyJpIjoiMDY5N2...
)
Re: Migration from hibernate 5 to 6 and metamodels not being generated (
https://hibernate.atlassian.net/browse/HHH-16475?atlOrigin=eyJpIjoiMDY5N2...
)
The error I am getting is that the meta models cannot be found in the task :compileJava
Here’s the exact message:
FacetField.java:7: error: cannot find symbol
import my.package.domain.Customer_;
symbol: class Customer_
location: my.package.domain
This is expected because I don’t have any generated class in my build folder.
Since this project is too big and was something that inherited I cannot post here every
configuration but I’ll describe what I tried. Here it goes:
1. created a new springboot project with the version before the upgrade, 2.7.5 and 5.6.8
for spring boot and hibernate respectively.
2. Ran the application and everything was fine. Metamodels generated and app runs without
any problem.
3. I upgrade the versions for the last available version, 3.0.0 and 6.2.1.Final, for
spring boot and hibernate respectively.
4. Ran the application and everything was fine. Metamodels generated and app runs without
any problem.
At this point I noticed some differences in my `build.gradle` for both application and did
the adaptation in the original app. It looks like this at this point:
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation group: 'org.liquibase' , name: 'liquibase-core' , version:
'4.21.1'
implementation group: 'org.liquibase.ext' , name: 'liquibase-hibernate6'
, version: '4.21.1'
implementation group: 'org.postgresql' , name: 'postgresql' , version:
'42.3.4'
implementation group: 'org.hibernate.orm' , name: 'hibernate-core' ,
version: '6.2.1.Final'
implementation group: 'org.hibernate.validator' , name:
'hibernate-validator' , version: '8.0.0.Final'
compileOnly 'org.projectlombok:lombok'
compileOnly 'org.hibernate.orm:hibernate-jpamodelgen'
annotationProcessor 'org.projectlombok:lombok'
annotationProcessor 'org.hibernate.orm:hibernate-jpamodelgen'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
I tried to build the original application again and the problem remained so I thought that
maybe the original build.gradle had something there that was messing things up. Following
this line of thought I decided to copy this whole file to the my test application and try
to run the build there. It worked with no problem, so now I know that the problem is not
in build.gradle but I am without a clue of what might be the problem. I tried to check the
application.yaml s to see if there is something related to the metamodel generation there
but without a find, I tried to look for some java configuration but with same result.
The build logs don’t point to any error regarding jpamodel, missing dependency or any
problem. It complains right away because of the missing classes as I first described.
I honestly don’t know where to turn to at this point. Any guidance on what I should try
next would be much appreciated.
(
https://hibernate.atlassian.net/browse/HHH-16475#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16475#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100222- sha1:c08beee )