Category "java"

Firebase Android FCM INVALID_SENDER when trying to get token

I created a google-services.json file and added to my android project but when I tried to get a token I received this exception: { Java.IO.IOException: java.uti

How to get remaining time of the day in java?

I would like to calculate the time remaining for next day 00:00:00 from the current date time. For e.g. time difference between 2022-05-07T05:49:41.883807900Z

Why do I subtract 1 from the element on an even position? I need only odd positions (odd indexes) Java

I need your help. I have the task : Given a List of Integer numbers, return the average of all odd numbers from the list or throw NoSuchElementException. But be

com.google.guava version upgrade from 20.0 to 30.0-jre

we are working on spring3 application so due to veracode issues i am trying to upgrade library com.google.guava 20.0 to 30.0-jre, getting below errors Error : 2

Spring Boot: Optional mapping of request parameters to POJO

I'm trying to map request parameters of a controller method into a POJO object, but only if any of its fields are present. However, I can't seem to find a way t

ILLegalAccessError tried to access method org.mockito.internal.handler.MockHandlerFactory

I am trying to mock a static method of InetAddress class using PowerMockito but I am getting the below error IllegalAccessError: Tried to access method org.mock

how to coverage write file func in java

I made a simple function? to which I give a list of objects and then get their headers (just some strings), then sort and write to a file when i made a test for

Java - Update Elements in Large XML Files

I work with very large XML datasets (1 GB+) and need to backtrack and update specific elements per node, depending on the values of other elements that follow.

best way to add a spring boot web application with JSPs to a docker container?

so i have a spring boot web application, it uses JSPs, and im supposed to put it in a container . my question is what is the best way ? ive tried to copy the pr

Are there any Java Class Library "header files" containing all method descriptors in the standard library?

In order to create a valid .class file, every method has to have a full internal name and type descriptors associated with it. When procedurally creating these,

Set of functions using Function interface [closed]

Let there be a set A = {1,2,3}. The goal is to compute all bijections on AxA. It should be of type Set<Function<T,T>> so that in t

Eclipse marvin classpath

I'll keep it short. I have a project in eclipse using Marvin, the Marvin's jar is added correctly in the build path, classpath. The problem is, whenever me or s

How do the dependency paths work in Java .classpath file?

In the Java .classpath file, I see a lot of dependency paths, something like this: <classpathentry kind="lib" path="/a/b/c/d/library.jar"/> Are these pat

What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it?

What does ArrayIndexOutOfBoundsException mean and how do I get rid of it? Here is a code sample that triggers the exception: String[] names = { "tom", "bob",

Why did eclipse build me 2 identical source folders?

Yesterday I was working on my project, and suddenly eclipse built me 2 identical source folder.. i dont know what happend. but i hope you cant help me to delete

Hide RecyclerView until List is sorted

When my RecyclerView loads it shows the unsorted list for a few milliseconds and then switches to the sorted list. Here is a video what it looks like: https://d

Android studio balance with timer (java)

I want to make on button press to start a timer and increment at same time , so let's say the balance is 0.00 i want it when the button is clicked to increase b

Spring Data JPA: how to make one to one relationship with SQL Server JSON column

Spring Data JPA: how to make one to one relationship with SQL Server JSON column? Class EntityA { long id; @Type(type = "json") @Column(columnDefinition =

Adding 2nd fxml within pane of 1st fxml

I'm brand new to javafx so apologies for the basic question! My question is how to add a 2nd fxml inside a pane from the 1st fxml. I've got a mini program here.

User profile fragment Setting

i am creating small app with login and signup option and also with profile fragment so that user can update their profile later. i design my user profile layout