Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
0 answers
41 views

Hibernat Validator called twice

we develop an application using Jakarta EE 10 and Payara (Glassfish) 6.x. Using @Valid in my resource methods results in my custom validators beeing called twice. The first time everything is injected ...
drame's user avatar
  • 545
1 vote
0 answers
45 views

"java.sql.SQLException: Operation not allowed after ResultSet closed" in a @Scheduled Timer

I'm on Wildfly 30.0.1.Final. I have a @Singleton bean with no @ConcurrencyManagement annotation (i.e. container-managed). One of its methods is annotated with @Schedule(hour="*", minute=&...
iccuta's user avatar
  • 175
0 votes
0 answers
147 views

Application.getResources() is null or {0} is not a valid data source

Previously myApp ran on Payara 5-2022.5 Community Edition with Jakarta EE8, java 8, and Hibernate 5.6.15 with multi-tenancy. And no any error when starting from Netbeans 22. I converted myApp from ...
PeterL355's user avatar
0 votes
0 answers
98 views

class org.hibernate.cache.jcache.internal.JCacheRegionFactory cannot be cast to class org.hibernate.cache.spi.TimestampsCacheFactory

I am trying to learn Hibernate and while follwing the tuterial the second level cache he is using is not working any more and when trying to find options I could not get to a solutions here is what my ...
Bxihit Egzie M's user avatar
0 votes
1 answer
302 views

org.hibernate.resource.beans.container.internal.NotYetReadyException: CDI BeanManager not (yet) ready to use

I am facing an issue while upgrading my BAS application from Java 8 to Java 17. I have also upgraded hibernate from 5.3.29.Final to 6.5.0.final I am using OpenLiberty version 24.0.0.4 with this ...
Anmol Ahuja's user avatar
0 votes
0 answers
25 views

Invalid content was found starting with element 'class'. No child element is expected at this point

I'm encountering this strange error on the class keywords in this code: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <persistence xmlns="https://...
user3481441's user avatar
0 votes
0 answers
82 views

Could not find artifact org.glassfish.jaxb:jaxb-runtime:jar:2.3.3-b02-jbossorg-2 in jakarta.oss.sonatype.org

I am seeing this error while in my code after migrating to JDK 17. Downloading from jakarta.oss.sonatype.org: https://jakarta.oss.sonatype.org/content/repositories/releases/org/glassfish/jaxb/jaxb-...
Pradeep's user avatar
0 votes
0 answers
40 views

JPA/Hibernate Overhead for large dataset

I have a scenario at hand, where I need to fetch a large dataset and access it readonly. The dataset consists of multiple tables, so we are talking about 4-5 interconnected tables in the result and a ...
xeed's user avatar
  • 947
1 vote
1 answer
719 views

Latest Hibernate version that supports MySQL 5.6

I am currently upgrading my existing project Changes are: JDK 8 --> JDK 17 JSF 2.2 --> Jakarta Faces 4 Glassfish 4.1 --> 7.0.11 JPA 2.1 --> JPA 3.1 I also need to change to change the ...
Asgar's user avatar
  • 2,422
1 vote
1 answer
492 views

HSEARCH700119: Exception while retrieving the Jandex index

I'm testing Hibernate Search 6.2.2 with Jakarta ee 10, but not success. At my current version 6.1.8, there's no any issue(running with Jakarta ee 8, Hibernate 5, and Payara 5). My platforms are: ...
PeterL355's user avatar
0 votes
1 answer
667 views

How to run Jakarta EE application with embedded server?

My goal is to create Jakarta EE web application which uses embedded web server and embedded database, so it will be possible to run this webapp with single command. Currently I have an app which uses ...
Podbrushkin's user avatar
2 votes
2 answers
677 views

glassfish 7 + jakarta ee 10 + hibernate entity manager java.lang.NoClassDefFoundError: org/hibernate/annotations/common/reflection/ReflectionManager

I am trying to get hibernate working with glassfish 7 jdbc. I got the configuration of the pool right and ping is a success. I have put mysql-connector-j-8.0.33.jar and hibernate-core-6.2.6.Final.jar ...
Hendrik's user avatar
  • 73
0 votes
0 answers
77 views

Hibernate/JPA: Dynamically create a count Query based on another Query

Is there a JPA-specific or provider-specific way to create a javax.persistence.Query/TypedQuery from another Query/TypedQuery with the possibility to change the query parts like the Selection? ...
Warren Nocos's user avatar
  • 1,272
1 vote
0 answers
125 views

What is the correct way to persist entities based on other entities being updated in the same transaction?

Description I'm trying to persist JPA Entities in a Wildfly Web Application based on entities currently being updated in the same JTA transaction. What needs to happen is when an entity of some type ...
Андрей Андреев's user avatar
0 votes
1 answer
523 views

How do I access the database from within a jakarta servlet Filter?

I'm working on a Spring Boot web application and I'm implementing a filter (jakarta.servlet.Filter) for authentication. The filter needs some information from the database before it can authenticate ...
Marsh's user avatar
  • 8,115
1 vote
1 answer
1k views

jakarta.persistence.Check constraint not working

I have the following Movie class in a Spring Boot project that holds list of actors. I wanted to make sure an actor wont be deleted if its part of a movie and I want to enforce this constraint on a ...
WowBow's user avatar
  • 7,543
0 votes
0 answers
714 views

org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl is closed

I have this function in my dao that check of login: public User checkLogin(String login, String password) { Transaction transaction = null; User user = null; try (Session ...
Renaud is Not Bill Gates's user avatar
1 vote
0 answers
166 views

Tool to generate DTO mapping based on entity model, configurable from UI

I'm looking for a framework that takes an existing entity model and derives a hibernate query based on a configurable mapping to a DTO model, from a UI. So, basically I have an entity model in my ...
Manuel's user avatar
  • 341
1 vote
1 answer
409 views

hibernate many to many and java.sql.SQLIntegrityConstraintViolationException: Duplicate entry error

I have a database and I'm trying to build an application around it. The problem is that I get Duplicate entry intermittently when I try to insert data into related tables. For example, there is a ...
ilw's user avatar
  • 2,560
1 vote
0 answers
163 views

Hibernate @preRemove doesn't work properly if on separate transaction

It seems like I can not get @preRemove to work while in a separate session for some reason (if using the object from the previous session). Below example works. As you can see, there is one session. ...
OpenSource's user avatar
1 vote
0 answers
221 views

Converting `org.hibernate.PersistentObjectException` to JPA `PersistenceException` : detached entity passed to persist

I 'm getting this error i dont know what is wrong. I checked some solutions but i couldn't find something. I create 3 tables in a database (PropertyOwner,Property,Repair) and i want to connect their ...
user avatar
0 votes
1 answer
153 views

Runtime error in Java EE with Intellij IDEA and Tomcat 9

My project doesn't run on Tomcat, I've already tried to change the JDK from 14 to 8, and the error persists. The project structure is: Java 8 Apache Tomcat 9.0.19 Intellij IDEA v. 2020.1 The error ...
Jon.M DEV CAX's user avatar
1 vote
0 answers
672 views

Implementing soft delete with @Filter and lazy loaded associations

I am implementing soft delete with Hibernate. Each entity that supports soft-deleting has an attribute for it. @Column(name = "DELETED") private boolean deleted; I have created @FilterDef ...
Martin Hlavňa's user avatar
0 votes
0 answers
171 views

@Id annotation on getId() method catch an Exception on autoincrement column

I want to understand why when I insert an @Id annotation on the getId () method it throws an error on the auto increment ID column, this is the error: Type Exception Report Message Converting `org....
hamza maimi's user avatar
0 votes
1 answer
785 views

hibernate.MappingException: Unknown entity

I encountered a problem with hibernate.MappingException: Unknown entity. I have annotations and database, but for some reason does not recognize entity. I have tomacat 10.0.23. Here is the code: ...
MishaBucha's user avatar
0 votes
1 answer
654 views

JUnit doesn't scan Jakarta entities

I have a java(8) application running with Tomcat 10, Spring 5.3.22, hibernate 5.6.10.Final and jakarta.persistence 3.0.0 I'm using jakarta entities due to my tomcat 10. entity for example: import ...
Tal Levi's user avatar
  • 805
4 votes
1 answer
1k views

Are Session and EntityManager the same?

New to JPA and was wondering if Session (Hibernate) and EntityManager are the same thing or not? As both of them basically allow you to manage and search for entities in the relational database. Also ...
user3837019's user avatar
1 vote
0 answers
618 views

Hibernate validator 7.0.4

One of the requirements to our project is to migrate to latest Hibernate validator. I did modify the pom.xml and updated the version (6.1.x) to (7.0.x). The projects report issues like compile error ...
A Rao's user avatar
  • 11
7 votes
1 answer
4k views

entityManagerFactory bean not configured issue with hibernate 6.0.2.Final and spring boot 2.7.0

so recently i thought of upgrading few dependency of my spring boot project project specifically these components jakarat ee 9 spring boot 2.7 hibernate 6.0.2.Final after doing this all updates and ...
manish's user avatar
  • 113
0 votes
2 answers
1k views

How open Modal Jsp Page in Spring MVC

I am using Spring Mvc and Booststrap in a web application and I would like to display the editEmployer.jsp page as a Popup. Below is the code: Page Index.jsp <html> <head> <script type=&...
Dev Learning's user avatar
3 votes
0 answers
8k views

Migration of javax.persistence to jakarta.persistence

I am trying to migrate javax.persistence to jakarta.persistence and curently I seem to be unable to overcome following error: Class org.springframework.orm.jpa.vendor....
Vojtěch's user avatar
  • 12.3k
2 votes
1 answer
686 views

JPA: how can i map a property to a derived column that is based on a COUNT from other tables (Without incurring in n+1 select problems?)

These are the entities defined in my project: Post @Entity public class Post implements Serializable { public enum Type {TEXT, IMG} @Id @GeneratedValue(strategy = GenerationType.IDENTITY) ...
cidra's user avatar
  • 397
1 vote
1 answer
485 views

Parse String immediately to Integer in Hibernate-Validator after successful @Digits check

I have a JAX-RS resource in Quarkus whose inputs I want to validate. One of the properties in this validation bean below, which will validate the input from a PUT method, contains a property which is ...
Saddex's user avatar
  • 145
0 votes
1 answer
2k views

Consider defining a bean of type in your configuration with my Service

I have this situation with my code even after I added the @Component, @Service and @Repository annotation to my classes: this is the resource for it: package app.gym.v1.Resource.API; import app.gym....
Mohamad J Alanbaki's user avatar
0 votes
0 answers
794 views

Cannot create index with automated generated entity from DB org.hibernate.AnnotationException: Unable to create index

I'm trying to deploy an EAR application (includes ejb and war modules). The problem is it cannot create indexes of a foreign key in associative entity (WorkerHasRole). Every entity with relationships ...
kitorek's user avatar
  • 11
0 votes
1 answer
214 views

Hibernate Bytecode Instrumentation: Set fetched property values to their fields right away

I'm working on an enterprise application that uses Hibernate and EJB, and I'm utilizing Hibernate's Bytecode instrumentation to implement true lazy-loading of properties having bidirectional @OneToOne ...
Warren Nocos's user avatar
  • 1,272
0 votes
1 answer
993 views

How to best create an abstract class for generic modelmapper management? To convert Entity and Dto for Spring REST API Application

I want to create an abstract class to be able to convert entities into dto and dto into entities with the modelmapper library. What am I doing wrong? public abstract class AbstractConverter<Entity,...
Luca De Salve's user avatar
0 votes
1 answer
638 views

Problems with Entity validation with Hibernate Validator

I tried to activate automated entity validation via Hibernate Validator. Therefore, I added the following dependencies to my Gradle build file: implementation 'org.hibernate.validator:hibernate-...
elsamuray7's user avatar
0 votes
1 answer
2k views

javax.persistence.PersistenceException: org.hibernate.HibernateException: HHH000142: Bytecode enhancement failed: echosign.agreement.Participation

I am doing migration from Hibernate 5.2 to 5.5.7, with hibernate5.2 its is working properly but in hibernate 5.5.7 i am getting below error Caused by: org.hibernate.HibernateException: HHH000142: ...
nandan pandey's user avatar
0 votes
1 answer
392 views

Migrate Hibernate 5.2 to JPA 2.1

I want to remove direct Hibernate references from my Java EE 7 server application so that I will not have a compile-time dependency on hibernate-core in the future. As a replacement, I want to use ...
user3058865's user avatar
0 votes
1 answer
296 views

java.sql.SQLIntegrityConstraintViolationException Doesn't reach catch clause

I'm working with a JAVAEE application which is using hibernate ORM. In that application i made an api endpoint to delete an entity. That entity has foreign key constraint. Then entity should not ...
Thilina Sandaruwan's user avatar
1 vote
0 answers
112 views

Hibernate Exceptions not propagated to Application deployed in JBoss 7.3

Issue: The Web application uses JPA/Hibernate to communicate with the Oracle database. This application is deployed in JBoss EAP 7.3 and uses its Hibernate modules. When an org.hibernate.exception....
Prerna's user avatar
  • 11
0 votes
1 answer
1k views

How do I use Hibernate along with WildFly?

good evening. I'm trying to create a project that uses: Java JSF 2.3 Maven CDI 2.0 Hibernate Wildfly server My intention here is to learn the basics of all these fellas. At first I followed ...
palmeiira's user avatar
0 votes
1 answer
1k views

Provider org.hibernate.envers.boot.internal.EnversIntegrator not a subtype tomcat 8

so i am using the jar hibernate-envers 5.1.14 and hibernate-core 5.4.14 with tomcat 8 and i am facing this exception : Caused by: java.util.ServiceConfigurationError: org.hibernate.integrator.spi....
aabc's user avatar
  • 29
0 votes
2 answers
606 views

JPA Hibernate login to local MySQL in IntelliJ not working

I am new to Jakarta EE, I have seen some other similar questions, I have followed them but can't seem to see what I am doing wrong as I have followed all those. Seems like the class com.mysql.jdbc....
ptmp_727's user avatar
0 votes
2 answers
898 views

having problem with query in JPA using Wildfly/Hibernate java.sql.SQLException: No database selected

I am attempting the following query: @PersistenceContext(unitName="miscPU") private EntityManager em; public ClientCompanyDAO() { } public List <ClientCompany&...
user1539401's user avatar
3 votes
2 answers
977 views

EAP 7.3 JPA+Hibernate REST Serialization of Bidirectional ManyToOne relationship (NOT SPRING)

I come from a Payara/EclipseLink background where this just works out of the box. My contract requires me to use EAP which does not support EclipseLink.persistance and I always prefer the "...
alliancecoder's user avatar
1 vote
1 answer
55 views

Hibernate OGM Mongodb projection

I'm using Hibernate OGM Mongodb and I need to do some projections against my queries, do someone already done that and can help me? I've already tried to use the JP-QL queries, but none of my attempts ...
lambda's user avatar
  • 417
2 votes
0 answers
159 views

Does EclipseLink have some similar functionality like Hibernate Interceptors?

Found a way to use an enum as the entity with its own table in JPA using Hibernate Interceptors. For example, I want to use as an entity following enum: @Entity public enum Color { RED(255, 0, 0),...
MaximumQuiet's user avatar

1
2 3 4 5
38