Spring Boot provides sensible defaults for many configuration properties. But we sometimes need to customize these with our case-specific values. And a common use case is changing the default port for the embedded server. To change the default port we can use the application.properties file : Or we can use the application.yml file : Here we […]
Articles taggés:SPRING
(SOLVED) How to Change the Default Port in Spring Boot using Java Config ?
In spring , we can configure the default port by setting the specific property when starting the application or by customizing the embedded server configuration. For that, we will set our @SpringBootApplication class : Here we changed the default Tomcat port 8080 to 8083. We can use a Command-Line Arguments to change the default port .
(SOLVED) How to Change the Default Port in Spring Boot using Command-Line Arguments ?
When running our spring application as a jar, we can set the server.port Command-Line argument with the java command :
(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
Solution : 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) , the injection point has the following annotations: , the injection point has the following annotations 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 […]
(SOLVED) : Consider defining a bean of type ‘org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder’ in your configuration.
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 […]
Exemple Spring MicroService + Spring Boot
Exemple Spring MicroService Spring Boot : Les problématiques rencontrées par les entreprises Problème n°1 : comment faire en sorte que les applications proposées en ligne soient toujours disponibles et ne souffrent jamais de coupure ou de ralentissement, quelle que soit l’affluence des utilisateurs sur celles-ci ? Problème n°2 : les entreprises se livrent à une “guerre de la mise […]

Création Projet Spring Boot
1. Qu’est-ce que Spring Boot ? tuto spring boot : Publiée en 2012, Spring Boot est une solution de « convention plutôt que configuration » destinée à l’infrastructure logicielle Java Spring qui réduit la complexité de la configuration de nouveaux projets Spring. À cette fin, Spring Boot définit une configuration de base incluant des directives pour l’utilisation de l’infrastructure […]

Spring Boot + base de données MySQL
Spring Boot MySQL : Ce tutorial est une continuité de tutoriel : Creation d’un projet Spring boot ; Spring Boot MySQL : Spring Boot propose une assistance de premier ordre pour la création et l’intégration des sources de données dans les bases de données SQL ou NoSQL de votre choix. Vous n’aurez pas à écrire de code […]