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

Java WebFlux r2dbc might not have been inizialized repository interface

I m building a Java SpringBoot Application with WebFlux. So in this application I need to make some APIs to get data from database TSQL using r2dbc. So I create this code, this is my interface Repository: import it.silver.data.pojo.Percorsi; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.reactive.ReactiveCrudRepository; import reactor.core.publisher.Flux; public interface PercorsiRepository extends ReactiveCrudRepository<Percorsi, Integer> { @Query("SELECT * FROM

Read More
java

Problem with making a .jar with JavaFX and maven

newbie here, I´m creating an App in IntelliJ with Maven, JDK 22, non-modular and using JavaFX 17.0.10, the problem is that when I generate my .jar with dependencies, it doesn’t open by double clicking it, instead I have to use java --module-path "C:\path\to\javafx-sdk-17.0.10\lib" --add-modules javafx.controls,javafx.fxml -jar BO-1.0-SNAPSHOT-jar-with-dependencies.jar in cmd. When i run mvn clean package

Read More
java

Spring Boot App throwing a strange exception

I am following a tutorial and everything seems to work for the author but not for me. The purpose of the use case is to add a new category (id, name, image and a boolean value). Category entity: @Entity @AllArgsConstructor @NoArgsConstructor @Getter @Setter public class Category { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int id; private

Read More
java

Spring 6 OAuth 2.0 – No Refresh Token

I got stuck with the OAuth 2.0 Server in Spring 6 Spring Boot 3. I build an AuthServer and an ResourceServer. With my JS-Client I can Log in, get an auth-code, then I can exchange this code for the access-token and here begins the dilema. I get an json-obj with: access_token scope id_token token_type expires_in

Read More
java

Postgres drop type XX000 “cache lookup failed for type”

I’m using Quarkus and Hibernate to work with PostgreSQL/PostGIS. I have an entity Geofence that contains a Polygon field. The issue occurs when running tests with Cucumber. The problem: When running the tests, I get the following error on the second and subsequent examples within the test scenarios: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute statement ...

Read More
java

Why one to many data not go to backend?

I currently creating supplier form that we can add supplier and assign him to different brand and categories.that mean supplier related with one to many relation with supplier_has_brand_category. but i face this issue. frontend supplier obj pass correctly without any other issue. but backend supplier_has_brand_category is null. Supplier Entity import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue;

Read More
java

the request was rejected because no multipart boundary was found (java/angular)

i’m trying to build a project in Angular and Java where i upload a file from the frontend interface to a mysql database through the backend built in spring boot. When i upload the file from postman it works. When i upload it from the frontend i get the following error: org.apache.tomcat.util.http.fileupload.FileUploadException: the request was

Read More
java

Microservices – saga choreography

I am usure how to maintain consistency in a microservices architecture system using choreography for transaction management. Take this simple architecture : For the Operation #1 and #2 I can use the Outbox pattern to ensure the changes in the database result in a message being published on the Queue. Or simply One Phase commit

Read More
java

Kubernetes NGINX Ingress Path Rewrite Issue (noVNC Context Path Problem)

I’m deploying an application using noVNC on a Kubernetes cluster. I am using NGINX Ingress to expose the application externally and handling user-specific pods via context paths. The Issue Each pod is accessed through a user-specific path appended to the domain, like http://example.com/podPath. The index.html page loads correctly when accessed. However, when clicking on internal

Read More
java

timestamp header value getting replaced at consumer

I have a kafka producer sending data using KafkaTemplate.send(). In the ProducerRecord, I add a header with key ‘timestamp’ and add a custom timestamp value. I have a consumer consuming records using @KafkaListener to ConsumerRecord object. When I try to access the ‘timestamp’ header from this consumer record, I get the value whatever I send

Read More