Category "java"

How to create empty folder/object or new file in new folder (not upload) in Minio using Java Api

I am using Java API (https://docs.min.io/docs/java-client-api-reference.html) to use Minio Client. I want to create a new folder and a new file (empty or sample

Get body as raw string from ServerWebExchange/ServerHttpRequest

I need to get the request body as a raw JSON string in my controller. I'm using Spring WebFlux. If I could change @PostMapper function signature, it will be so

standardized method for writing an arbitrary typesafe Config to a hocon file?

in a Scala research application, i load a hocon file using PureConfig's ConfigSource.file() method, which represents the default configuration for a research ex

Manage unique fields insertion with hibernate

I'm working on a JAVA project and need to insert an entity in my DB using Hibernate but the fields need to be inserted only once. I have this ProjectEntity clas

Restrict a class for creating second object in java

Is there a way where we can restrict a class to create only a single object in java? It should give some exceptions if we try to create another new object. Exam

Why can't I use Gradle DSL in apply'ed files

In our team we have lot of projects built with Gradle. Some parts in the Gradle files are all the same. For example, we use Java 11 in all our projects. So my i

Unable to save the screenshot in Selenium using Robot class

When I try to take screenshot using the Robot Class. I'm getting javax.imageio.IIOException: Can't create an ImageOutputStream! error: Code Snippet: public

JAXB unmarshalling - reader cannot be null

I want to retrieve some data from JMS, filter them and send them to REST server. When I unmarshal those data I get an error: java.lang.IllegalArgumentException

Why do not work @Validated in spring boot 2.6.2

I have in my pom file: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-validati

How to calculate the distance between GeoPoint and Polyline

Suppose i have: GeoPoint p = new GeoPoint(10.08, 11.09); //(lat, long) and a Polyline (a sequence of Geopoints) ArrayList<GeoPoint> waypoints = new Arra

`RUN ./gradlew build -x test` command error

I have been trying to install conductor using docker but I have been constantly getting errors. I tried using [https://github.com/Netflix/conductor/tree/main/do

I am getting an error "Failed to parse the JSON document", I have used JsonPath

//Get place { String getPlaceResponse = given().log().all().queryParam("key", "qaclick123").queryParam("place_id", placeId ) .when().get(

How to call an activity method from a fragment?

I need to call a method that is in an activity from a fragment , i can't even instatiate the activity in the fragment , I don't know how to approach this proble

How to call an activity method from a fragment?

I need to call a method that is in an activity from a fragment , i can't even instatiate the activity in the fragment , I don't know how to approach this proble

How to detect what the content on the display is?

I have an app that rotates other apps. It uses an accessibility service so I have the ability to retrieve screen content. Say I'm rotating a game called Geometr

Eclipse freezes while showing hover suggestions like method suggestions in class, method info etc

When I enter a dot operator after entering the class name, Eclipse will show method suggestions auto complete, at that time Eclipse hangs and gets closed automa

httpclient5 jdk8(1.8.0_292) CloseableHttpAsyncClient Received fatal alert: protocol_version but CloseableHttpClient works well

httpclient5 async code: HttpContext httpContext = new BasicHttpContext(); BasicCookieStore cookie = new BasicCookieStore(); httpContext.setAttribute(HttpClientC

How to stop listening in a Spring Kafka consumer?

I use Spring for Apache Kafka. I'd like to stop listening to my topic and wait to escape OOM. How can I do it?

How to update few fields in JSON file and again read the JSON with updated values in selenium using Java

How to update few fields in JSON file and again read the JSON with updated values in selenium using Java. Below is my JSON : I want to update { "DemoFileJson

How to resolve: antlr.CommonToken cannot be cast to antlr.Token?

I have just finished an update from wildfly 9 to 23 and am now re-working my arquillian implementation to work with the new application server version. Dependen