We are using graphql-spqr and graphql-spqr-spring-boot-starter for a new project (With Spring DataJPA, hibernate and so on). We have a mutation like this: This mutation works fine: I have ommitted the variables as they are not important. It does not work if I change it to: I get a LazyInitalizationException a…
Adding Same Site Header to JSESSIONID Spring Security
Google chrome has introduced changes that require setting the Same-Site header. In order to achieve this, I added a custom filter as follows, Following is the code for Security Configuration However, when I look at the headers received, I get this The filter adds the required fields in all the responses excep…
SpringBoot, Kafka : java.lang.NoSuchMethodError: org.apache.kafka.clients.producer.Producer.close(Ljava/time/Duration;)V
I’m using spring boot v2.2.4 and Apache Kafka in my project. Below is my pom.xml file: Below is the code which i have as part of kafka But when json message is sent to kafka queue, i’m getting below error however json message is getting reached to queue, but i want to understand why i’m gett…
Logstash : “Error: Could not find or load main class Heal” when running logstash.bat
I just downloaded logstash 7.6.0 in windows 10. I already have elastic search (7.6.0) and kibana (7.6.0) running. When I run logstash.bat with default configuration it gives this error. Error: Could not find or load main class Heal I have jdk 11 installed and I checked that the environment variable is set. Pl…
How do I get a SpringBatch Integration test to load my application properties?
I have the following Spring Batch test in my src/test/java: I define my test/resources/application-local-test.yml: and in my main application, a SpringBatch Configuration: When I try to run the integration test my application-local-test.yml is not getting picked up: What am I doing wrong? Answer I ran into th…
Sandboxed java scripting replacement for Nashorn
I’ve been using Nashorn for awk-like bulk data processing. The idea is, that there’s a lot of incoming data, coming row by row, one by another. And each row consists of named fields. These data are processed by user-defined scripts stored somewhere externally and editable by users. Scripts are sim…
Intellij Code Inspection for Custom Annotation
One of the problems I’ve encountered while using DTOs is that I often find myself shipping (accidentally) entities along with DTOs. To mitigate this problem, I created another Maven project with an annotation (@ValidDTO) and its processor that finds if a DTO annotated with @ValidDTO has @Entity annotate…
Retrieve location from Firebase and put marker on google map
I created the database in Firebase and tried to show the marker in the map. Still not working. what should I do. The app runs but when map activity is opened the app closes. I creates the database manually. I referred this link :- Retrieve location from Firebase and put marker on google map api for android. T…
JUnit: assert collection contains an element with a certain property
I want to assert (using JUnit and not any other dependencies like hamcrest) if a collection contains an element with a certain property value). I found this question How do I assert an Iterable contains elements with a certain property? using harmcrest. One option is to override the equals method to check onl…
Substring not equal to the string of the first character
I am struggling to figure out what’s wrong with my code. When the user input is “apple” I get that it doesn’t begin with a vowel. Answer You made a mistake using the substring method, you should say the start position in first parameter and the end position in second parameter : And no…