As soon as you scale-out your Spring Boot application (run with multiple instances) to e.g. increase throughput or availability, you have to ensure your application is ready for this architecture. Some parts of an application require tweaks before they fit for such an architecture. The use of
@Scheduledtasks is a candidate for this. Most of the time, you only want this execution to happen on one instance and not in parallel. With this blog post, you'll learn how ShedLock can be used to only execute a scheduled task once for a Spring Boot application.
A lot of Spring Boot…
You are trying to run a docker container or do the docker tutorial, but you only get an error message like this:
docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.26/containers/create: dial unix /var/run/docker.sock: connect: permission denied.
See 'docker run --help'.
The error message tells you that your current user can’t access the docker engine, because you’re lacking permissions to access the unix socket to communicate with the engine.
As a temporary solution, you can use
sudo to run the failed command as root (e.g.
sudo docker ps). …
sudo usermod -a -G docker $USER
But what does this command actually do on your system?
Let’s break it down:
sudomeans: Run this command as root. This is required for usermod since usually only root can modify which groups a user belongs to
usermodis a command that modifies the system configuration for a specific user (
$USERin our example – see below). See the manpage documentation for more details on what you can do with it!
-ais a shortcut for
--append: It means append the group to the list of groups the user belongs to!
The article talks about How we can avoid NullPointerException, while writing program in java
NullPointerException is a RuntimeException. In Java, a special null value can be assigned to an object reference. NullPointerException is thrown when an application attempts to use an object reference that has the null value. These include:
Senior Engineer at Harman