Category "java"

How can I clear notification?

I have to hide a notification when a timer is cancelling. I instantiate a notification manager and use myNotificationManager.cancelAll(); but it doesn't work.

How to execute multiple update queries using jooq execute or batch execute without code generation?

I am using JOOQ ( 3.10. 5 ) to update records in ORACLE table without jooq auto code generation in below ways Approach 1- Using DSL execute by using plain SQL S

404 error with swagger-ui and spring webflux

I am developping REST services with Spring Webflux and I want to produce documentation with Swagger2 for my API with. I discovered that Webflux is only supporte

How to configure openjdk for FIPS and simple postgres connection example

I have a simple Java application running in an openjdk Docker container that is executing on a FIPS enabled host system (on a Kubernetes clust

How to upgrade spring framework version in spring boot

I am using spring-boot 2.3.3.RELEASE with the according spring-boot-starter-parent in maven. <parent> <groupId>org.springframework.boot</group

Is it worth to use singleton to load a configuration file?

I have a java web applilication. This application loads its configuration file with singleton according source file below. public class Configuration { private

Download a files from FTP matching a wildcard using Java Apache Commons Net

Basically I need to download list of matching files for the search from a FTP server. I have the code to download a specific file from a FTP server. But I nee

maven fails to find files in main package: ZIP file can't be opened as a file system because an entry has a '.' or '..' element in its name

I have a maven project that I can no longer get to build: mvn clean compile ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1

RestAssured: posting json request having both String and Integer

I just want to POST json request(using restassured), for such json: { "userId": 1, "id": 111, "title":"test msg" "body": "this is test msg" } Im defining

Could not find Spring Profile when uses JUnit Runner in IDEA

I'm trying to run a JUnit Test in IntelliJ IDEA, but the Runner could not find the Spring Profile. this message is displayed in the log: --spring.profiles.acti

I can't think of a condition to increase the decrement in Gradually Decreasing Carousel app

Decrementing Carousel is a container, accepting int elements. DecrementingCarousel has a maximum capacity, specified via the constructor. When created, Decremen

Kotlin: Equivalent of property wrappers from Swift

What is the equivalent property wrappers for Kotlin: @propertyWrapper struct Foo { var wrappedValue: String { get { return "Test

Get JobParameters on RepositoryItemReader

I have a problem with the execution of the batch process that I am developing. It comprises several steps. The first one recovers data and inserts it into a ta

Custom parameter names with a bean for request parameters in Spring 5

I'm trying to use Spring 5 to have a custom bean for my request parameters. In theory this is easy, but I want to have the field names be different from the par

How to read csv using column name in java

I have tried reading a column with its index using below code: int col1; String msg = null; int i = 0; String[] array = null; File file =

Which JRE does C:\ProgramData\Oracle\Java\javapath\java.exe use?

I'm trying to figure out which environment variable java uses to find/detect the JRE used by C:\ProgramData\Oracle\Java\javapath\java.exe. As per Oracle's desi

What happens when we call finish() in onCreate() method?

What happens when we call the finish()method for the activity inside onCreate()? Will the app get time to display the Activity, but then rapidly close, or won't

AtomicReference not working to avoid race condition in java multi threading

I have a "User.java" class that has Integer variable count initially set to 0. In another class "ThreadDemo.java" I have set the User object in AtomicReference.

How to read csv using column name in java

I have tried reading a column with its index using below code: int col1; String msg = null; int i = 0; String[] array = null; File file =

Recursion: Longest Palindrome Substring

This is a very common problem in which we would have to find the longest substring which is also a palindrome substring for the given input string. Now there ar