Skip to content

Build error on OAuth2 Gateway without DB when allowing relationships with User entity #29354

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

Open
iroCheese opened this issue Apr 29, 2025 · 0 comments

Comments

@iroCheese
Copy link

Overview of the issue

When generating a gateway application with OAuth2 enabled and no database, the generated project can't be built because AuthorityRepository.java is not generated. This seems to happen due to the selection

✔ Do you want to allow relationships with User entity? No

The build works, when I generate an identical gateway with selection

✔ Do you want to allow relationships with User entity? Yes

JHipster info

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


Welcome to JHipster v8.10.0

Welcome to the JHipster Information Sub-Generator


[email protected] /tmp/jhipster-gateway
└── [email protected]



##### **JHipster configuration, a `.yo-rc.json` file generated in the root folder**


<details>
<summary>.yo-rc.json file</summary>
<pre>
{
  "generator-jhipster": {
    "applicationType": "gateway",
    "authenticationType": "oauth2",
    "baseName": "jhipsterGateway",
    "buildTool": "maven",
    "cacheProvider": null,
    "clientFramework": "react",
    "clientTestFrameworks": [],
    "clientTheme": "none",
    "creationTimestamp": 1745930784640,
    "databaseType": "no",
    "devDatabaseType": null,
    "enableHibernateCache": null,
    "enableTranslation": true,
    "entities": [],
    "feignClient": null,
    "jhipsterVersion": "8.10.0",
    "languages": [
      "en"
    ],
    "microfrontend": false,
    "microfrontends": [],
    "nativeLanguage": "en",
    "packageName": "com.mycompany.myapp",
    "prodDatabaseType": null,
    "reactive": true,
    "serverPort": 8080,
    "serviceDiscoveryType": "consul",
    "skipUserManagement": true,
    "syncUserWithIdp": true,
    "testFrameworks": [],
    "withAdminUi": true
  }
}
</pre>
</details>


##### **Environment and Tools**

openjdk version "17.0.15" 2025-04-15
OpenJDK Runtime Environment (build 17.0.15+6)
OpenJDK 64-Bit Server VM (build 17.0.15+6, mixed mode, sharing)

git version 2.49.0

node: v22.15.0
npm: 10.9.2

podman version 5.4.2

##### **JDL for the Entity configuration(s) `entityName.json` files generated in the `.jhipster` directory**

<details>
<summary>JDL entity definitions</summary>

<pre>


</pre>
</details>
Motivation for or Use Case

If the gateway requires a DB, it should not be possible to select no database as an option.

Reproduce the error

run jhipster command with version 8.10.0 in empty directory with the following selection or alternatively with the .yo-rc.json from above:

✔ What is the base name of your application? jhipsterGateway
✔ Which type of application would you like to create? Gateway application
✔ What is your default Java package name? com.mycompany.myapp
✔ Would you like to use Maven or Gradle for building the backend? Maven
✔ As you are running in a microservice architecture, on which port would like your server to run?
It should be unique to avoid port conflicts. 8080
✔ Which service discovery server do you want to use? Consul (recommended)
✔ Which type of authentication would you like to use? OAuth 2.0 / OIDC Authentication (stateful,
works with Keycloak and Okta)
✔ Do you want to allow relationships with User entity? Yes
✔ Besides JUnit, which testing frameworks would you like to use?
✔ Which type of database would you like to use? No database
✔ Which other technologies would you like to use?
✔ Which framework would you like to use for the client? React
✔ Do you want to enable microfrontends? No
✔ Besides Jest/Vitest, which testing frameworks would you like to use?
✔ Do you want to generate the admin UI? Yes
✔ Would you like to use a Bootswatch theme (https://bootswatch.com/)? Default JHipster
✔ Would you like to enable internationalization support? Yes
✔ Please choose the native language of the application English
✔ Please choose additional languages to install

Related issues
Suggest a Fix

Don't allow selecting the option 'no database' when relationships with the user entity are allowed or the other way around.

JHipster Version(s)

Happened with 8.10.0, didn't test other versions

Browsers and Operating System

I use Arch and Firefox btw

  • [ X] Checking this box is mandatory (this is just to show you read everything)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant