Category "java"

Spring boot native configuration

I am trying to migrate existing spring boot application to spring native. In this case, I have application.properties and application-dev.properties. package co

How to create Session Factory when sending async messages via ActiveMQ Artemis in Spring Boot?

I'm trying to send simple message to a topic from sender Spring Boot app to a receiver Spring Boot app. But I keep getting two exceptions. First exception occur

Executor pauses and doesn't process pending queues

I have a long-running task of creating a bitmap saving it and recreating more bitmaps which I was doing on a single background thread ExecutorService executor =

Parallel test execution and growing active connections to mongodb

I have an application with thousands of tests through MockMvc. The tests are running in band, so 1 at a time and whole process takes hours. I decided to try par

Error message when opening IntelliJ, from command line in Linux

I changed my IntelliJs base JDK, to try and fix an error, and now it will not even let me open up Intellij. I tried to re-install, but that did not work. Intell

Cannot use search view to filter list view displaying data pulled from SQL server

I am very new to app development and i'm trying to create an app connect to an sql server. The app pulls data from the server and displays it in a list view. I

To print the number of steps this RandomQuickSort Takes. Java code

I have this Java algorithm and I am having trouble printing the number of steps it takes to solve the sorting. Here is the code /* The main function that im

How to parse XML files without knowledge of filename

I have a directory in which I receive orders as XML file. I want to parse this file and then do some things with it. I can set a scheduled job to check this dir

Can't see implementation of protected abstract functions in Android package

I have been going over the android package a bit. I am using sdk 30 and for example in SensorManager.java there is a function protected abstract List<Sensor&

Hibernate validation: Skip Constraint violation in specific situations(api calls)

I have an object User and as part of validation I have provided something like below: import javax.validation.constraints.NotBlank; public class User { pr

How to update multiple types appwidgets from the fragment of ConfigActivity by pressing one button?

I've made 2 different types of appwidgets showing some calendar data. Each type has it's own layout, AppWidgetProvider class, AppWidgetProviderInfo object, but

Moving dependencies from pom to properties file

is there any way to moving dependencies from pom.xml to application.properties file? <dependency> <groupId>org.postgresql</groupId>

How to capture an authorized payment using PayPal Checkout-Java-SDK?

Docs provides HTTP requests as example to "Capture an authorized payment": https://developer.paypal.com/docs/archive/payments/authorize-and-capture-payments/ Ch

"Expected BEGIN_OBJECT but was STRING at line 1 column 1"

I have this method: public static Object parseStringToObject(String json) { String Object = json; Gson gson = new Gson(); Object objects = gson.fro

My reverse a string code includes a space at the end of the string

I am a beginner of Java, and would like to reverse the character order of a sentence when I input some words as command line arguments. Here is my code. When I

Getting an error while sending the "sendkeys" in appium server

In appium server , am trying to send the keys inside the text box , where am facing this trouble Call to 'sendKeys' failed [element.sendKeys("hello")] Error res

Java regex repetition not allowed inside lookbehind

I am looking for a way to split a string after every 3rd comma. I have found an old answer from 2013 Split a String at every 3rd comma in Java which I think is

I'm trying to make a function that takes a 2d array as a parameter and outputs a normal array containing every unique number, in java

The function needs to have a 2d array as a parameter and then return a normal array with all the unique numbers. If the 2d array is [ [1,1], [4,2] ] then it sh

How do I compare strings in Java?

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals()

Trying to create dynamic ES Index facing java.lang.ClassNotFoundException: org.springframework.data.spel.ExpressionDependencies

Using <spring-boot.version>2.3.9.RELEASE</spring-boot.version> added following dependencies : <dependency> <groupId>org.springframew