1,918,271 questions
0
votes
2
answers
98
views
H2 Database connects in IDE, but not from console or as a JAR file [duplicate]
I'm trying to make a Maven project that connects to an H2 database. In an IDE this works fine, but when executing the compiled project in the terminal, or when building the project into a JAR file and ...
0
votes
0
answers
52
views
java.lang.ClassNotFoundException: class org.apache.activemq.jndi.ActiveMQInitialContextFactory not found at run time
WSO2 EI 6.6.0 is configured and run together with ActiveMq 5.16.4. Sending and receiving JMS messages works fine but time to time following error occurs at run time. To solve it, it is necessary to ...
-1
votes
0
answers
25
views
How to debug on stage environment on AEM Cloud for custom service Interface and implementation class [closed]
We have a popup functionality that works fine on AEM as a Cloud in Dev and Local environments, but it’s not working in Stage and Prod.
Here’s the setup:
We are using Sling Model Exporter and an AEM ...
0
votes
1
answer
92
views
Error when running a Spring Boot image in Docker: open /workspace/BOOT-INF/classes/db: permission denied
I follow the book Cloud Native Spring in Action and I encountered this error. I used the Paketo Buildpacks to build the image using ./gradlew bootBuildImage. Full source code: https://github.com/...
Advice
2
votes
3
replies
101
views
Is Thymeleaf still maintained, and is there a Thymeleaf version compatible with Spring Boot 4 / Spring Framework 7?
Spring Boot 4.0 and Spring Framework 7.0 were recently released, and I’m considering upgrading my project.
However, my application uses Thymeleaf, specifically the thymeleaf-spring6 integration module,...
Best practices
0
votes
2
replies
44
views
Group and process unordered records in a CSV file with Spring Batch
A CSV file needs to be processed using Spring Batch where multiple rows could be grouped based on a field value. In the below sample, two lines in the CSV have the same GROUP_NAME with the value ...
0
votes
1
answer
64
views
IntelliJ IDEA doesn't see type from .m2 jar
A Maven dependency is loaded, expected types are present in the jar in .m2, yet IntelliJ paints the import in red.
I tried deleting the dependency directory and loading it again, it didn't help.
<?...
0
votes
0
answers
71
views
Axon Framework with Spring: Run queries in read only spring transaction
To be able to send SQL queries for Axon queries to a database reader instance and SQL queries for Axon commands to a database writer instance I need to run Axon query handlers within a read only ...
0
votes
0
answers
62
views
Constructor-based dependency injection fails when requesting bean via beanFactory.getBean(Command.class, dto) in Spring Boot
I'm migrating from field injection (@Autowired) to constructor-based injection in a Spring Boot application (Java 21), but I'm running into a BeanCreationException when Spring tries to instantiate my ...
0
votes
2
answers
100
views
java.lang.ClassNotFoundException: okio.Buffer when using OkHttp inside Eclipse plugin (OSGi)
I am developing an Eclipse plugin (OSGi environment) and trying to use OkHttp 4.11.0 to send HTTP requests. However, I get the following runtime error:
java.lang.ClassNotFoundException: okio.Buffer ...
Best practices
0
votes
1
replies
37
views
Custom annotation for performing customized injection logic
Spring 5.3
Use case:
I’ve got an annotation
public @interface MyInject {
String region();
String type();
}
I want to use this annotation in a similar fashion to
@Resource(“beanName”)
but ...
1
vote
0
answers
87
views
Spring Boot @RestControllerAdvice works locally but not on Render deployment
I have a Spring Boot 3 application with a global exception handler that works perfectly when I run it locally, but when I deploy the same code to Render, the exception handling stops working — I only ...
1
vote
1
answer
29
views
Struggling to implement different viewports in an application adapter from LibGDX
I've been working on creating a game using libGDX for a few months now, and so far I've successfully implemented the main gameplay loop inside a stage which uses fitviewport, which functions as ...
1
vote
1
answer
54
views
Drools cannot load DRL files from multiple folders inside Spring Boot executable JAR (LaunchedURLClassLoader issue)
I am using Drools 10.1.0 (drools-xml-support) with Spring Boot, and I have a kmodule.xml with two KBases, each pointing to a different folder.
In IntelliJ/IDE everything works perfectly.
But when I ...
0
votes
1
answer
67
views
Incompatible equality constraint: Map<String, Object> and GetResponse
I have this OpenSearch code:
import org.opensearch.client.opensearch.OpenSearchClient;
import org.opensearch.client.opensearch.core.GetResponse;
private OpenSearchClient client;
private Optional<...
0
votes
0
answers
70
views
Suppress parameter from module class method
I've got the following swig file:
%module test
%ignore Stats;
%typemap(jstype) Stats* ""
%typemap(javain) Stats* "0"
void initialize(Stats* s);
I would like to suppress ...
0
votes
0
answers
65
views
Flyway migration unable to create relation (table) when attempting to add table to Java API [closed]
I am working on a Java Spring API where I need to create new relations (tables) that will be stored in a PostgreSQL database.
I am creating new tables that add a new column to the existing tables with ...
-2
votes
0
answers
74
views
Android API NFC Antenna location incorrect [closed]
For my app it is crucial to display the user with the correct location of the NFC antenna as it interacts with an embedded device and data gets exchanged for a prolonged time, so stable connection is ...
-1
votes
0
answers
41
views
java.lang.IllegalStateException: getAttribute: Session already invalidated when calling API locally [duplicate]
I am getting the following exception when I hit my API on my local server:
java.lang.IllegalStateException: getAttribute: Session already invalidated
[INFO ] 2025-11-24 17:32:55.729 [http-nio-8080-...
0
votes
1
answer
30
views
ApplicationModuleTest - BeanInstantiationException: No repository found for type
I run a Spring Modulith ApplicationModuleTest in an application that has a Spring Data Rest module with CRUD logic, alongside other Spring Data JDBC modules with "real" domain logic.
The ...
Tooling
0
votes
2
replies
63
views
Java Code | How to configure and scan file from clamAV server
The ClamAVScanner class is a Spring service that provides functionality to scan files for viruses using a ClamAV server.
It connects to a ClamAV server (configurable host/port, with optional SSL) and ...
2
votes
1
answer
132
views
Cannot find MockBean in Spring Boot 4.0.0
Spring Boot has released new version 4.0.0. They have provided migration guide. I am not able to find to where 'MockBean' annotation is moved. Currently I am importing starter-test, starter-kafka-test ...
1
vote
0
answers
36
views
Drools rule fails for genuine use case at high scale
I have written the rule below to evaluate a very easy use case.
rule "WIN_DRL"
when
$featureMap: Map()
$reward: Reward()
$rewardSummery : RewardSummery(
...
Advice
0
votes
5
replies
145
views
Lightweight Spring Boot Setup for Beginners: Zed editor
I am new to Java and starting with Spring Boot development. I prefer using lightweight code editors like Zed, Lite-XL and Helix and want to avoid the high resource usage and complexity of full IDEs (...
-4
votes
0
answers
44
views
Returning audio or video from Spring Boot Restful Api [closed]
I need to be able to return audio or video from a Spring Boot Api. I cannot find any documentation for this. Could you help me find resources for this topic ?
0
votes
1
answer
66
views
How to write rdf4j Model to a string while preserving the original structure?
I have a plain java application that consumes a jsonld structured file, converts it to a Model class from rdf4j framework and then writes it as a string. The demo code is as so:
public static void ...
0
votes
0
answers
75
views
How to disable the “minimize” button in AndroidX CustomTabs?
I’m using androidx.browser.customtabs with a CustomTabsIntent to open a webpage inside my Android app.
Chrome shows a minimize button (a small arrow/down icon) in the Custom Tab UI, allowing the user ...
1
vote
1
answer
61
views
Unable to change the VLCJ audio delay [closed]
I would like to implement audio delay controls, which are usually tied to the J and K keys in VLC.
Here is a sample program that starts playing a video, then 5 seconds in it adjusts the audio delay. ...
-1
votes
0
answers
67
views
Is it possible to link/run Gradle tasks in comments in IntelliJ Idea? [closed]
I am using IntelliJ Idea with Gradle. Take for example:
/**
* Make sure to run the runData configuration before starting the client
*/
could runData there be substituted for something clickable/...
2
votes
0
answers
71
views
How can I apply "organize imports" action programmatically in an Eclipse batch application?
I'm creating an Eclipse batch application that applies source cleanups (equivalent of right-click menu Source -> Clean Up) from a profile file. It's an XML file listing the rules and whether they'...
Best practices
0
votes
3
replies
82
views
Does it safe to modify the oldValue of remappingFunction in java.util.Map#merge?
I want to implement something like this:
Map<String, List<String>> m = new HashMap<>();
for (... in ...) {
String key = ...;
String val = ...;
m.merge(key, Lists....
3
votes
1
answer
114
views
Inconsistent behavior of DELETE_ON_CLOSE between platforms [duplicate]
Let's run this straightforward piece of code:
import java.io.*;
import java.nio.file.*;
import java.util.Arrays;
public class Main {
public static void main(String[] args) throws IOException {
...
0
votes
1
answer
84
views
Mockito ArgumentMatchers.any(Class) for varargs parameter does not match
I have test method using mockito 5
@Test
public void test_increaseUserScore_Successful() throws CannotCreateCachedUserException {
when(cachedUserRepository
.existsById(...
0
votes
0
answers
55
views
PackageManager.getInstallerPackageName() returning unexpected packages as installers
I’m using PackageManager.getInstallerPackageName() in my Android app to detect the installer source.
It usually returns expected installer packages like com.android.vending or com.samsung.android.app....
-8
votes
0
answers
113
views
I need to create an array that contains the values of the attributes of an object, but Object.values(obj) does not work [closed]
I need to create an arraylist, that contains an array of objects to act as the rows of a table, like this:
ArrayList<Object[]> rows = new ArrayList<>();
each of these Object[] arrays will ...
1
vote
1
answer
69
views
spring boot web polish characters encoding problem
In Spring Boot 2.6.0 java 8 application configuration class has content:
@Configuration
public class Internationalization implements WebMvcConfigurer {
// localeResolver, localeChangeInterceptor,...
0
votes
1
answer
53
views
Get a list of relationships from Neo4J repository using Spring
I started learning the development of REST API using Spring and Neo4J. I am unable to understand how Repositories work, even I looked to the documentation.
I have Airport node and LINE relationship. ...
-6
votes
0
answers
65
views
Push Notifications not working in my Vite + React + Spring Boot project (WebSockets, VAPID, AWS SNS, FCM all attempted) [closed]
I am trying to implement web push notifications in my project, but none of the approaches I tried are working. I’m not sure whether the issue is on the frontend, backend, service worker, or the push ...
0
votes
1
answer
43
views
MongoTimeoutException in Testcontainers Integration Test : Open Liberty app attempts to connect to Kubernetes FQDNs instead of local alias
Title - MongoTimeoutException in Testcontainers Integration Test : Open Liberty app attempts to connect to Kubernetes FQDNs instead of local alias
I am writing integration tests for an Open Liberty-...
0
votes
0
answers
41
views
Android AccessibiltyService : How can I enabling perform action on a sealed instance [closed]
I am using AccessibilityService in AndroidStudio for an app which is going to access an another app. In a view there is not available actions of "ACTION_CLICK". Its sealed and I am getting ...
Advice
0
votes
5
replies
96
views
Why is FileReader as efficient as BufferedReader in reading 1KB chunks of data?
I was trying to read data (chars) from a large text file (~250MB) in 1KB chunks and was very surprised that reading that file using either FileReader or BufferedReader takes exactly the same time, ...
0
votes
0
answers
36
views
What happens when uploading a large file from client browser to my Spring boot server if I delay reading the multipart file from input stream?
Context: I am trying to build a Spring Boot application and have exposed a REST api endpoint to upload files(as large as 1 GB).
Question: Since the data transfer for a multipart file happens in chunks ...
1
vote
1
answer
63
views
JNA CoCreateInstance returns S_OK but ShellLink/IShellLinkW fails, COM pointer is non-null but object unusable
I'm making a Java app that scans the Windows Recent Files folder and resolves .lnk shorcuts to their actual file paths. I'm doing so using JNA the JNA API and simulating IShellLinkW and IPersistFile.
...
0
votes
1
answer
37
views
How to set a background image for the WebView on an android app built with React DOM + Capacitor v7?
package com.app_name.app;
import com.getcapacitor.BridgeActivity;
import android.os.Bundle;
import android.graphics.Color;
// import android.webkit.WebView;
public class ...
0
votes
0
answers
49
views
Mapstruct and multiple derived classes
I am having trouble wrapping my head around subclass mappings. I have 3 classes:
@Data
public class Parent {
long id;
String name;
public boolean isEmpty() {
return StringUtils.isEmpty(name)...
1
vote
0
answers
40
views
IdempotencyBreachExceptionHandling in service used in kafka listener
I’m encountering an issue with possible idempotencyBreachException in a service used by Kafka listener.
I’m not entirely sure how to handle this situation correctly. I have a lockExecutor that locks a ...
0
votes
1
answer
181
views
Why does using >= increase merge sort time complexity
I recently solved the Merge Sorted Array question on leetcode
Here is the part of the code I am having doubts on :
while (curr >= 0 && p1 >= 0 && p2 >= 0) {
// more TC if ...
0
votes
0
answers
40
views
TdLib SearchMessages misses the latest message
Why the SearchMessages method in TdLib returns one less message than expected. I sent Q1, Q2, Q3. FoundMessages.totalCount = 3, message[Q2, Q1]. If I send a message Q4 FoundMessages.totalCount = 4, ...
0
votes
0
answers
55
views
"DefaultJpaDialect does not support custom isolation levels" when upgrading to spring batch 5
I am upgrading an app to newest Spring Boot 3, and because of that Spring Batch is upgraded to 5.2.3 (from 4.3.10).
The application did not persist batch states previously, it was using the "map ...
0
votes
0
answers
39
views
Spring Boot Dashboard in VS Code isn't displaying one of the project's modules
I'm setting up the environment for a project of the company I work for. It's a multi module backend runing Spring Boot. I didn't have problems with most of the setup, but one of the project's modules, ...