Category "java"

How to return a marshalled JSON that has a nested property?

Fellow programmers from SO! I am building a simple Spring Boot example just to add a Client using a RESTful API. I have written this Controller: import org.spri

Upgrading Jenkins Java version from 8 to 11

I'd like to upgrade java from 8 to 11 as recommended for Jenkins 2.303.1, I'm reading the guide in https://www.jenkins.io/doc/administration/requirements/upgrad

How to access and return the result of an AsyncTask from a repository?

I'm new to coding, put already in a lot of hours and feel like I'm progressing step by step. However, I've encountered a problem that I was not able to solve ev

org.powermock.api.mockito.ClassNotPreparedException when it's declared to be prepared

I don't understand why this is showing since my test definitely asked PowerMock to prepare for it. @PrepareForTest({AmazonSQSClientBuilder.class}) @RunWith(Powe

trouble printing a range of numbers in an array list with own inputs and indices - 3.8 MOOC JAVA

I have an exercise problem from MOOC.fi that I am stuck on! We are learning about arrays and lists in Java, and here is the text for the problem: "The exercise

How to get part of string from regex in Java

For example, I have string with range of earnings: 5 000-10 000 USD and i want to extract from that string minimum and maximum value. I prepared regexes, for e

Get list of keys in Complex JSON Object (Java 8)

I am dealing with a JSON that looks like this :- { "key1": { "key1.1": { "nestedkey1": "something", "nestedkey2": "something", "nest

Cookie Management For Webflux WebClient

I have a WebClient that sends a JSON object with login credentials to a remote server. The remote server then returns the cookie. After which I need to POST dat

How do I know if an array list of objects contain a certain string?

I made a method that search through an array list of objects. Then if the searchKey is found in the array list it will print this certain item. Here is how I it

Cookie Management For Webflux WebClient

I have a WebClient that sends a JSON object with login credentials to a remote server. The remote server then returns the cookie. After which I need to POST dat

Java program runs yet compilation fails

I wrote a Java program whose filename was (intentionally) different from the class I wrote inside the file. The javac command failed as expected on both CMD and

Spring Cloud Gateway for composite API calls?

I am starting to build a Microservice API Gateway, and I am considering Spring Cloud to help me with the routing. But some calls to the Gateway API will need mu

Is there a cleaner / simpler way to calculate the edge in a geometry that a line crosses?

In the code below it is fairly simple to check does the line cross into the geometry or not - it's also trivial to work out the coordinate that the line crosses

How to configure Spring-Security AntPathRequestMatcher to case insensitive in XML configuration

We recently upgraded Spring-Security from 3.X to 5.6. Most of the issues we could iron out however one thing proves difficult. The problem was caused by a chang

My data is not getting uploaded in firebase it has internet access creating user with firebase auth that also not getting uploaded & nor child created

Below is the java file of this activity. I want my name and email to be stored in realtime database and sign in with firebase auth, but neither is working. I fo

How to remove last slash "/" from base url in Retrofit 2

When I Type Base Url="https://www.bkashcluster.com:9081/dreamwave/merchant/trxcheck/sendmsg/" with last slash(/) then give me message like this: Response{proto

DependencyException: Failed to find provider with satisfied dependency set for interface org.ehcache.core.spi.store.Store

I have an app that uses EHCache, it worked when using Payara Application server version 1.0.5 but after upgrading to 1.1.0 it started breaking. Here's a snippet

JNI: SIGSEGV when calling native function from Java, after native registration of same function on library second opening

I have an Android app that is structured in the following way: CORE: Is the class of the accessibility service that dinamically loads a few dex files. It will b

This error handler cannot process 'SerializationException's directly;

The image below is my topic. Every once in a while, a value other than an empty or json is returned. If it is null, it throws an error as below and enters the

Solana rpc subscribe to account transactions

I am trying to listen for transactions for an account, I need to know when a transaction is received and get the hash of that transaction. I am using Solana's j