Category "java"

How to fix Index 1 out of bounds for length 1 error [duplicate]

I'm trying to build a Binary Search Tree. Below in my main method which reads from a file and inserts into the BST. However, I am getting an i

Integrate Python Library Spleeter on Android Studio

I want to build an android app based on Spleeter. But I am not sure which tool to use to bridge the way between Java and Python on Android or whether it is poss

MySQL error Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException

This is my register page: Registration was working before adding Email checker functionality. This function for check did someone used this email on database.

JavaFX give error after requires in pom file using maven

I'm currently creating project with blocks that can be connected (like blender or UE). And I found github project (VWorkflows) that I connected using its tutori

Dead code in eclipse when trying to find the sum of an array

I tried to find the sum of any array by using the for loop but the i++ part ended up being the deadcode unreachable. I don't understand why? public static int

Does Spring framework @value annotation work with other frameworks?

I am developing a library with a Spring framework and adding as a dependent for different frameworks. Does Spring framework @Value annotation inside library wor

How to call a C function from Java 17 using JEP 412: Foreign Function & Memory API

Does anybody have a simple example on how to call a C function from Java 17 that includes creating a C library and how to setup a MethodHandle? The JEP descript

Unable to use default username password and make jsonResourcePassword.json work with Apereo CAS SSO

Here is what I have done so far: https://github.com/jnbdz/tutorial-baeldung-spring-security-cas-sso In here you can see my configs: https://github.com/jnbdz/tut

Which ExecutorService is best for blocking IO tasks

Let's imagine that we have n independent blocking IO tasks e.g. tasks for rest-call to another server. Then all answer we need to combine. Every task can be pro

Return to the list of a repository in Controller

I'm trying to return a list that is inside a Repository in my controller, but I'm not getting it. Could someone help me? This is a RESTapi for an ATM project th

Java | Mutation Testing | PiTEST | (negated conditional → SURVIVED) | (changed conditional boundary → SURVIVED)

I am getting piTest issues. Few mutations are getting survived. PiTEST negated conditional → SURVIVED changed conditional boundary → SURVIVED As per

Unable to determine element locating strategy for -android uiautomator

I have a method which works perfectly on locally, but when I launch it on server I've got an error: org.openqa.selenium.InvalidArgumentException: Unable to det

Docker WARNING: Published ports are discarded when using host network mode

I have a Springboot app that I have Dockerized. I have it exposed on port 8081, and can access it as expected. http://<ipaddress>:8081 Problem The Spring

Value con of type java.lang.String cannot be converted to JSONObject

I just got an error at runtime. I understand the problem, but I could not fix it. This is my first time working with Volley and a MySQL database. I want to save

CWE 73 External Control of file name or Path

I am working to fix Veracode vulnerability CWE-73 (https://cwe.mitre.org/data/definitions/73.html) for my application in which the input filename is dynamically

java 11 rmi NoClassDefFoundError

I updated my application to use Java 11 and I am getting the below error when trying to rebind an object over RMI. The application works fine on Java 8. They sa

vowpal wabbit java: get raw predictions

I am using Java API of vowpal wabbit to get predictions. I need raw prediction (same as -r output.txt) but I couldn't find any such method in VWMulticlassLearne

How to read from YAML file in java?

I have YAML file like this.. Product: ProductA: Suite: SuiteName_A: Environment_1: ["A","B","C"] Environment_2: ["X","Y","Z"] SuiteName_B

Group list of objects into smallest possible number of sublists without exceeding maximum sum

I'm trying to write a method that groups objects into the minimum amount of sublists without mixing types (int field on object) or the sum of their values excee

no ad config with error code 3 in test ads

I have integrated AdMob into my android app and I am using test id to show ads. but whenever I run the app it always goes to onAdFailedToLoad method and I am ge