Skip to content

Tag: java

Maximum length of domain name

As I noticed class from google library com.google.common.net.InternetDomainName containts the following constant: Code below, checks length during creation of InternetDomainName instance: But RFC-2181 says that: So, what is valid max length for domain name? Answer This is straight from wikipedia: The full dom…

SimpleDateFormat parse returns bad date

I am using SimpleDateFormat in order to parse a String. Here is an example: When I check dirDate in debug mode, or print it, the date I get is Mon Apr 07 14:35:42 FET 2014. Why do I get such an offset? It cannot be counted as a timezone offset(although it seems already wrong to apply an offset). How can

How to fix Hibernate LazyInitializationException: failed to lazily initialize a collection of roles, could not initialize proxy – no Session

In the custom AuthenticationProvider from my spring project, I am trying read the list of authorities of the logged user, but I am facing the following error: Reading other topics from here in StackOverflow, I understand this happens due the way this type of atribute is handled by the framework, but i can&#82…

Java: How to check that 2 binary files are same?

What is the easiest way to check (in a unit test) whether binary files A and B are equal? Answer Are third-party libraries fair game? Guava has Files.equal(File, File). There’s no real reason to bother with hashing if you don’t have to; it can only be less efficient.

List of ALL Spring Boot application properties

Is there a list of ALL properties that are available in a application.yml or application.properties file when using Spring Boot? I only seem to find the common ones. Answer As rightly pointed out by earlier answers you may find the “common” application properties listed here. But incase you need t…