Cannot invoke "jakarta.persistence.EntityManagerFactory.createEntityManager()" "this.emf" is null
I mapped my classes and transformed it in tables for my database. When I try to create a register I get this error. How I should to initialize emf?
PersistenceController
9 Replies
⌛
This post has been reserved for your question.
Hey @Franscis123$#! 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.
LogicController
Main
Rol
What is
RolJpa.create(rol)
?
I think you are using new
somewhere where you shouldn'tIts calls to create method from RolJpaController create method. I'm new using JPA, and I watched a tutorials to apply it to my proyect, In its was done like that way.
Can you show LogicController and main?
Did the tutorials you were watching use a DI framework?
No, Its just uses Maven, and me too
.
💤
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.