Category "java"

Restoring Interruption flag status in Java

Good Day! I have been going through the Java Docs & some online resources on properly handling the InterruptedException due to bug reported by SonarQube. Bu

Retrieving node/edge with mouse events

I'm following the official GraphStream tutorial, and as the title suggest - I'm trying to get node's by clicking on it. this is my code so far: import org.graph

How can i use a variable from an Activity to another Activty?

In my MainActivity i have a score variable, int score = 0; however i have another activity which is the DisplayScore activity (which displays the score) txtFin

getClassLoaderCache error when upgrading Gradle from 6.7 to 7.0.1

I'm fairly new to Gradle. Whenever I try to upgrade an existing project from 6.7 to 7.0.1 a traceback comes up as java.lang.NoSuchMethodException: org.gradle.ap

Build facturx invoice with Mustang library

I do try to build a factur-x using Mustang library. For minimum profile, a Buyer legal registration identifier is required. For this I build a trade party objec

Deserialize parent/child classes with different config with Jackson

I'm working on a Restful application with Spring Boot and I've defined my classes as below: class Organization { String name; } class Base { @JsonPrope

Calling an API that have username and password in Java

I'm trying to connect to an API that has a username and password with this code: try { URL url = new URL("https://url?UserName=username&Password=passwor

Is there "CASCADE ON UPDATE" functionality in Spring Boot for DB level?

How can I create CASCADE ON UPDATE funcionality Database level using Hibernate annotations? Similar to "@OnDelete(action = OnDeleteAction.CASCADE)". I don't mea

How to retrieve a specific Kubernetes deployment image tag using java api?

What I need is to retrieve image tag using java api for Kubernetes. basically, what the command kubectl -n <NAMESPACE> get deployments.apps <DEPLOYMENT

How to postpone response on netty

In my Netty application I need to postpone the response until some data (which is going to be provided by other clients) be available. It's more like Producer-C

How to validate request which built from other classes?

There is a class UserRequest class UserRequest { private Name name; private Address address; private Date dob; //getters and setters } This class is bu

java.lang.UnsatisfiedLinkError: /opt/jdk17/lib/libawt_xawt.so: libXrender.so.1: cannot open shared object file: No such file or directory

I don't understand what went wrong with me. I'm trying to run Spigot Server Core 1.18.2, and I'm constantly having problems with this library. [19:21:50 INFO]:

How to convert animated webp to gif in android / java?

I want to convert the animated webp files to gif file and looking for solution since couple of days but did not get any easy straight solution yet. I tried ffmp

Why is my collections.sort leading to different outputs in 2 arraylists with the same data [closed]

I am having some trouble sorting 2 arraylists of mine which have the exact same data, one is received through my API and the other is parsed t

Cannot Autowiring Spring MQTT

Spring 2.5.3 and Java 1.8 I want to send a json data to a mqtt topic but i cannot autowiring my Interface and i'm getting null pointer exception when i try with

Hadoop: java.lang.ClassNotFoundException:map-reduce

Hi I'm using eclipse to export the jar file of map reduce program.When i try to run the jar file using the command hadoop jar WordCountdemo.jar /Demo2/WordCount

WAP to compute the sum of the first n terms of the following series [duplicate]

S = 1 + 1/2! + 1/3! + 1/4!..... Here is my code: import java.util.Scanner; public class question{ public static void main(String[] args)

Mockito can not mock Random in Java 17

Trying to update my project from Java 11 to Java 17 and got an unexpected error from Mockito in a specific test. mock(java.util.Random.class); Throws Feb 04, 2

problem configuring CORSin spring boot and reactjs

After reading all the MDN docs on CORS, I am trying to fetch resources at a spring boot server at localhost:8080 from a ReactJS app at localhost:3000, yet i can

What will this assertEquals() in junit return?

Does the assertEquals function result in? WIll this fail beccause assertEquals() requires tolerance value for double comparison? import java.util.*; class