Cannot find ServletContextInitializer

springIf you are upgrading to Spring Boot 1.5, you may notice that some classes, methods and properties were removed. One of them is ServletContextInitializer that was used to configure Java Servlet context. It was an interface and was available in Spring Boot 1.4 but it was marked as deprecated. It disappeared with the upgrade. See how it can be replaced.

Google and Facebook login in one application

google facebookIf you want to avoid maintaining a users database and creating a custom authentication based on a login form, you should consider OAuth2 and their 3rd party providers. Your users will be able to log in with their social accounts. That is great for them as they do not need to remember new passwords and for other various reasons. Some of them are described in What is OpenID, OAuth2 and Google Sign In?

Module xyz reads package org.apache.commons.logging from both commons.logging and jcl.over.slf4j

modulesWhen I tried to migrate one of my projects to Java 9 and modules, I encountered this error - module xyz reads package org.apache.commons.logging from both commons.logging and jcl.over.slf4j. As this package (org.apache.commons.logging) is very popular, it might happen to you also. That is why I want to share with you some background of this issue and a solution that worked for me.

Getting started with Single Sign On with Facebook in Spring Boot app If a web application requires signing in, there are two options. The first one is to create and maintain a users database on your own. It has some disadvantages like additional work, registering a database of personal information etc. The second option is to use one of external authenticators like Google Sign-In. Integrating a web application based on Spring Boot with Google Sign-In is easy. Let me show it to you step by step.

facebookIf a web application requires signing in, there are two options. The first one is to create and maintain a users database on your own. It has some disadvantages like additional work, registering a database of personal information etc. The second option is to use one of external authenticators like Facebook Single Sign On. Integrating a web application based on Spring Boot with Facebook is easy. Let me show it to you step by step.

 

Scheduling tasks in Spring

clockJobs executing tasks periodically are common in computer systems. You may want to do something every minute, hour or make it running always on Monday 8 am. There are a few different solutions to achieve this. As I come from the database world, I would consider database solutions in the first place, but they are not the best for systems were business logic is implemented on the Java side and the periodic task is a part of that logic. So this time I will show you how to do it with Spring scheduler.