Category "java"

Get Count of json key using Java Stream

I have a json object that looks like this [{ "startAt": 1617605301292, "endAt": 1617605317095, "duration": 1580

wsdl artficats generation using gradle task

I am trying to generate wsdl artifacts using gradle. wsdl java generation fails and i don't see appropriate message either in the debug log or normal build log

how to fix java.lang.UnsatisfiedLinkError: sun.tools.attach.BsdVirtualMachine.createAttachFile(Ljava/lang/String;)

everyone. I was trying to execute " mvn clean test " to verify a simple maven project which was generated by "mvn archetype:generate".I just to want learning ho

Unsupported class file major version 61

I am trying to integrate Glowroot into my Java application. Unfortunately, I get the following error: 2022-05-13 09:25:57.777 ERROR o.g.a.w.PointcutClassFileTra

Logic of for loop using with array to access elements of the array in java

My code to access elements of array using for loop. The output of the program is [19,17,15] which are the elements of array int a[] = { 12, 15, 16, 17, 19, 23 }

Tomcat 9 Server not starting in Eclipse 4

After adding Tomcat Server 9.0 to Eclipse 4.23 on Windows 11 the server will not start. The following warning is written to the console: 'WARNING: Problem with

Generate CSV from entity based on columns reordering

How to achieve this concept based on generating CSV in case of: Ignoring field that am not interested in (Could be obtain in OpenCSV based on MappingStrategy) O

Seems RegEx's 'OR' operator does not work

I have a pattern of regex that should match input that way: Work -> correct {"name": "name"} -> correct (any correct json format object) War And Piece -&g

jdbi version 3, stringtemplate when to escape <, > characters?

I am using jdbi3 with StringTemplate 4 templating engine, I have this test query: @SqlQuery("select * from test " + "where field1 = 5" + "&

How can I handle a search by a dynamic set of variables in JDBC?

I'm making a dynamic query to pass to mysql based on which variables I'm passing are not null. I can build the query without a problem, but I can't understand h

Is there way to reverse the last half of the elements from the bottom of the stack (using recursion)?

The code which helps reverse the entire stack is however not able to get it to reverse half the elements - static void reverseSecondHalf(Stack<Integer> st

Mybatis foreach mapper item exception

I am using foreach for SELECT IN clause. Item has not been found by mapper. Here is part of exception. org.mybatis.spring.MyBatisSystemException: nested excepti

Update war name based on activated maven profile

In my pom, I have two profiles. test1 test2 Now I want my war name to change based on the activated profile. Expected Result When test1 profile is activate

Understanding Mono.when

I'm new to Spring WebFlux and do not fully understand the Mono.when(). The following code does not work as expected: List<Mono<Void>> results= ....;

Reversing strings in Java (loops) until "done"

this is a lab for class I'm trying to do. Here's the instructions: Write a program that takes in a line of text as input, and outputs that line of text in rever

How to put ImageView on top of CardView in ConstraintLayout

I want to create a layout like this, but I don't know how to place the CardView background under the ImageView and then set TextView below the image. The image

Split data in JSON file based on a key value using java

I have a json file with which has an array of product items i want to split them based on the category of the item, This is my json file looks like, { "item

RESTful web service: How can I take this data without printing out the other

I want to just take the data from menSize and its price but it keep printing out the womenSize eventhought it doesn't add anything in it. Do I need to seperate

Log4j 2: How to enable ANSI colours on Windows console?

I try to use Windows 10 command line to print colored messages on console, but with no success. According to the Log4j 2 documentation, I should add the Jansi j

Java: Find .bat files in all folders of a drive (C:\ and others) [duplicate]

Is there a Java code that will look in every folder of a given drive and search for .bat files? And return them has a ArrayList of Files? I'm