Eukon05
Eukon05
JCHJava Community | Help. Code. Learn.
Created by Eukon05 on 12/16/2024 in #java-help
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:
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"
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
13 replies
JCHJava Community | Help. Code. Learn.
Created by Eukon05 on 10/21/2024 in #java-help
Module not found when running tests in Maven
Hi, I'm trying to create a modular application for fetching articles from popular news sources in Poland. A part of the app is a module saving these articles into a database using Hibernate. I wrote a couple of tests for this module and when I run them through intellij they work just fine, but when I try to use Maven it throws errors like these:
[ERROR] Error occurred during initialization of boot layer
[ERROR] java.lang.module.FindException: Module jakarta.cdi not found, required by jakarta.transaction
[ERROR] Error occurred during initialization of boot layer
[ERROR] java.lang.module.FindException: Module jakarta.cdi not found, required by jakarta.transaction
What should I do to fix this? Github link to the project: https://github.com/Eukon05/infodb/tree/hibernate The class that is responsible for these tests is "HibernateDAOTests" in the "infodb-persistence-hibernate" module
31 replies
JCHJava Community | Help. Code. Learn.
Created by Eukon05 on 12/15/2022 in #java-help
How should I design the architecture of a Spring Boot app?
Hi, I'm currently developing a Spring Boot application for managing incomes and expenses, and from the beginning I have a problem in designing a "clean" architecture for it. Is the way I'm grouping code into interfaces and implementations ok, or should I pick a different approach? I've been told on another group a while ago that my packages are too intertwined - how can I fix that? I've tried using the facade design pattern, is it enough? Here's a link to the source code: https://github.com/Eukon05/financetracker/tree/master/src/main/java/com/eukon05/financetracker Thanks in advance for all replies 🙂
4 replies