Category "java"

Update elements in a JSONObject

Lets say I gave a JSONObject { "person":{"name":"Sam", "surname":"ngonma"}, "car":{"make":"toyota", "model":"yaris"} } How do I update some of the values

spring boot doesn't shows custom error pages

I added spring-boot-starter-thymeleaf dependency to my project that using spring boot 2.3.1.RELEASE and placed error.html file inside src/main/resources/templat

How to handle "org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error" in Spring?

I'm adding an API to an existing Spring Boot project using @RestController. My Spring Boot experience is: This is my first time using it. The RestController wor

Java 8 Stream - .max() with duplicates

So I have a collection of objects that have a step variable that can be 1 - 4. public class MyClass { private Long step; //other variables, getters, s

Attach the Source in Eclipse of a jar

I added a Student.jar into my Build Path in my eclipse like this- Right click on the project->BuildPath->Configure Build Path->Libraries->Add

Sorting an array of integers in descending order and relating it to its corresponding string array

I am trying to output the names and corresponding scores in descending order. Having an array of strings and another array of integers, I am trying to relate th

Finding the middle element(s) of an array in Java

Given an array of integers, I need to return a new array containing the middle element(s) from the original array. Specifically, the result will have one elemen

org.eclipse.core.runtime.CoreException: Module named '_auto_generated_ear_' failed to deploy

I was following this tutorial. And I followed the steps. But I am getting this error: org.eclipse.core.runtime.CoreException: Module named '_auto_generated_e

Apache POI: Is it possible to use SXSSF without temporary files?

I'd like to use SXSSF (Streaming Usermodel API) from Apache POI. What I don't like is that it uses temporary files. Question: Is it possible in Apache POI to f

Check Selected Product and product which is added to cart are same or not

I have searched for a mobile product which is of type " Asus Zenfone 5 " in flipkart.com website, search display many products. I selected first product and add

Android how to make ok button on dialog not all caps

For an alert dialog in Android, how do you make the positive button not have all capital letters. The text is "OK" instead of "Ok".

deploy ear file to weblogic 10g

I have coded project in java ee. by using java ee version 6. when I try to deploy my ear file into weblogic 10g I receive the following error: How can I achiev

Where are all the javax jars?

Edit: several fellow SOers have recommended just going to Maven repos, which of course have nothing to do with using Maven as part of one's build. I understand

Append the value of argLine param in maven-surefire-plugin

I am using maven-surefire-plugin + Sonar together and I would like to add some extra value to argLine parameter of the maven-surefire-plugin. So I did it: <

Mockito verify unit test - Wanted but not invoked. Actually, there were zero interactions with this mock

At first I want to sorry for my english. I started to make some unit tests (i've never done this before, i'm a new guy in programming). I have to test simple

Read multiple files zip file with multiple sub directories

I have a zip file with the structure like: xml.zip Root Folder: package Folder: Subfolder.zip Inside Subfolder.zip : Root Folder: _ Folder: var Folder: run Fold

Error with Gradle using VS Code: "Could not run build action using Gradle distribution"

I've started getting the following error message when opening an existing Gradle project in VS Code after upgrading the Gradle installation on my computer: Cou

Java velocity vm file #set use boolean variable

We can not use Boolean variable by #set when I find velocity project guidelines in Apache official site, but it is also worked when I use in my project. #set($

RxJava- CombineLatest but only fire for one Observable's emission?

Let's say I have two infinite Observables that can emit values at any moment. They combine to create a Observable<ProcessFileEvent>. Observable<Intege

Unable to update Maven configuration Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5

From inside eclipse when i am doing Maven -> Update Project i am getting following issue Unable to update Maven configuration Could not calculate build