I am trying to configure a configuration server for all the properties in our application using @EnableConfigServer in spring boot. Please see the code below : pom.xml application.properties Copied all the property files to : /Users/Sankest/StarterProjects/MicroServices/AllConfigurations/ But when I try to ac…
DateTimeFormatter – Strict vs Lenient unexpected behaviour
I have some text that is only being parsed by a DateTimeFormatter when the parse style is Strict – and not when it’s Lenient. This seems like the opposite behaviour to what I’d expect? Example: Output: Answer Having posted this as a bug – https://bugs.java.com/bugdatabase/view_bug.do?b…
org.springframework.web.reactive.function.UnsupportedMediaTypeException: Content type ‘text/xml;charset=UTF-8’ not supported for bodyType
using Java 11, SpringBoot 2, WebFlux, WebClient and Jackson trying to use Spring WebClient to consume a Web service endpoint that returns XML, content type: ‘text/xml;charset=UTF-8’ Jackson XML dependency in the project’s pom.xml: WebClient code that triggers a request to external API and bu…
How to solve could not find or load main class error with spring boot?
I created a Maven project for Spring Boot. I have a lot of Spring dependencies and one main class: The folder structure of src directory is: In my pom.xml I use maven-assembly-plugin in order to build my project in a standalone .jar file. Even though I triple checked that the directory structure and main clas…
Error creating bean with name ‘entityManagerFactory’ defined in class path resource (Invocation of init method failed)
When I try to run my spring-boot project with hibernate and MySql, I got following error. My application.properties In pom.xml I have following dependencies, and my Course model looks like below, I also referred previous questions(Error creating bean with name ‘entityManagerFactory’ defined in cla…
How do I use Multiple Substitutions in Lookups for Log4J 2 configurations? Is it possible?
I have a situation in which I want Log4J 2 to determine which directory to use for logging. The pseudocode is as follows: The configuration I have for properties (in log4j2.xml) is as follows: What I think it should look like: What I’m not sure on is how to get both ${env:LOG_DIR} and ${sys:catalina.bas…
How can I access the results from spring actuator healthcheck in Java code?
I’ve setup a healthcheck actuator with the endpoint /actuator/health, which produces something like the following for my application when you go to the URL: Is there a way I can access these results in my Java code using the Spring APIs? I’m monitoring for any that go down and sending out slack no…
Java stream/collect: map one item with multiple fields to multiple keys
I have the following code that I’d like to try to write using the java collectors. Given 2 attributes (firstname and lastname) of a person, I’d like to get a map containing the unique firstname or lastname as a key, and the list of the corresponding persons. Here’s a set of data : Output (as…
Transparent EditText Android Studio
I am trying to make my EditText in my android studio project transparent. I want it to look like the EditText here But mine doesn’t look like that even though I have tried using transparent and ffffff can someone please help me with this ? I want my edit text background to look like the one in the image…
Why my http post request with android volley throws error (localhost)?
I’m working on an android studio project and i’ve had some problems trying to make a post request with volley library. I’ve already tested my API with postman and all works fine, so the problem is from the client part. I’ve already added the internet permission in my android manifest: …