Category "java"

String anagram in Java

i am trying to create a program for string anagram that follows these conditions: method should allow only letters, white space, commas and dots in an anagram.

How to use Autowired in BeforeStep cucumber step definition

I'm getting NullPointerException when I use @Autowired in the @BeforeStep cucumber method in my step definition. What I'm doing wrong here? Please find my code

Excel Value to BigDecimal

Here's the problem: I am reading an Excel file that has both strings and numeric values. In my method I parse the respective fields into either BigDecimal or St

hasAnyRole() not working with Spring Security 5.4.6

I have changed my spring framework version from 4.1.4.RELEASE to 5.3.6 and spring security version from 3.2.5.RELEASE to 5.4.6. I'm facing problem when using &l

Is Javax.ImageIO supported by graalVM native-image?

I am testing graalVM native image limitations with multiple different java features. I wrote a little program that performs canny edge detection and it loads in

Why we use setAnchorView() with VideoView

I'm trying to understand working with Videos in android studio there's one problem, I didn't get why we use anchor method

How can you merge the same type entities consecutively using JPA PresistanceContext

I am currently creating a small project to mimic simple bank transactions. Currently there are two types of transactions. Request transaction Transaction is can

What to use instead of org.jboss.security.auth.spi.DatabaseServerLoginModule?

We are switching to new Java 17 and new WildFly 26. Using older Java, we had a custom login module class which extended org.jboss.security.auth.spi.DatabaseServ

GraphQL + Springboot + Http Headers

I'm using these graphql dependencies: "com.graphql-java-kickstart:graphql-spring-boot-starter:12.0.0", "com.graphql-java-kickstart:graphql-java-tools:12

How to call API again when there is Network or Timeout Error in Android Volley Request

I am using a custom common class named APIHelper for Volley JsonObjectRequest for my all activities. I am handling all type of errors here. And setting positive

Java getJSONArray when it is set to null

The problem happens when I'm trying to get children of a comment. If the child key is null, my application crashes and gives me this error: org.json.JSONExcept

Boolean value remains false after the value of the static field involved changes

In my assignment I have to use an enum to make an EnumSet of elements that fit the criteria given. So, the code needs to be as flexible as possible and allow an

Gradle cucumber error in command-line - command 'C:\Java\jdk-17\bin\java.exe'' finished with non-zero exit value 1

When I run cucumber test from IntelliJ terminal commandline and get subject error: λ gradlew cucumber

Send MultiValueMap params as http link key-value values

I have this MultiValueMap with params which I would like to send as http link key-value values MultiValueMap<String, String> map = new LinkedMultiValueMap

Read Array at index in jpa Query

I have a native Query that return a list of objects, i need to pass an array as parameter to the function getAllUsers. @Repository public interface UserReposito

Accessibility Service is malfunctioning

I've been using an Accessibility service for a while now on my app. It used to work fine, but there's this message on the phone at the screen where you enable t

How to Remove Red JFormDesigner Evaluation Text?

I installed JFormDesigner for IntelliJ with an evaluation license to convert some forms from NetBeans, and upon realizing that it put a huge ugly watermark on e

When FileUploadBase.SizeException (FileUploadException) is thrown, it seems the request is repeated (using Commons FileUpload)

I have an Ajax POST call that uploads one or more files to a servlet. In my servlet, I use Commons FileUpload library to manage the uploading file process: priv

Mock a complex api call

I have some problemi understanding spring @MockBean in complex api call: serviceCommunication.callAPI(HttpMethod.POST, Servi

Does Liferay support the "run once" functionality?

So, if we want to run something only at Liferay startup, we can use the technique as described in some other answers here, like this. However, this offers, to e