Modular Spring app can't find persistence provider
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:
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/infodb10 Replies
⌛
This post has been reserved for your question.
Hey @Eukon05! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose 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.
💤
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.
Hey @Eukon05,
Could you post stacktrace for better understanding the issue?
Thanks.
sure, give me a sec
@Eukon05 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 fixedThank you! I'll try it out and let you know if it helped
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
Unfortunatelty, it didn't work
The stack trace seems the same, but this is what i get:
💤
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.
Post Closed
This post has been closed by <@352745203322585088>.