Category "java"

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

Spring Boot 2 preventing Tomcat 9 from shutting down

I am having an issue where a Tomcat server fails to shut down correctly when it has a Spring Boot web application. This causes issues with scheduled tasks and b

Gradle Build Failed after updated to 7.4.1 in windows 10 for java 8 project

Getting error like this What went wrong: Unable to start the daemon process. This problem might be caused by incorrect configuration of the daemon. For example,

Location of toString() Method of java.util.LinkedList

I am studying LinkedLists and wanted to check Java's implementation. However, I have some questions. I saw that I can print the contents of java.util.LinkedList

Can I configure the pool size of a specific Quarkus Vertx ConsumeEvent?

The parameter quarkus.vertx.worker-pool-size allows me to configure the "Thread size of the worker thread pool", according to the quarkus guide - All configurat

Restricting browser drivers in selenium

I am a newbie to selenium. Just wanted to know how do I restrict the script to take only one version of a browser. I dont want to update my browser driver again

Use DBUnit in Spring without defined entities via "nativequery"

I am trying to use DBunit while testing a Spring controller. The tests fail to initialize because my dataset contains tables/columns which are not defined by an

System of linear equations Thomas algorithm Java

I have adapted the Thomas Algorithm for solving the tridiagonal matrix problem i.e. finding the value of the vector T in the equation AT = b where A and b are k

Mimicking compile time interfaces in python

Summary This question first uses Java examples to demonstrate what I am trying to achieve, then shows Python equivalents where I attempt to replicate the compil

UnmarshallerImpl finalize() method leads to memory leak

I'm using webServiceTemplate in my multithread Spring app. There are my jaxb dependencies: compile('javax.xml.bind:jaxb-api:2.3.0') compile('org.glassfish.jaxb:

Adding Javalin dependencies

I'm trying to use Javalin in my project and I can't seem to understand how to add the needed dependencies in order to work with Javalin without compliation erro