generator-jhipster
generator-jhipster copied to clipboard
LazyInitializationException for authorities with Elasticsearch
Overview of the issue
When upgrading my 21-Points Health app to JHipster 8.2.1, I noticed an error when running Cypress e2e tests.
Motivation for or Use Case
These e2e tests seem to confirm that authorities
is not loaded correctly when indexing an entity that references the built-in User
entity.
Reproduce the error
See https://github.com/mraible/21-points/actions/runs/8564606589/job/23471398435
Related issues
https://github.com/mraible/21-points/pull/249
Suggest a Fix
JHipster Version(s)
[email protected] /Users/mraible/dev/21-points
├─┬ [email protected]
│ └── [email protected] deduped
└── [email protected]
JHipster configuration, a .yo-rc.json
file generated in the root folder
.yo-rc.json file
{ "generator-jhipster": { "applicationType": "monolith", "authenticationType": "jwt", "baseName": "TwentyOnePoints", "blueprints": [], "buildTool": "gradle", "cacheProvider": "ehcache", "clientFramework": "angular", "clientPackageManager": "npm", "clientTheme": "none", "clientThemeVariant": "", "creationTimestamp": 1662997089611, "cypressAudit": false, "cypressCoverage": false, "databaseType": "sql", "devDatabaseType": "h2Disk", "devServerPort": 4200, "dtoSuffix": "DTO", "enableGradleEnterprise": false, "enableHibernateCache": true, "enableSwaggerCodegen": false, "enableTranslation": true, "entities": [ "Points", "Weight", "BloodPressure", "Preferences" ], "entitySuffix": "", "herokuAppName": "health-by-points", "herokuDeployType": "git", "herokuJavaVersion": "11", "jhiPrefix": "jhi", "jhipsterVersion": "8.2.1", "languages": [ "en", "fr" ], "lastLiquibaseTimestamp": 1667866821000, "messageBroker": false, "microfrontend": false, "microfrontends": [], "nativeLanguage": "en", "otherModules": [], "packageName": "org.jhipster.health", "pages": [], "prodDatabaseType": "postgresql", "reactive": false, "searchEngine": "elasticsearch", "serverPort": "8080", "serverSideOptions": [ "searchEngine:elasticsearch" ], "serviceDiscoveryType": "no", "skipCheckLengthOfIdentifier": false, "skipClient": false, "skipFakeData": false, "skipUserManagement": false, "testFrameworks": [ "cypress" ], "websocket": false, "withAdminUi": true } }
Environment and Tools
openjdk version "21.0.2" 2024-01-16 OpenJDK Runtime Environment GraalVM CE 21.0.2+13.1 (build 21.0.2+13-jvmci-23.1-b30) OpenJDK 64-Bit Server VM GraalVM CE 21.0.2+13.1 (build 21.0.2+13-jvmci-23.1-b30, mixed mode, sharing)
git version 2.39.3 (Apple Git-146)
node: v20.12.1 npm: 10.5.0
Docker version 25.0.3, build 4debf41
JDL for the Entity configuration(s) entityName.json
files generated in the .jhipster
directory
JDL entity definitions
@ChangelogDate("20221108000520") entity Points { date LocalDate required exercise Integer meals Integer alcohol Integer notes String maxlength(140) } @ChangelogDate("20221108001452") entity Weight { timestamp ZonedDateTime required weight Double required } @ChangelogDate("20221108001642") entity BloodPressure { timestamp ZonedDateTime required systolic Integer required diastolic Integer required } @ChangelogDate("20221108002021") entity Preferences { weeklyGoal Integer required min(10) max(21) weightUnits Units required } enum Units { KG, LB } paginate Points with pagination paginate Weight, BloodPressure with infinite-scroll