Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The default profile is ignored when run a application generated with Jhipster 8.4.0 #26333

Closed
1 task
edilsonmendes opened this issue Jun 2, 2024 · 4 comments · Fixed by #26408
Closed
1 task

Comments

@edilsonmendes
Copy link
Contributor

Overview of the issue

I generated an application with jhipster 8.4.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}"

image

image

This property is profile specific (application-dev.yml and application-prod.yml)

The application runs without error 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.4.0
-Run the application with ./mvnw or npm run backend:debug

Related issues

This error appears to be related to issue #25979.

Suggest a Fix

N/A

JHipster Version(s)

8.4.0

JHipster configuration
  ██║ ██║   ██║ ╚══██╔══╝ ██╔═══██╗ ██╔════╝ ╚══██╔══╝ ██╔═════╝ ██╔═══██╗
    ██║ ████████║    ██║    ███████╔╝ ╚█████╗     ██║    ██████╗   ███████╔╝

██╗ ██║ ██╔═══██║ ██║ ██╔════╝ ╚═══██╗ ██║ ██╔═══╝ ██╔══██║
╚██████╔╝ ██║ ██║ ████████╗ ██║ ██████╔╝ ██║ ████████╗ ██║ ╚██╗
╚═════╝ ╚═╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═╝
https://www.jhipster.tech
Welcome to JHipster v8.4.0

Welcome to the JHipster Information Sub-Generator

[email protected] /home/embj/git/tjpe/pure-v8.4.0
└── (empty)
JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "applicationType": "monolith",
    "authenticationType": "oauth2",
    "baseName": "jhipsterOauth2SampleApplication",
    "blueprints": [],
    "buildTool": "maven",
    "cacheProvider": "ehcache",
    "clientFramework": "angular",
    "clientPackageManager": "npm",
    "clientTheme": "none",
    "clientThemeVariant": "",
    "clusteredHttpSession": false,
    "creationTimestamp": 1577001617772,
    "databaseType": "sql",
    "devDatabaseType": "h2Memory",
    "devServerPort": 9060,
    "dtoSuffix": "DTO",
    "embeddableLaunchScript": false,
    "enableGradleEnterprise": false,
    "enableHibernateCache": true,
    "enableSocialSignIn": false,
    "enableSwaggerCodegen": false,
    "enableTranslation": false,
    "entities": [
      "SpaceEvent",
      "Mission",
      "Log"
    ],
    "entitySuffix": "",
    "hibernateCache": "ehcache",
    "jhiPrefix": "jhi",
    "jhipsterVersion": "8.4.0",
    "languages": [
      "en"
    ],
    "lastLiquibaseTimestamp": 1716807357000,
    "messageBroker": false,
    "nativeLanguage": "pt-br",
    "otherModules": [],
    "packageFolder": "io/github/jhipster/sample",
    "packageName": "io.github.jhipster.sample",
    "pages": [],
    "prodDatabaseType": "mysql",
    "reactive": false,
    "searchEngine": false,
    "serverPort": 8080,
    "serviceDiscoveryType": false,
    "skipCheckLengthOfIdentifier": false,
    "skipClient": false,
    "skipFakeData": false,
    "skipJhipsterDependencies": true,
    "skipServer": false,
    "skipUserManagement": true,
    "syncUserWithIdp": true,
    "testFrameworks": [
      "gatling",
      "cypress"
    ],
    "useCompass": false,
    "useSass": true,
    "websocket": false,
    "withAdminUi": true
  }
}
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 directory
JDL entity definitions
@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

Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System
  • Checking this box is mandatory (this is just to show you read everything)
@mraible
Copy link
Contributor

mraible commented Jun 4, 2024

Can you please try with JHipster 8.5.0?

FWIW, I've been unable to get MySQL to start in Docker with 8.5.0. See #26319 for more information.

@edilsonmendes
Copy link
Contributor Author

edilsonmendes commented Jun 7, 2024

@mraible , sorry for the delay in responding. Yes, the error also occurs in jhipster v8.5.0, as shown in the image below.

Captura de tela 2024-06-07 161449

This error appears to be related to issue #25979.

If I remove the value of the spring.profiles.active property in application.yml the application runs without error.

Copy link
Contributor

github-actions bot commented Jun 7, 2024

JHipster has completed the sample check
.yo-rc.json: valid
Entities JDL: valid
Application: successfully generated
Frontend check: success
Backend check: success
E2E check: success

This check uses jhipster info output from the issue description to generate the sample.
Bug report that does not contain this information will be marked as invalid.

@edilsonmendes
Copy link
Contributor Author

edilsonmendes commented Jul 1, 2024

Hi @mraible, the error remains in version 8.6.0. The application runs without error 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.

Should I open a new issue?

Captura de tela 2024-07-01 170911

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants