Category "java"

JOOQ - equivalent of hibernate interceptor for populating history fields?

Environment: Spring application, using JOOQ 3.7, generating the JOOQ mapping code automatically from the schema, using Postgres as my database. I've been porti

how to read json array from servlet to jsp

JSONObject,jsonarray cannot be resolved to a type servlet: while(rs.next()) { JsonObject jo=new JsonObject(); jo.put("id",rs.getString(1));

How do I run a gui Java application headless, without control of the source code?

I want to execute a Jar file using javax swing GUI with 1 radial option, a file selector and a button. The goal is to be able to automate the jar through CLI an

Google Map is not showing in Android Studio (Only Google Icon is Visible)

I want to import Google Map SDK in my project. According to Docs I follow all the steps perfectly but when i run the project it only show an icon of google inst

Run Java Selenium tests in Azure DevOps release pipeline

I'm doing a POC for a Java project in an AzureDevops CI/CD pipeline. I created a Maven project that has Selenium tests (TestNG) that run against a demo website

Switch JDK version in Windows 10 cmd

Is there a way to change JDK version easily in cmd? like the version on mac. Change Default JDK on Mac.

How to send jsonfile in api Request

I am facing an issue while sending the json file in request for RestController, Please check the details below I have a json file , let say test.json { "Pol

TLS 1.2 + Java 1.6 + BouncyCastle

For supporting HTTPS connections through a Java 1.6 API to remote hosts using TLS 1.2, we have developed a customized TLS SocketConnection factory based on Boun

Iterate Twice in Map reduce

I have written a Reducer job in which my key and value is composite . I have a requirement of iterating twice through the values and hence trying to cache the v

MapStruct - Map Generic List to Non-Generic List containing different types

I am attempting to use MapStruct to convert between 2 internal models. These models are generated from the same specification and represent a large tree-like st

Execution Failed for task :app:compileDebugJavaWithJavac in Android Studio

I am developing an Android App in Android Studio. Not quite sure what went wrong. I was successfully building a few days ago. Any help would b

Java stream. Sum two fields in a stream of objects

I have something like this: Integer totalIncome = carDealer.getBrands().stream().mapToInt(brand -> brand.getManufacturer().getIncome()).sum(); Integer total

Missing artifact com.fasterxml.jackson.core:jackson-core:jar:1.9.11

I build a maven project and get an error on pom.xml Missing artifact in some dependencies. How can I resolve it?

Can't send mail using apache commons mail when smtp appender for log4j is configured

I have a working code that creates and sends an org.​apache.​commons.​mail.HtmlEmail (version 1.5), but that same code doesn't word when I hav

Copying Character array into char array

Hi I want to fast copy array of Characters to array of chars I can write a method that copies Character array into char array, by converting every Charater in a

How to fix 404 error, The origin server did not find a current representation for the target resource or is not willing to disclose that one exists

When I am trying to execute @RequestMapping("/showForm") I am facing an error. I think my code seems fine, I am simply returning new String with the name of my

Using docx4j to convert .docx to .pdf

I'm trying to convert .docx files to .pdf files. Now I have the following code: class DocxToPdf { fun convert(inputFileLocation: FileInputStream, outputFile

How to read data from nested zip files in Java without using temporary files?

I am trying to to extract files out of a nested zip archive and process them in memory. What this question is not about: How to read a zip file in Java: NO, t

Unable to load class exception during Kryo deserialization

I am using Kryo for serialization / deserialization and not registering classes beforehand (I am working on that). That said, upon deserialization, I am gettin

Elasticsearch find all indexes using the Java client

Is there a way to use the Java client to get a list of indexes that are in Elasticsearch? I have been able to find examples of doing this using Marvel/Sense, bu