Wednesday, December 16, 2020

Failed to transfer file: http://repo1.maven.org/maven2. Return code is: 501 , ReasonPhrase:HTTPS Required


If you are getting the following error when you are building your Java project using maven or gradle:

Failed to transfer file: http://repo1.maven.org/maven2. 
Return code is: 501 , ReasonPhrase:HTTPS Required

And you are thinking what happened, I haven’t changed anything in my project, no new dependencies, or repositories. The answer is that you haven’t changed anything. 

Do not panic! Effective January 15, 2020, the Central Repository is not longer supporting communication over HTTP and it requires requests to the repository must be over HTTPS.

Monday, August 31, 2020

Latency for sharing data while using Hazelcast on Virtual Machine


A few days back we found out one old app which was running on multiple nodes while having in-memory cache usage. So, as a result, there was a case when the request came to the first node and the second node didn't get that data, and the app wasn't functioning properly. 

So, as always first thing which we considered to use Redis. However, we don't have ready to use the Redis cluster and we started looking for other solutions in a market. Finally, I saw there is a Hazelcast which allows sharing data between nodes even without having the Hazelcast cluster. Of course, it is working when you are running in the same network. So, nodes should be able to multicast and make a proper cluster.

Wednesday, November 13, 2019

Java List vs List<?> vs List<Object>

Before generics were introduced developers used lists as List which means you can store any type of objects including null inside it and when you read it you need to cast it
List list = new ArrayList();
list.add("String test");
list.add(new Date());

String s = (String) list.get(0);
From code above you can expect ClassCastException because if you try to assign 2nd item to String it will not succeed and you will get an exception during runtime. To prevent it you need to check if your type is correct and then cast as below

Friday, May 3, 2019

What kind of benefits you can expect in Poland

Hey, 

I relocated to Poland(Krakow) in 2017 and I'm very happy to be here. I just regret that why I didn't do it 5-10 years ago :) 

Except nice and kind people, beautiful, old and safe city you can even expect a lot of benefits from the government and companies. Today I want to share all kind of benefits which I know and use here. If you know additional ones please feel free to leave them in the comment, I'll be happy to check it and add to the list :)

Thursday, August 23, 2018

How to hibernate from the lock screen on Ubuntu 18


By default Ubuntu doesnt support hibernate option. Even when u enable it using "pm-utils" during resume(wake-up) your laptop will not require password. 
And this is very risky moment. 

In my case, I created a keyboard shortcut which enables hibernate and lock. 
Today I will share steps how you also can do it for your laptop/pc.