October 22, 2024
Chicago 12, Melborne City, USA
java

Question About How to Write about Prgramming

I’m currently in the process of writing a book and one of my main characters is a video game designer. I’m at a pretty pivotal point in the story where the designer realizes he created a sentient character and is going back to try and find where it/the sentience began. Problem is I don’t know

Read More
java

Fetching min records for PK without using scan

I am new developer in Dynamo and I am trying to build a query in dynamo to get each registry with the min value of the number of retries for the PK. For example, in the following data set, I want to get the registry with sk 87bee31f-03da-42f3-92ec-5b8e5e1e726f and registry with sk 87bee31f-03da-42f3-92ec-5b8e5e1e746f.I understand that

Read More
java

Constructor in class cannot be applied to given types …. no arguments reason: actual and formal argument lists differ in length

Assignment: Develop a public subclass named Dog that extends an existing class called Animal. The Animal class models an animal with basic attributes such as name (String) and age (int), with corresponding public getters and setters: public class Animal { private String name; private int age; public Animal(String name, int age) { this.name = name;

Read More
java

Spring 2.5.5.jar reported as vulnerable with CVE-2010-1622 and we need a patch or support help to resolve this error

In Our Project We are using the Spring version 2.5.5.jar. Spring 2.5.5.jar reported as vulnerable and we need a patch or support help to resolve this CVE-2010-1622 error. Our project very core and getting lots of issue when replaced the next closer version 5.3.3 which is not vulnerable. But its a huge change. If possible

Read More
java

How to create a Tuple2, Tuple3 etc in Java Reactor?

Created this question and answer to help others with quick lookup of how to create a Reactor Tuple, such as reactor.util.function.Tuple2<T1,T2> I couldn’t find any example constructor on the Javadoc for Tuple2 so had to do some more digging. You need to sign in to view this answers

Read More
java

Java program using Clean Architecture, DAO and Repository

I’m developing a simple Java console program to access PostgreSQL database using JDBC. The most inner layers talk to the outer layers by means abstraction (interface and abstract class). My program follows the Clean Architecture and I have the following: domain entity Student.java Course.java repository Repository<T> (interface) StudentRepository (interface) CourseRepository (interface) use case StudentUseCase.java CourseUseCase.java

Read More
java

Parsing hyphenated yaml fields with snakeyaml?

I have a yaml file that looks like this: resource-path: "src/resource" The data class is generated by lombok and has methods getResourcePath and setResourcePath. I’ve checked these by printing out the methods on the class to be sure. When I try to populate that data class I get this error: Unable to find property resource-path

Read More
java

CascadeType.ALL doesn't save the children. the child doesn't get presist and saved

I have three Entity such as following: @Table(name = "input") @Entity @Data public class CreationInputEntity { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE) @Column(name = "ID", unique = true, nullable = false, updatable = false) Long id; @OneToOne(cascade=CascadeType.ALL) @JoinColumn(name = "index_id", referencedColumnName = "id") IndexEntity index; } @Table(name = "index") @Entity @Data public class IndexEntity { @Id @GeneratedValue(strategy

Read More
java

A loader as JAR Spring WebFlux reactive with Reactive Repository

We wrote a spring application webflux reactive with ReactiveRepository that we deployed in a cloud run and it works fine launched by a GCP scheduler that call an API REST. Now, our customer ask to reduce costs defining a job cloud run on GCP so we migrate from war to jar in a new Spring

Read More
java

List the Virtual Threads in Java

How do I list all the virtual threads in a JVM? ThreadMXBean.dumpAllThreads(), ThreadMXBean.getAllThreadIds(), ThreadGroup.enumerate(), and Thread.getAllStackTraces() do not return virtual threads. You need to sign in to view this answers

Read More