#Modular Spring app can't find persistence provider

1 messages ยท Page 1 of 1 (latest)

drifting pagoda
#

Hi, I'm trying to run my JPMS app through the command line instead of IntelliJ. I set up maven to copy all dependencies to a specified folder, so that they can be added to the module path.
I use the following command to start the app:

java --module-path "infodb-app-1.0-SNAPSHOT.jar;modules" --add-reads ovh.eukon05.infodb.app=ALL-UNNAMED -m ovh.eukon05.infodb.app/ovh.eukon05.infodb.app.Main -Dinfodb.sources.articlelimit=5 -Dinfodb.hibernate.db.user=sa -Dinfodb.hibernate.db.pass= -Dinfodb.hibernate.db.url="jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1"

The app starts, but crashes saying that it couldn't instantiate a class responsible for database connectivity due to the lack of a persistence provider. I can't figure out why it is that way, because Hibernate is shown to be loaded to the module path when I use --show-module-resolution and persistence.xml is present in the META-INF folder of the module responsible for DB connectivity.

Link to the repo: https://github.com/Eukon05/infodb

fervent crystalBOT
#

โŒ› This post has been reserved for your question.

Hey @drifting pagoda! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

fervent crystalBOT
#

๐Ÿ’ค Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.

old sphinx
#

Hey @drifting pagoda,

Could you post stacktrace for better understanding the issue?

Thanks.

drifting pagoda
#

sure, give me a sec

old sphinx
#

@drifting pagoda I checked the repo you've shared and can say:

  1. You have incorrect version in persistence.xml . I checked pom.xml and you are using Hibernate 6 version. It means you need to put 3.1 instead of 2
  2. Also in pom.xml i see you are using H2 db, but dependency is in test scope. put it to runtime as you dont have any other driver in your configuration

At least these 2 items should be fixed

drifting pagoda
#

Thank you! I'll try it out and let you know if it helped

fervent crystalBOT
drifting pagoda
#

Unfortunatelty, it didn't work
The stack trace seems the same, but this is what i get:

fervent crystalBOT
#

๐Ÿ’ค Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.