Category "java"

Global exception handling in spring webflux during tests

I'm developing a service with spring webflux. I implemented exception handling using @ControllerAdvice. It works pretty well, but when I run integration tests i

Spring cloud Netflix-Hystrix gradle dependency not allowing spring boot application to start

I have built simple microservice application using Spring-Boot and Eureka server. Now, I want to add fault-tolerance in case any of service registered in Eureka

Bi-directional relation in hibernate is failing to be cascadelly saved

I am using a Spring-Boot (2.3.3) application with Hibernate (5.4.20) and JPA repository on MySql DB, and I have a Bi-directional relationship between an entity:

How to write a generic base64 screenshot method using selenium 4 with java and attach it to extent report on test failure?

method used currently public static String getScreenshot(String screenshotName) throws IOException { String dateName = new SimpleDateFormat("yyyyMMddhhm

how to use if statement in main to Create an object with user input and to use a method on the objects

I'm working on an exercise, where I need to create a subclass that has 2 constructors (1 is empty and sets the values as 0 the other one is getting the values.

Error initializing QuantumRenderer: no suitable pipeline found in Eclipse JavaFX

Showing "Error initializing QuantumRenderer: no suitable pipeline found" after running JavaFX application. I added required JavaFX jar files to the project and

How to solve below problem of Drawing Book

Hackerrank problem Drawing Book. Brie’s Drawing teacher asks her class to open their books to a page number. Brie can either start turning pages from

Java @requestBody doesn't work, dto empty

For some reason java can't map DTO with requestBody and all values are default ones, as for request it works, with payload for ex. "{"productId":1,"commitment":

Java Excel/POJO Mapping in POI

Java 8 here using Apache POI 4.1 to load Excel (XLSX) files into memory, and write lists of Java beans/POJOs back to new Excel files. To me, an Excel file (at

Java System Logger on WildFly

Since JDK 9 we have a new Java Logging API: https://docs.oracle.com/javase/9/docs/api/java/lang/System.Logger.html https://www.baeldung.com/java-9-logging-api h

Enable http actuator with disable default web server

I need create spring boot application as daemon with disabled default web server and with active server actuator by http. I need actuator only by http no jmx.

ERROR Failed to load resource: the server responded with a status of 403 () en angular

Errors I get ERRORES: Failed to load resource: the server responded with a status of 403 () login:1 Access to XMLHttpRequest at 'http://localhost:8080/l

vs2019 - Xamarin: loses path settings of "Java Development Kit Location"

I do a very simple thing. I go to Tools -> Options -> Xamarin> Android Settings and I change the "Java Development Kit Location" path. I press ok. I co

The specified method is not allowed against this resource in Amazon aws

Guys I may or may not be wrong, But seriously, I am struggling with file uploading problem in Amazon S3 bucket. When I am trying to hit on the request then I am

Getting java.io.IOException: Server returned HTTP response code: 400 for URL: when using a url which return 400 status code

I am trying to perform a get request using Groovy using the below code: String url = "url of endpoint" def responseXml = new XmlSlurper().parse(url) If the endp

Android gamepad app to dispatchKeyEvent to another app (game)

I am developing a game controller app for a school project that displays a virtual gamepad and is aimed at controlling any game app on Android. Of course, the g

It is possible to Stream data from beam (Scio) to an S3 bucket?

Currently, I'm working on a project which extracts data from a BigQuery table using Scio in Scala. I'm able to extract and ingest the data into ElasticSearch, b

IntelliJ : Cannot resolve method 'run(java.lang.Class, String[])'

I've encountered a problem where on all of my applications, there's a red cross on the top right. I can run it, but the cross doesn't seem to go away. I've open

Android Java - how to clear repeat drawings?

I have this code where I draw on a canvas then convert to a bitmap. predictBtn.setOnClickListener(new View.OnClickListener() { @Override

Run loom demo on IDEA

I want to run loom's demo, I downloaded jdk18-loom from http://jdk.java.net/loom/, and downloaded the latest version of IDEA: No matter I choose X or 17-previe