All Questions
1,918,277 questions
0
votes
0
answers
32
views
Java Swing Invisible Image
Context:
I'm trying to make an app with java swing, however when trying to add a background to the Login Page, the image does not show up. It is there and moves other JComponents when adding a layout ...
0
votes
1
answer
35
views
Android Java Surfaceview, declaring and hiding
I have a main activity with a button. When I press the button a hidden Surfaceview get visible and an animation shows. It's working really well. I have two problems. What is the proper way to declare ...
Advice
0
votes
2
replies
30
views
Lower Bounded Wildcards: is it about superType or subType
Oracle documentation mentioned it clearly.
a lower bounded wildcard restricts the unknown type to be a specific type or a super type of that type.
To write the method that works on lists of Integer ...
0
votes
0
answers
10
views
Even when connecting Web3j via WebSocket, I can’t receive blocks instantly
I made sure the RPC URL definitely starts with wss, but Web3j still keeps fetching blocks at specific intervals instead of receiving them in real time.
Do I need to call a different method?
My Web3j ...
0
votes
0
answers
17
views
Firestore only updates when the activity using it is accessed through a specific Android activity [duplicate]
I'm working on an Android app where users can add and remove restaurants from their favourites via the RestaurantPage activity. When I access the RestaurantPage activity from the UserFavourites ...
0
votes
0
answers
28
views
Why does RestTemplate, starting from Java 21, run on a different thread even without virtual threads and without @Async, and why does MDC get lost?
i recently migrated from java17 to 21. I use logback MDC to log http request and response. each http request may lead to execute several resttemplate sync call. i use mdc to generate UUID as traceId ...
0
votes
0
answers
55
views
How to List pdf filenames [duplicate]
I cannot get a list of files ending with .pdf, I have tried everything, it lists everything else in the folder, except for the pdf's, what is wrong with this. The program then displays the list in a
...
1
vote
0
answers
34
views
Spring WebClient takes too long to process the first request — subsequent calls fast
I'm using Spring WebClient in my Java application to authenticate with Keycloak.
The issue I'm facing is:
The first WebClient request takes a long time (5-9 seconds), but all subsequent requests are ...
-1
votes
0
answers
56
views
Hibernate 7 and H2 2.4.240 compatible issues
When upgrading H2 to the latest 2.4.240, the H2 specific tests failed with the following errors:
insert into posts (content,created_at,slug,status,title,version,id) values (?,?,?,?,?,?,?) [23514-240]
...
-1
votes
0
answers
31
views
I'm unable to implement auto focus in Iframe [closed]
I'm designing custom automation report(Playwright with Java using Junit). Encountering issue where I'm unable to implement "auto focus" when I click on the scenario in the table. Focus ...
0
votes
0
answers
44
views
JRecord - Build issues while trying to install package through Maven POM
I am trying out way to install JRecord and CB2XML in my spring boot application. I tried to use the package through POM xml by mentioning the dependencies.
<dependency>
<...
0
votes
0
answers
49
views
Translate escaped string from XML file
Let's assume I have the string "F%c3%bcr%20alle" in a xml file. It should translate to "Für alle". I can do the unescaping with JavaScript:
let decoded = decodeURIComponent("F%...
0
votes
0
answers
63
views
Mapping an entity with an embedded key
There is a class with an EmbeddedId.
@Entity
@Getter
@Setter
@Table(name = "indicator_values")
public class IndicatorValue {
@EmbeddedId
public IndicatorValueId id;
@Column(...
2
votes
0
answers
67
views
Can JavaFX WebView show webp images?
I use JavaFX 26-ea+6 on Ubuntu 20.04 and it seems that WebView can't show webp images. This is my code:
public class TestFx extends Application {
@Override
public void start(Stage ...
0
votes
1
answer
38
views
Twilio Signature validation for ConversationRelay WebSocket with Java SDK
In https://github.com/enola-dev/enola/pull/1927 I attempted to add signature validation for WebSocket authentication security to my https://github.com/enola-dev/twilio-conversation-relay-java Java ...
Best practices
0
votes
4
replies
82
views
Looking for workaround for library with missing interface
I have a Java library (FIHR) where there are conventions in a bean class hierarchy that were NOT formalized as an interface.
For example many subclasses have a getStatus() property but there is no ...
2
votes
1
answer
57
views
ForkJoinPool and RecursiveTask lead to deadlock when join is called in a different thread than fork
The program below never ends:
void main() {
try (Fibonacci fibonacci = new Fibonacci()) {
IO.println(fibonacci.calculate(9));
}
}
public static class Fibonacci implements ...
1
vote
1
answer
46
views
Is there a way to automate user input with JLine's LineReader?
When handling user input through Scanner(System.in), you can use System.setIn() to automate user input.
Like this:
package edu.ntnu.idi.idat;
import java.io.ByteArrayInputStream;
import java.io....
0
votes
2
answers
108
views
How to efficiently flush and write large amounts of data to a file using BufferedWriter in Java? [closed]
I'm working on a Java project where I need to write a large number of lines to a file. I know BufferedWriter can improve performance compared to writing character by character, but I am unsure about ...
-4
votes
0
answers
70
views
Getting incorrect output in my Java solution for HackerRank “A Very Big Sum” [closed]
I am trying to solve the "A Very Big Sum" problem on HackerRank using Java. The task is to sum large integers (long values), but my output does not match the expected answer.
Here is my ...
2
votes
1
answer
125
views
Is it possible to load a function symbol from an executable
I have 2 files:
foo.c:
#include <stdio.h>
int Main(int a) {
printf("A%dB",a);
}
int main() {
return Main(1);
}
bar.c:
extern int Main(int);
int main() {
return Main(2);
}
...
-3
votes
0
answers
39
views
mesibo Compilation Error: Unresolved reference 'MessageParams' in Mesibo Android SDK 2.7.19 (Kotlin)
I am integrating the Mesibo Android SDK (version 2.7.19) into my Kotlin application. I need to implement the Mesibo.MessageListener interface to receive real-time messages, but I am facing a ...
0
votes
0
answers
86
views
Full screen intent on Lock screen stopped working when Samsung Android upgraded to 14/145/16
My VoIP Android app shows a full-screen incoming call UI using Android’s full-screen intent (FSI).
On Samsung Android 16, the FSI works perfectly when installing the debug build — but fails completely ...
1
vote
0
answers
74
views
AudioSystem,isAudioLineSupported returns false [closed]
I am trying to use some Java audio code that worked back in 2019. I am now using the Eclipse IDE with JavaSE-21 running on Windows 11. The following code is not working:
AudioFormat af = ...
-1
votes
1
answer
86
views
Java OOP association SQL equivalent
I have two classes: Student and Group.
Student attributes:
private String registrationNumber;
private String firstName;
private String lastName;
private Date dateOfBirth;
private String password;
...
0
votes
0
answers
54
views
Java project dependency jar - only part of new code being recognized [closed]
I have a Java service that relies on a dependency jar that I have modified. Within the dependency I have updated 2 different sections of code for unrelated functionality. I have updated the version of ...
1
vote
3
answers
158
views
Can't open more than 8000 TCP connections with Java
I am trying to open to open 10K+ connections to a server, but my app stops at 8K connections when looking at the server logs. When using two remote servers, it will struggles when reaching between 8K ...
1
vote
0
answers
102
views
getResource returns null for a resource that does exist
I have resurrected a program written in Java using Eclipse: I last worked on it in 2016. I am now using JaveSE-21, and this code no longer works- the returned URL is null.
String name = "res/...
-4
votes
0
answers
42
views
What is setAllowUniversalAccessFromFileURLs(true) [closed]
What are vulnerabilitites can occur by this and prevention tech in code level ?
0
votes
1
answer
68
views
`Filters.eq(fieldName, value)` not actually creating `$eq` causes issues
I'm not sure if this is a MongoDB issue, an issue with the mongo-java-driver or if I'm doing something worng.
The issue is that MongoDB can behave differently in case there is a $eq operator or if a {...
1
vote
0
answers
67
views
How to add 64-bit OS check for Java 17 JavaFX app when packaging with launch4j-maven-plugin?
I'm working on a JavaFX application that requires Java 17+, which only supports 64-bit operating systems. I'm using the launch4j-maven-plugin to create an EXE file, and I need to ensure that when ...
0
votes
1
answer
84
views
Why can I not seem to get gradle to work? [closed]
I am trying to make an app for android, just a small little "Hello World" app to assess how it all works. I have tried on numerous occasions to get gradle to wrap the app but I just keep ...
0
votes
1
answer
64
views
Exclude map name when parsing GSon to JSON
I have something like this:
String data = new Gson().toJson(myCoolObject);
myCoolObject has a HashMap. The resulting string ends up containing not just the keys and values of the map, but also the ...
1
vote
3
answers
117
views
Using Pagination & Sorting in Spring Boot 4 with CrudRepository & PagingAndSortingRepository on JDBC
I am doing the learning on Broadcom's Spring Academy to be up to date with the latest best practices. I bumped Spring Boot to 4.0.0 instead of the 3.0.0 on Spring Academy. But I am having some issues ...
-6
votes
1
answer
91
views
Formatting the first symbol of a string to be upper case - a private method or formatting on the go?
In a class that has a bunch of functions, should I be making a separate private method specifically for formatting or should I just be formatting in every function that requires a string to be ...
0
votes
1
answer
48
views
HTTP-403 when authentication in spring authentication server after /login in spring cloud gateway
I trying to setup cooperation of gateway and authorization server.
help me to find error in the program, when i authenticate me and enter to web authentication form username=admin and password=1 i ...
2
votes
0
answers
76
views
m2e Workspace Resolution Broken After Upgrading from Eclipse 2021 to 2025
I’m upgrading an old Eclipse setup and ran into a strange issue with m2e workspace resolution.
I moved from Eclipse 2021 to Eclipse 2025.
I created a completely clean Eclipse installation and ...
0
votes
1
answer
65
views
How to copy a fully qualified method reference in VS Code (like IntelliJ’s "Copy Reference")?
I’m coming from IntelliJ and I’m used to the “Copy Reference” feature, which lets me copy a fully qualified reference to a method, such as:
com.mycompany.project.service.UserService.getUserById
I’m ...
1
vote
0
answers
54
views
Need help understanding why this Locksupport.park hangs indefinitely
I have the below code (whole code is here) that polls a queue for runnables and parks itself if the queue is empty.
public void waitAndDrain() throws InterruptedException {
throwIfInterrupted();
...
0
votes
0
answers
35
views
Losing MDC in Quarkus ManagedExecutor
I'm starting an async-process through a REST request. As soon as the REST requests returns, I'm losing the MDC context inside my async execution code. I tried to "copy" it over with ...
0
votes
0
answers
56
views
Error: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException:
I'm using an old version of Android Studio, 3.1.6.
This error appears when the gradle project sync failed. I also have a new version of android studio installed, I dont know if this could be related, ...
0
votes
1
answer
82
views
"command is either misspelled or could not be found" with Win 11 but not Win 10
A year ago I created an Eclipse project (Eclipse 2020-06, Java 8, Win 10) that uses the GIS LAStools libary to e.g. extract data from a couple of files.
I'm now using Win 11 on a different PC and want ...
3
votes
0
answers
118
views
Memory leak in JNI with AttachCurrentThread() and DetachCurrentThread()
I have a Java application that calls a native function. That native function contains a loop, and in each iteration it launches 10 threads and waits for them to complete. Each thread performs a number ...
0
votes
1
answer
101
views
How does the JVM instruction getfield work?
Thread A performs getfield Stop.flag and the value is false. At a certain point, another thread modifies Stop.flag to true, but Thread A keeps getting false when reading Stop.flag.
I don’t understand. ...
0
votes
1
answer
90
views
Intercepting user toggle button clicks
Can you intercept JToggleButton clicks, making the selected property change conditional? If you add ItemListener or ActionListener, you can't veto the change, it's already happened. Switching the ...
0
votes
1
answer
113
views
Spring Boot: 400 Bad Request when sending JSON to POST endpoint (request body always null)
I’m building a Spring Boot REST API and I’m stuck on an issue that I can’t figure out.
I have a simple POST endpoint that should receive a JSON payload and map it to a DTO, but every time I call the ...
1
vote
1
answer
129
views
How to fail at startup in Spring Boot 4 if the base-url property is not set?
With Spring Boot 3, I created a @ConfigurationProperties record with @NotBlank validation to manually set the base URL on the RestClient that is passed to the HttpServiceProxyFactory For example:
@...
0
votes
0
answers
32
views
Errors while starting Wildfly 35.0.1 server which is configured for jasper reports 9.0.0
I have deployed jasperserver-pro.war in Wildfly deployments folder and trying to start the server. But I am getting lot of WARNING server logs and I am not able to start the server.These are the ...
0
votes
0
answers
42
views
Hugging Face /hf-inference/v1/chat/completions returns 422 in Eclipse plugin [closed]
I'm building an Eclipse plugin for code completion using the Hugging Face API. My plugin sends a prompt to the endpoint:
https://router.huggingface.co/hf-inference/v1/chat/completions
I replaced the ...
0
votes
0
answers
41
views
Spring Boot CORS preflight request returns 403 "Invalid CORS request" for POST /login
I’m trying to connect my React frontend (hosted on Azure Static Web Apps) to my Spring Boot backend (hosted on Azure App Service), but the CORS preflight request is failing with HTTP 403.
When I run ...