Category "java"

Jetty17 --add-opens option does not work, java.lang.IllegalAccessError

I use Java 17 with Jetty 11.0.9. I started Jetty with the following command java --add-opens=java.base/java.lang=ALL-UNNAMED -jar start.jar Then I am facing ex

Spring Boot MongoDB the field with version annotation does not increment

This question asked several times before, but the answers in these questions didn't work for me. This is my Book document @Document @NoArgsConstructor @ToString

Spring Cloud Stream - Is there a way to customize the StreamThread thread name?

I'm using Spring Cloud Stream (Kafka as the binder) in my current project and the default thread name for StreamThread keeps me bothered as it is very long. Her

Appending to a TextArea from multiple threads on JavaFX [duplicate]

I am currently creating a program that utilizes multithreading. In each thread, it appends to a TextArea. I've come upon an error that I belie

Java 17 with Maven Wrapper results in Unrecognized VM option 'MaxPermSize=512m'

I use OpenJDK 17 with Maven Wrapper 3.8.2 from Spring Initializr (Maven project, JAR packaging, Java 17, Spring Boot 2.6.0). No additional dependencies. user@D

What is the use of Condition along with Lock in Java

I am trying to understand what is the use of doing condition.await() if I am already doing lock.lock() If I understood locks correctly, once I do lock.lock() it

How can an object reference in java hold the reference to a primitive double dimensional int array [duplicate]

I have a piece of code- public class Sudoku { static int[][] game; public static void main(String[] args) { int [][] games= n

How can I do a loop "do/while" to insert some data to Postgres Database?

I did this class to do the inserts but every time I need insert again, I need initialize the method main of this class again. Because it is in just one cycle. p

How do I fix a NotSerializable exception

I have a program called Agent that launches a thread called BeaconSender: public class BeaconSender extends Thread { private Beacon beacon; private

Adding 2 or more Actions on L2switch for OpenDaylight Sodium-SR4

I am working with L2switch (https://github.com/opendaylight/l2switch). In flow writer (https://github.com/opendaylight/l2switch/blob/master/l2switch-main/src/ma

how to ref version catalog in apply block

I want to declare in the apply block of the parent module's build.gradle file to apply the plugin to eligible submodules(use the version catalog at the s

How do I create a Java string from the contents of a file?

I've been using the idiom below for some time now. And it seems to be the most wide-spread, at least on the sites I've visited. Is there a better/different way

How can I get the InteractiveMesh library to work with my JavaFX Mavn project?

Im trying to use this importer http://www.interactivemesh.org/models/jfx3dimporter.html to import an STL file as a triangle mesh, i get no errors in the IDE whe

Why is JAVA version not detected? Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8

I am trying to build app in App Center. Build.gradle buildscript { ext.kotlin_version = "1.5.30" repositories { google() mavenCentral()

Need advice to structure and modify a JSON-payload in Java

Here is a simplified JSON payload that I want to be able to change (the original one is much longer) { "request": { "jsonRequest": { "Alpha": {

Spring Repository query by multi-valued property

Trying to solve a problem where I have a class Student. public class Student { @Id UUID id; String name; Long year; List<Attribute> at

I need to implement a circuit breaker on Spring Data REST (SDR) controllers

Can I create a custom Aspect for it? or should I create custom controllers? But I assume that would make using SDR pointless since I'd have to write everything

Rest API response as XML format, calling from Spring Boot with Resttemplate

I have created Rest API using Spring Boot & Data JPA. It's working fine if requested from Postman responds as JSON format, but when I request from coding us

Spring Batch FlatFileItemWriter - output customization

I would have the need to produce a CSV File with the following requirements: Every field is surrounded by double quotes Double quotes are escaped with backslash

Field annotated with @Transient being persisted in @DataJpaTest

I'm practicing TDD, So now I'm trying to make a test that will fail for now. About to test a @Entity that don't have a field relationship mapped so far. So I'm