Open edilsonmendes opened 1 month ago
I tried to recreate the issue with jhipster jdl blog-oauth2
. When I first start it with ./mvnw
, it has the profile set correctly.
If I change a Java class and re-compile it, it restarts and the dev profile is still there.
I tried with your .yo-rc.json
and JDL and experienced the same behavior. Here's the console after the restart by Spring DevTools.
From jhipster info
:
pure-v-860@0.0.1-SNAPSHOT /Users/mraible/Downloads/reopen
└── generator-jhipster@8.6.0
.yo-rc.json
file generated in the root folder{ "generator-jhipster": { "applicationType": "monolith", "authenticationType": "oauth2", "baseName": "pureV860", "buildTool": "maven", "cacheProvider": "ehcache", "clientFramework": "angular", "clientTestFrameworks": [], "clientTheme": "none", "creationTimestamp": 1719429321098, "databaseType": "sql", "devDatabaseType": "h2Disk", "devServerPort": 4200, "enableHibernateCache": true, "enableSwaggerCodegen": false, "enableTranslation": false, "entities": [ "SpaceEvent", "Mission", "Log" ], "feignClient": null, "jhipsterVersion": "8.6.0", "messageBroker": false, "microfrontend": null, "microfrontends": [], "nativeLanguage": "pt-br", "packageName": "com.mycompany.myapp", "prodDatabaseType": "postgresql", "reactive": false, "searchEngine": false, "serverPort": null, "serverSideOptions": [], "serviceDiscoveryType": false, "skipUserManagement": true, "syncUserWithIdp": false, "testFrameworks": [], "websocket": false, "withAdminUi": false } }
openjdk version "22.0.1" 2024-04-16 OpenJDK Runtime Environment GraalVM CE 22.0.1+8.1 (build 22.0.1+8-jvmci-b01) OpenJDK 64-Bit Server VM GraalVM CE 22.0.1+8.1 (build 22.0.1+8-jvmci-b01, mixed mode, sharing)
git version 2.39.3 (Apple Git-146)
node: v20.15.0 npm: 10.7.0
Docker version 26.1.4, build 5650f9b
entityName.json
files generated in the .jhipster
directory@ChangelogDate("20240506143746") entity SpaceEvent { id UUID name String required date LocalDate required description TextBlob required photo ImageBlob required type SpaceEventType required } @ChangelogDate("20240506143747") entity Mission { id UUID name String required description String } @ChangelogDate("20240527105557") entity Log { id UUID description String } enum SpaceEventType { LAUNCH, LANDING } relationship OneToOne { SpaceEvent{mission(name)} to Mission } relationship OneToMany { Mission{log} to Log{mission} } dto SpaceEvent, Mission, Log with mapstruct paginate SpaceEvent, Mission, Log with pagination service SpaceEvent, Mission, Log with serviceClass search SpaceEvent, Mission, Log with no filter SpaceEvent, Mission, Log
Happened in a vscode rebuild with me. I wonder if it’s a IDE misbehavior.
Happened in a vscode rebuild with me. I wonder if it’s a IDE misbehavior.
Sure. I'm using vscode too. I tested with Intellij and the error does not occur.
Any idea for a workarond? I use wsl and vscode fits perfectly.
Any idea for a workarond? I use wsl and vscode fits perfectly.
No, probably duplicate the maven-resources-plugin configuration instead of rely on parent pom configuration.
Hi,
I found a similar issue generating a microservice (with Jhipster 8.6.0 running in a docker image), the application should use a h2 in memory database for dev profile. Launching the application with ./mvnw, it fails to inject the right configuration leading to an error. Generating an identical application using a Jhipster 8.5.0 docker image, and trying to start it with ./mvnw doesn't show problems, as can be seen in the adjacent images
Overview of the issue
The error reported in #26333 also occurs in JHipster 8.6.0. When I try to run it using the ./mvnw command or npm run backend:debug, it does not display the default profile in the JHipster banner but the @spring.profiles.active@ placeholder. Furthermore, the application fails to create the LoggingConfigurarion bean, as it is unable to inject the value of the server.port property, as shown in the message below.
Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'server.port' in value "${server.port}"
Sometimes, it runs on first time or if the profile is informed (./mvnw -P dev), however, when changing any file in the backend it fails (same error) when performing the hot reload.
Motivation for or Use Case
The application should run without error using the default profile and shows the correct profile in the banner.
Reproduce the error
-Genarate a monolith JHipster 8.6.0 -Run the application with ./mvnw or npm run backend:debug -Change any backend file to force hot reload
Related issues
26333
25979
Suggest a Fix
N/A
JHipster Version(s)
The error ocurrs in v8.6.0, v8.5.0 and v8.4.0,
JHipster configuration
WARNING! Since JHipster v8, the jhipster command will not use the locally installed generator-jhipster. If you want to execute the locally installed generator-jhipster, run: npx jhipster
██╗ ██║ ██╔═══██║ ██║ ██╔════╝ ╚═══██╗ ██║ ██╔═══╝ ██╔══██║ ╚██████╔╝ ██║ ██║ ████████╗ ██║ ██████╔╝ ██║ ████████╗ ██║ ╚██╗ ╚═════╝ ╚═╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═╝ https://www.jhipster.tech Welcome to JHipster v8.6.0
Welcome to the JHipster Information Sub-Generator
JHipster configuration, a
.yo-rc.json
file generated in the root folder.yo-rc.json file
Environment and Tools
openjdk version "17.0.6" 2023-01-17 OpenJDK Runtime Environment Temurin-17.0.6+10 (build 17.0.6+10) OpenJDK 64-Bit Server VM Temurin-17.0.6+10 (build 17.0.6+10, mixed mode, sharing)
git version 2.25.1
node: v20.12.2 npm: 10.5.0
Docker version 24.0.1, build 6802122
JDL for the Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryEntity configuration(s)
entityName.json
files generated in the.jhipster
directoryBrowsers and Operating System