java.lang.OutOfMemoryError : How to simulate in Java

In this Topic we will try to simulate the java.lang.OutOfMemoryError !! We will create an object holding 1MB of bytes, add it into a List, and repeat the create and add process until the JVM throw OutOfMemoryError. java.lang.OutOfMemoryError: Java heap space This example will run a while then it will throws java.lang.OutOfMemoryError. The Output : […]

En Lire Plus

Spring boot : How to set the max size of upload file ? (Solved)

Problem : I’m developing application based on Spring Boot and AngularJS using JHipster. My question is how to set max size of uploading files ? If I’m trying to upload to big file I’m getting this error in console : Solution : For Spring boot 1.4, you can add following lines to your application.properties to set the […]

En Lire Plus

(SOLVED) Cannot make a static reference to the non-static method

if you have this error that mean you are using your Repository interface in the place of you using and instance of it ,Exemple : if you have an interface PersonnelRepository and you want to use the function getOne(). if you do like that PersonnelRepository.getOne(id) you will have the error Cannot make a static reference […]

En Lire Plus

Solution for : Why hibernate does not insert into child table ?

If Hibernate does not insert element in child table , The reason is because the mapping does not cascade the persist operation. Example : The solution is : Cascade operations are extremely useful, but be mindful of their potential side effects, particularly if you modify Ticket which you don’t intend for an operation to be […]

En Lire Plus

(SOLVED) “object references an unsaved transient instance”

How to fix the Hibernate “object references an unsaved transient instance – save the transient instance before flushing” error ! SOLUTION : You should include on your collection mapping: (if using xml) or (if using annotations) This happens because you have a collection in your entity, and that collection has one or more items which […]

En Lire Plus

(SOLVED) Impossible de créer le bean géré

Exemple : Impossible de créer le bean géré «etudiantBean». Les problèmes suivants ont été détectés : – La classe de bean géré «controller.EtudiantBean» du bean géré «etudiantBean» ne déclare pas de constructeur public sans argument. – La classe de bean géré «controller.EtudiantBean» du bean géré «etudiantBean» ne déclare pas de constructeur public sans argument. Some time […]

En Lire Plus

StackOverflowError en Java

Vue d’ensemble StackOverflowError Java : StackOverflowError peut être agaçant pour les développeurs Java, car il s’agit de l’une des erreurs d’exécution les plus courantes que nous pouvons rencontrer. Dans cet article, nous verrons comment cette erreur peut se produire en examinant divers exemples de code et comment y remédier. Cadres de pile et comment StackOverflowError se produit Commençons […]

En Lire Plus