Category "java"

Spring Security Rejects Fetch OPTIONS Preflight Outright If content-type = 'application/json'

If a Fetch POST to a Spring Security (v 5.6.1) enabled service endpoint sends this header: headers.append("Content-Type", "application/json"); the OPTIONS pref

How to log a message if a stream is empty within the Stream?

Given the following Java 8 Stream: scheduleService.list().stream() .filter(Schedule::getEnabled) .filter(this::runn

How to Get Image Path in my App which is Selected from Whats app's Chat?

i have demo application with image view and in this image view i need to set image from which selected from whats app Chat, Currently i was getting Path of sele

Create Command-line Launcher Intellij not found

I would like to use idea pom.xml from command line to launch a simple Maven project, and so I think I need to configure using "Create Command-line Launcher"

has been blocked by CORS policy: Response to preflight request doesn't pass

I have created one app using angular and springboot for basic authentication with spring security but i am getting 401 error ..i am novice in springboot @Confi

Named parameter not bound : DATE_FORMAT Native Query in Spring Boot

I am trying to get table data as list using select query between dateFrom and current date using MySQL Native Query in Spring Boot. and MySQL database field dat

Apache Camel: using compound conditions in when()

I am using Apache Camel DSL route and want to check if the body is not null and body does not contains substring like authenticate failed. In java something lik

(Mac OS) JAVA version does not change

I have 2 JAVA version on my Macbook. I want to change version from 14 to 11. I found 2 solutions on the internet but both are not working. My java -version resu

Single unexpected null value in a request while testing a rest controller with soapUI

I have a Controller which receives a request object via SoapUI (screen below). What confuses me it is that only one of the 2 attributes of this request object i

Building a SSLSocketFactory to enable HTTPs for custom Feign Client configuration

I'm trying to add HTTPs to my spring boot services, one of them is a Feign Client that is throwing this error: xception in thread "Thread-7" feign.FeignExceptio

No suitable driver found for jdbc by Java 9.0.4 and Derby 10.14.2.0 and Maven

I'm trying to solve the problem with connection to Derby since a few days. I have always the same Exception: java.sql.SQLException: No suitable driver found

Room database reset to default values which was set by prepopulating database when clearing app from background

I have a database which is prepopulated with some tables which is working fine. I have prepopulated my db. like this Room.databaseBuilder( get(),

ESC / POS - How to print images with secondary font?

I am using this sample for printing images (with the correct 8 bits shift): Print bitmap full page width in thermal dot printer using ESC/POS in java When I s

How to get org.apache.kafka.connect.data.Decimal value from Kafka JSON message [duplicate]

I use debizium to stream postgresql data to Kafka, and use Java to subscribe Kafka topic. I receive Kafka message and get a JSON string, but

Logging in AWS Lambda with slf4j

I am using a lambda function and writing it in Java. I was looking up logging for Lambda functions when I read the docs and they support log4j - http://docs.aws

Choco-Solver: Is there a way to know how many times a constraint is broken during the solving process?

My models is inefficient and taking too long to find valid solutions so I think knowing how many times the constraints are being broken would be useful for test

Apache poi get table from text box

I'm using apache poi for iteration table in docx file. All works fine but if table in text box, my code don't see table - table.size() = 0 XWPFDocument doc =

How to fix incorrect position I get when dispatching an update to ListUpdateCallback using DiffUtil

I have an Android application where the user can modify multiple String items using EditText at the same time, so I need to figure out what have changed in orde

What is ' :: ' double colon in Java? When should I use it? [duplicate]

I'm just a beginner in Java. When should I use double colon? import java.util.stream.*; class GFG { public static void main(String[] arg

Converting RecyclerView to ViewPager / PagerAdapter

Background - New to Android, but pretty nifty with moving layouts around, understanding Java, Kotlin and XML. However this task seems to be way above my head.