Category "java"

Storing constants in Fragment's companion object - a memory leak?

My understanding of companion object in Kotlin is that they are analogous to static modifiers in Java. It's bad practice to store static fields in Activities an

XSSFWorkbook overriding the template file

I'm using XSSFWorkbook to create a xlsx file which stores the result of a SQL query with JAVA 8. This process is done each month so I use a template xslx file t

Spring cloud gateway is unable to decode when deployed in the staging environment

I was recently tasked with upgrading a spring cloud app of ours due to the CVE-2022-22965 vulnerability. As part of that process, it became clear that the then

Android Studio error - groovy.lang.MissingMethodException: No signature of method: build_8sqj**q9.android() is applicable for argument types: ***

I prepared an android app in android studio then I copied my whole code manually from one sys to another. But after that, getting this error. Below are my both

Possible side effects when several CommandLine instance "work" on the same instance of an annotated class?

picoCLI's @-file mechanism is almost what I need, but not exactly. The reason is that I want to control the exact location of additional files parsed -- dependi

Extract a value in a json response with a variable

I am trying to return the id of a declared variable from a json file: i want my java code to search for the previous variable in the json response and once it i

Variable Declared Outside of For Loop Vs Inside

//assume there is a java class call Node, and node is an array of Node for(Node i: node){ Node j = i; } Node j; for(Node i: node){ j = i; } Can some

CompletableFuture, run asynchronous code after "join"

I'm facing some trouble after some month only on Javascript/Typescript. For example, let see this snippet: @Test public void testAsync(){ Completabl

Connecting to an SFTP channel via proxy returns com.jcraft.jsch.JSchException: ProxySOCKS5: server returns 2

I'm trying to connect to a SFTP channel throughout a Proxy, per requirements of the customer. The connection should happen with autentication to the final end

Maven project - compilation errors after cloning

I have a maven project that works perfectly fine locally but after I've pushed it to a remote repository on GitHub and cloned it somewhere else (even to a new l

How to get requests path with unresolved variables in Spring WebFlux

I'm trying to get the request's path with unresolved path variables in a WebFilter. I know in SpringBoot Servlet version it is possible to do this by getting re

How to fix [WARNING]: Timed out connecting to Chrome, retrying

I access Websites in a loop via selenium Java based. Some of the sites crash imediately so that i get the error [1618982990.911][WARNING]: Timed out connecting

Need regex which accept only 4 alpha numeric words and accept period, hyphen and underscore in between

I am trying to write a regex to accept only 4 words and in between the words accept special characters like period(.), hyphen(-) and underscore(). Also if I use

Type mismatch: cannot convert from Object Array to int

import java.util.*; public class tryAgain { public static void main(String[] args) { Scanner sc = new Scanner (System.in); //Cre

java.lang.NoSuchFieldError: CLIENT_ENDPOINT for Amazon ECS

I tried to list the ECS clusters using the code as follow: AmazonECS = amazonECS AmazonECSClientBuilder.standard().withRegion(region).withCredentials(new AWSSta

How to fetch genre of a movie using its genre_ids from tmdb api in android

I'd like to use the tmdb api in Android to display the movie's genre, but the problem is that we have to first find the genre id before we can display the genre

NPE: Attempt to invoke virtual method 'android.content.pm.ApplicationInfo android.content.Context.getApplicationInfo()' on a null object reference

I've this basic app called Navigation that I was trying to make to understand some concepts where there are 2 activities MainActivity and ActivityB MainActivity

Spring boot calling SOAP web service

I am trying to call SOAP web service from Spring boot, but I am having an issue with it. I have auto generated classes from this WSDL with maven-jaxb2-plugin: &

IntellIj not displaying exceptions from @BeforeAll JUnit5

In IntelliJ, with a Springboot project (2.6.6) using JUnit 5, given the following test class, IntelliJ doesn't display exceptions occuring in the @BeforeAll met

WAP to accept a string and print only the words having consecutive letters as same and number of occurrences [duplicate]

I was solving this question(the title) and I cant find the mistakes present so please help Input : The buffalo is stuck in a soggy field and