Category "java"

Mapstruct with JAXB, @XmlElementRefs

I spent really a lot of time on this, but I can not find the answer. From documentation it seams it should work automatically, but for me it does not. I am faci

what happens if thread calls join() on itself

From what i read here Thread join on itself ; When join method is called on itself, it should wait forever I am currently preparing for ocajp 8 certificatio

Whitelist for redirect URLs in spring boot

We have a security issue in our project. An attacker can intercept a login request and modify a 'Host' header in it. The server would respond with a redirect (3

Produce JSON by RESTful web service in Spring Boot?

My problem: I don't returns Json but an array. So, I will wish Json return: My repository interface: public interface SuiRepository extends JpaRepository<

Java not found error when loading Apache Netbeans 9.0 or 10

I downloaded the archive for the program, unzipped it to C drive on Windows, then when I try to run either executable (32bit/64bit) in the bin folder I get the

method validateAge in class UserValidator cannot be applied to given types; validator.validateAge();

I need some explanation about what have I done wrong and how to do it better. Sometimes it's difficult for me to understand everything. public class UserValidat

How to generate JSON Stringer in Android for this format

I need to send data to database in this format - {"param1":"value1", "param2":"value2", "param3": {"username": "admin", "password": "123"}} How to generate

Best way to sort bracketed values in a string both alphabetically and by number?

I have an ArrayList that contains a list of JSONpaths in String format, similar to something like the following: "$['book'][0]['title']" "$['book'][1]['title']"

Best way to sort bracketed values in a string both alphabetically and by number?

I have an ArrayList that contains a list of JSONpaths in String format, similar to something like the following: "$['book'][0]['title']" "$['book'][1]['title']"

Fuel SDK ETClient causing Exception in thread "main" java.lang.NullPointerException

I know this is caused by a null value, however I'm fairly new to java and not sure why it's null. Have I not instantiated ETClient correctly? Or overlooked some

Spring jpa native query sorting adding prefix to order by field name

I have problem with sorting. Repository method: @Query(nativeQuery = true, value = "SELECT D.ID as dealerId , D.NAME as dealerName, K.ID as kpiId, " + "

JAVA - JSON Serialize a list of enum to a class

I have this enum: public enum Days implements Serializable { MONDAY, TUESDAY, WEDNESDAY, ... } I want to use it in a Store class: public cl

Spawn another process on same JVM

From a Java application I want to run another Java application on the same Java installation but in a separate process. AFAIK for a new process I would use Proc

Java EE FirebaseApp name [DEFAULT] already exists

I got a problem related to Firebase and Java EE. I'm currently writing some Java servlets for my project and I'm using Firebase the first time because I wanted

java 13 eclipse: java.lang.module.FindException: Module AbaloneGame not found

When I try and run a class I run into the following error: Error occurred during initialization of boot layer java.lang.module.FindException: Module AbaloneGam

How to append 4 bytes(long) header to the file to read the data based on the header position

I want to append 4 bytes long header to a file .So that whenever I write the nextbytes after reopening the file .I can use this 4 bytes header to identify where

Windowing on mapped stream is giving different results

Use Case : Map the input stream of sometype to another type and sink. Also apply the aggragator on the mapped stream to count the number of events of each event

retrofit 2 @path Vs @query

I am new to retrofit 2 library.I read several articles to get started as a beginner and I managed to fetch XML data from my RESTful API without specifying param

export file to xlsx format in java

I am getting 500k records per request from the Database then mapping the data to a list of POJO classes then writing the records to an excel sheet (I have the r

Eclipse Collection usages on production code

https://www.eclipse.org/collections/ seems to be getting popular now a days. Just wonder, if anybody has used this library in their production code and how is t