Posts

How to reset to previous commit.

Sometimes you may face situation where you need to take older commits and push it to repo. For this we can do below steps:- 1.) git reset --hard <commit_hash> 2.) git push origin <branch_name> --force Key here is forcing the push, no extra commits/commit messages etc

map struct :- Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure

Some times while integrating map-struct with spring boot/swagger we will get below exception:- [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project : Compilation failure [ERROR]  Couldn't retrieve @Mapper annotation Solution:- You don't need to exclude the entire swagger for this. You can do this to only exclude the Mapstruct dependency that swagger2 brings with itself: < dependency > < groupId >io.springfox</ groupId > < artifactId >springfox-swagger2</ artifactId > < version >${swagger2.version}</ version > < exclusions > < exclusion > < groupId >org.mapstruct</ groupId > < artifactId >mapstruct</ artifactId > </ exclusion > </ exclusions > </ dependency >

spring notes

1.)  As of Spring Framework 4.3, an @Autowired annotation on such a constructor is no longer necessary if the target bean only defines one constructor to begin with. However, if several constructors are available, at least one must be annotated to teach the container which one to use.

unable to start docker daemon

I stopped the docker daemon and tried to start it again but while doing so , I got below errors:- Redirecting to /bin/systemctl start docker.service Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details. Solution:-  echo "export DOCKER_HOST='tcp://0.0.0.0:2375'" >> ~/.bashrc $ source ~/.bashrc

making shell script executable

sudo chmod +x sample.sh else, it gives error permission denied -bash: ./sample.sh: Permission denied

bad interpreter: No such file or directory

I got below error while running shell script . -bash: ./sample.sh: /bin/bash^M: bad interpreter: No such file or directory The Problem ist you edit with Dos! Solution:- :set ff=unix :wq

spring boot vs vert.x

                              Spring Boot                                        Vert.x Managed by Pivotal Under Eclipse Foundation (VMware initially) Only JVM languages Polyglot - Any language (Overcome disadvantage of Node js - single threaded), Vert.x allows to create multiple threads based on the number of CPU cores whlie only one process is executed. Opinionated & heavy weight Very raw and light weight Bigger ecosystem and support for spring is huge Testing async. code might be tedious Spring boot is not reactive(event based) by default ...