What you need ? Docker is installed A simple Spring Boot application To start, we will go to the root folder of the project and create a new text file called Dockerfile. It’ll contain all steps necessary to create an image. For this tutorial, it looks like this: let’s explain every step : FROM java:8-jdk-alpine […]
Catégorie: Spring
(SOLVED) How to deploy angular 2+ front-end + spring boot back-end ?
To deploy and angular (2,8,…10) front-end application with a Spring boot Back-end follow the steps below : 1. Build your angular application First you have to build your front with the command line ng build, for that open a new Terminal in the angular project and run : after running this command , you will […]
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 […]
Spring Cloud Security
1. Overview The Spring Cloud Security module provides functionality related to token-based security in Spring Boot applications. Specifically, it simplifies OAuth2-based single sign-on – with support for token relaying between resource servers, as well as configuring downstream authentication using a built-in Zuul proxy. In this quick article, we’ll look at how to configure these features […]
(SOLVED) HTTP 404 not found with RestController annotation
RestController do not work !! RestController 404 not found : The Controller is in the same package as @SpringBootApplication but I cannot view any information during startup about RestController mapping url. The error is HTTP 404 not found. Solution : you have to add this dependecy to your Pom.xml
(SOLVED) Access to XMLHttpRequest from origin has been blocked by CORS policy
If you have this Error , when you are trying to consume an API using Angular and Spring The solution is : Jusd add the annotation @crossorigin in your RestController to allow your frontend consuming the API Read also : Solution for : net::ERR_CONNECTION_REFUSED in Angular
Service Registration and Discovery , Spring cloud
What You Will Build You will set up a Netflix Eureka service registry and then build a client that both registers itself with the registry and uses it to resolve its own host. A service registry is useful because it enables client-side load-balancing and decouples service providers from consumers without the need for DNS. What You Need […]
Comment retourner une chaîne simple en JSON dans Rest Controller ?
Format JSON RestController : Retournez text/plain (comme dans Renvoie uniquement le message de chaîne du contrôleur Spring MVC ) OR enroulez votre chaîne comme un objet. Définissez votre type de réponse sur application/json et vous aurez un JSON qui ressemble à
(SOLVED) What is Spring cloud ?
Spring Cloud provides tools for developers to quickly build some of the common patterns in distributed systems (e.g. configuration management, service discovery, circuit breakers, intelligent routing, micro-proxy, control bus, one-time tokens, global locks, leadership election, distributed sessions, cluster state). Coordination of distributed systems leads to boiler plate patterns, and using Spring Cloud developers can quickly […]
(SOLVED) No serializer found for class
No serializer found for class org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor You can Ignore to produce JSON output of a property by Or If you have any lazy loaded properties having a relationship. You can use this annotation at top of the property. Example: If you still have this error, please add this line of code in your application.properties file
Solution : java.sql.SQLException : The server time zone value
The server time zone value : if you have this error using Spring boot you have to add the server Time Zone in your configuration in application.properties add this line : just after the spring.datasource.url :
(SOLVED) java.sql.SQLException: Access denied for user ‘root’@’localhost’
Access denied for user : If you have this error using Spring boot : java.sql.sqlexception: access denied for user ‘root’@’localhost’ (using password: yes) This is because in did these mistake in the application.properties file: in spring.datasource.username you have to check if you put some space in or in : or you are using a wrrong […]
(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 […]
(SOLVED) Request processing failed; nested exception is org.hibernate.MappingException: Unknown entity
État HTTP 500 – Internal Server Error Request processing failed; nested exception is org.hibernate.MappingException Solution : If you have this error , that mean that you forgot to put the annotation @Entity of the import javax.persistence.Entity; and @Table of the import javax.persistence.Table; in the entity class.
Example : Spring Data JPA Paging and Sorting
Example Spring Data JPA Paging and Sorting : Throughout this tutorial, I will guide you to code paging and sorting functionalities for an existing Spring Boot application using Spring Data JPA. As you know, pagination allows the users to see a small portion of data at a time (a page), and sorting allows the users […]
Spring CORE – IOC
Introduction Spring Un framework est un cadre de développement qui contient des bonnes pratiques et qui permet d’éviter de recoder des classes utilitaires pour le but de se focaliser sur le metier. Spring est un framework open source pour construire et définir l’infrastructure d’une application Java, dont il facilite le développement et les tests. Spring […]
(SOLVED) The injection point has the following annotations
The injection point has the following annotations: – @org.springframework.beans.factory.annotation.Autowired(required=true) if you have this error using Spring data JPA and spring boot the solution will be : you have to add the @Service annotation in you service Implement class to tell spring that this class is a bean that will be injected laterwe use theses annotation […]
Spring Security error : BCryptPasswordEncoder
Consider defining a bean of type ‘org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder’ in your configuration. When you get this error : Consider defining a bean of type ‘org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder’ in your configuration. The solution is to add the BCrypt Encoder as a bean in the class main of your spring boot project : And add the methode to decrypt the passwords […]
Spring Security Error : AuthenticationManager
error : The type org.springframework.security.authentication.AuthenticationManager cannot be resolved. It is indirectly referenced from required .class files Spring Security error : When you get this error : The solution is : 1. Add spring-security-core to your build path. If you already have one, download the latest version.2. after mvn clean install , if you still see error in […]

Spring Boot Introduction + hello world example
Spring Boot hello world example: Spring framework has taken the software development industry by storm. Dependency Injection, rock solid MVC framework, Transaction management, messaging support, web-services etc are some of the aspects spring provides through its eco-system of related sub-frameworks. Convention over configuration is the most prominent key aspect Spring promotes. Spring Boot hello world […]