Category "java"

Position x axis labels on top left and right

I have a dual axis jfreechart which has two x axis. By default the axis labels are appearing horizontally, I wanted to display them at the top left and right.

Difference between @Mock, @MockBean and Mockito.mock()

When creating tests and mocking dependencies, what is the difference between these three approaches? @MockBean: @MockBean MyService myservice; @Mock: @Mock

Firebase Admin SDK with Java

I am trying to setup firebase admin sdk in a Java project. Following the steps at https://firebase.google.com/docs/admin/setup#add_the_sdk I successfully added

Java - JAR file would not execute from the terminal command line

I am relatively new to Java I finished tutorial where an example of how to create and run JAR file was explained. Could you give an advice of what should be don

Mockito: Verify if restTemplate.exchange() is called

i try to test my SpringBoot application with Mockito. Is it possible to check if a restTemplate.exchange() method is called n times? For example: verify(restTem

spark-streaming-kafka-0-8 vs spark-streaming-kafka-0-10

I am a new beginner in the big data field, I need to make a demo which streams data from Kafka topic using spark stream then make some aggregation and filtering

Issue on label and panel's transparency

Here there is my frame: As you can see, there are some components (JLabel, JPanel, JTable, JScrollPane) on which I called the metod setBackgroundColor(new Colo

Updating multiple values of different keys in map using java

I have converted a JSON file to a map and I need to modify multiple values of different keys at once using JAVA. Following is the map converted JSON file: {

Error of connection jdbc postgreSQL Android Studio - Failed resolution of: Ljava/lang/management/ManagementFactory;

I don't understand why the code doesn't works on Android, it's the same code in Java and it's works on my laptop. I've already search on Google, Stackoverflow,

Fastest way to read a CSV file java

I´ve been trying to read several csv files (arround 20 MB) using openCSV, but so far it has been slow. Im trying to read 4 csv files which I´m loadi

ANR and crash in an android app, Android 8(.1), 90% Huawei devices

Since a recent android app update, I'm facing an ANR and a crash issue, that mainly appear on Huawei devices running Android 8. (I managed to reproduce the ANR

Jenkins pipeline library build using Java instead of Groovy

I would like to write my company Jenkins Pipeline Library using Java not Groovy, as groovy is slower than Java. I tried to find examples of such Java Jenkins li

How to curl a POST endpoint with a protobuf payload

I have a POST endpoint in my Java service that expects a protobuf 3 payload. This service is used by other services which send the protobuf payload. I would lik

Dynamic dropdowns using thymeleaf, spring boot

I have 3 dropdowns(one is populate with cities, one with agencies and one with services). If I select one city, the second dropdown should load the data(agencie

RuntimeException: Error in evaluationEvaluation: status: 13 value: {message=Invalid or unexpected token}

when i uploaded to google play console, and review finished. apk rejected by showing this error. how to solve this problem, anyone have a solution? FATAL EXCEPT

How to format only changed line instead of the whole file in Intelijj IDEA

Intellij format complete file when I use Ctl+Atl+L for from menu code-> Reformat Code. This generates whole diff in git commit. I want to format only the cod

How to add scheduled job to all nodes in java springboot cluster?

We have two springboot servers. We use nginx so that the user request will be sent to one of the server node. Now we want to achieve that: After user inputs thr

How to limit number of parallel executions in ParallelStream?

list.parallelStream().forEach(element -> ...); How can I limit the number of parallel threads nowadays? There was a "hack" in the past to set a System prope

How to use math.max in thymeleaf to find maximum number?

While trying to use max function in thymeleaf I got OGNL expressionn everytime. I'm not even sure if we can use functions like max/min in thymeleaf. Tried to lo

evoking gradlew task produces never ending "....... Daemon, 1 busy Daemon could not be reused..." and add 1 to busy every line

Sorry if the question title is not quality to say the least, But i am stumped at this point. Trying to update any project i have to gradle-wrapper 6.5 and up p