Category "java"

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

Java concurrent deadlock

Run the Main.main() method seems like a deadlock has occurred. I found out it can be fixed if replace notify() with notifyAll(). But why? Shouldn't the worst ca

Printing all the paths in a tree from root to each leaf

I am trying to print all the paths from root to leaf in a tree, but having some issues collecting the path items. Consider the following graph: In my case thou

How can I get the Minecraft class loader?

I'm loading an agent to Minecraft JVM and when I get all the loaded classes from the instrumentation, most of them are not there. My code looks like Class.forNa

How to remove Keys that would cause Collisions before executing Collectors.toMap()

I have a stream of objects similar to this previous question, however, instead of ignoring duplicate values, I would like to remove any values from that stream