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

JHipster Cassandra - jakarta.persistence.spi::No valid providers found. #23566

Closed
micobarac opened this issue Sep 19, 2023 · 3 comments
Closed

Comments

@micobarac
Copy link

micobarac commented Sep 19, 2023

Overview of the issue

Running JHipster Cassandra application for production, I get the following WARN message:

2023-09-19T06:19:27.899Z WARN 1 --- [ XNIO-1 task-2] jakarta.persistence.spi: jakarta.persistence.spi::No valid providers found.

Motivation for or Use Case

Remove the WARN message

Reproduce the error

Generate a new JHipster Cassandra project, pack for production and run the application on server.

This is the dependency that is causing the issue:

<dependency>
    <groupId>jakarta.persistence</groupId>
    <artifactId>jakarta.persistence-api</artifactId>
</dependency>

As I am using the jakarta.persistence.* classes in a project, removing the dependency is not an option.

import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;

...

@NotNull
@CqlName("type")
@Enumerated(EnumType.ORDINAL)
private AccessType type;
Related issues

This WARN message happens with the previous JHipster versions too.

Suggest a Fix

The official docs suggest that the dependency above is only the API and requires a JPA implementation (Eclipse Link, OpenJPA, Hibernate, ...) to actually work in an container.

JHipster Version(s)

8.0.0-beta.3

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

<details>
<summary>.yo-rc.json file</summary>
<pre>
{
  "generator-jhipster": {
    "applicationType": "monolith",
    "authenticationType": "jwt",
    "baseName": "openprovider-admin",
    "buildTool": "maven",
    "cacheProvider": "ehcache",
    "clientFramework": "no",
    "creationTimestamp": 1690783074116,
    "databaseType": "cassandra",
    "devDatabaseType": "cassandra",
    "dtoSuffix": "DTO",
    "enableGradleEnterprise": null,
    "enableHibernateCache": false,
    "enableSwaggerCodegen": false,
    "enableTranslation": true,
    "entities": [],
    "entitySuffix": "",
    "gradleEnterpriseHost": null,
    "jhiPrefix": "jhi",
    "jhipsterVersion": "8.0.0-beta.3",
    "languages": [
      "en",
      "fr",
      "hr",
      "sr"
    ],
    "messageBroker": false,
    "microfrontend": false,
    "microfrontends": [],
    "nativeLanguage": "en",
    "packageFolder": "com/logate/openprovider",
    "packageName": "com.logate.openprovider",
    "pages": [],
    "prodDatabaseType": "cassandra",
    "reactive": false,
    "searchEngine": false,
    "serverPort": null,
    "serverSideOptions": [],
    "serviceDiscoveryType": false,
    "skipCheckLengthOfIdentifier": false,
    "skipClient": true,
    "skipFakeData": false,
    "skipUserManagement": false,
    "testFrameworks": [],
    "websocket": false,
    "withAdminUi": true
  }
}
</pre>
</details>

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

java version "20.0.2" 2023-07-18
Java(TM) SE Runtime Environment (build 20.0.2+9-78)
Java HotSpot(TM) 64-Bit Server VM (build 20.0.2+9-78, mixed mode, sharing)

git version 2.41.0

node: v18.17.0
npm: 8.12.1

Docker version 24.0.5, build ced0996

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

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

<pre>

</pre>
</details>


Congratulations, JHipster execution is complete!
If you find JHipster useful consider sponsoring the project https://www.jhipster.tech/sponsors/

Thanks for using JHipster!
Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System
Google Chrome 117.0.5938.88 (Official Build) (arm64)
MacOS Ventura 13.5.2
@micobarac micobarac changed the title jakarta.persistence.spi::No valid providers found. JHipster Cassandra - jakarta.persistence.spi::No valid providers found. Sep 19, 2023
@mshima
Copy link
Member

mshima commented Sep 19, 2023

We don’t generate:

@Enumerated(EnumType.ORDINAL)
private AccessType type;

This is not a jhipster issue.

@micobarac
Copy link
Author

There's no need to be rude, ok? As jakarta replaced javax a while ago, I use Cassandra enum column mapping, as I showed in example above. jakarta.persistence.api dependency causes the WARN, I encountered. I was just asking for a potential explanation or a workaround, that's all.

@mshima
Copy link
Member

mshima commented Sep 19, 2023

I didn't mean to be rude, it's just a fact. This is not a JHipster issue.

Please read the issue description (it's rude otherwise):

- Please follow the issue template below for bug reports.
- If you have a support request rather than a bug, please use [Stack Overflow](http://stackoverflow.com/questions/tagged/jhipster) with the JHipster tag.

If you have read and still wants to create an issue, please explain that this is not a bug, but a help request.

Closing as this doesn't follows the bug report guidelines.

@mshima mshima closed this as completed Sep 19, 2023
@deepu105 deepu105 added this to the 8.0.0-rc.1 milestone Oct 14, 2023
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

3 participants