Questions tagged [java]
Java is a high-level object-oriented programming language. Use this tag when you're having problems using or understanding the language itself. This tag is frequently used alongside other tags for libraries and/or frameworks used by Java developers.
1,920,579
questions
-1
votes
0
answers
25
views
Are RMap `getMap`, `putAll`, `put`, `remove` operations atomic & threadsafe?
We are using Redisson library for Redis and we are utilizing Hash data structure to store an object with different properties.
We have 2 Kafka listeners, which listen for incoming messages, and store ...
0
votes
0
answers
27
views
How to catch the PSQLException exception? [closed]
How to catch the **PSQLException ** exception? I am using Spring boot JDBCTemplate and it can throw a PSQLException exception. Using try-catch, I get this message from IDEA: "Exception 'org....
-2
votes
0
answers
12
views
How to get Last element in the redis elasticache if the highest score is not known? Also, how to get limited number of elements in a particular range?
I am trying to get the element with highest score in redis elasticache.
some documentation states that, this can be done by using 2 methods-
jedis.zrangeByScoreWithScores(key, min, max);
jedis....
-1
votes
1
answer
43
views
Best Practices for Validation in a Spring Boot Application [closed]
In my Spring Boot application, I have encountered a scenario where multiple services interact with each other, and objects passed between them need to be validated. Currently, I am using @Valid in the ...
0
votes
0
answers
24
views
excelWB.write(fileOut); gives IllegalArgumentException
I am trying to use an excel to write the into new file using Apache POI. This is the method code,
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import ...
-1
votes
0
answers
12
views
Apache Camel OnException JUnit5 Test
I have this Camel Route and would like to test it.
from("jms:queue:importer.messageImport")
.routeId("Import")
.onException(Exception.class)
.maximumRedeliveries(0)
...
0
votes
0
answers
13
views
Bean Could not be found despite proper project file structure
File Structure screenshot
I've seen other posts solving this issue with this exact file structure yet no matter what I do it always gives me this error:
***************************
APPLICATION FAILED ...
-2
votes
0
answers
25
views
Issues with Region in S3AsyncClient using Minio with AWS SDK for Java
I encountered an issue while configuring S3AsyncClient using the AWS SDK for Java in a Spring Boot application. Despite setting all the necessary properties, I keep receiving the following error ...
1
vote
1
answer
45
views
Java libraries built from source have differences to those published wrt to anonymous classes
I am trying to build groovy (and others) from source using the instructions in their help file.
https://github.com/apache/groovy/tree/GROOVY_3_0_21?tab=readme-ov-file
The built binaries operate just ...
0
votes
1
answer
26
views
Is JBoss 8 compatible with java 8? [duplicate]
I am trying to migrate an ear application from JBoss 7.1 eap to jboss 8, is it compatible with java 8?
I get the following error
Error: A JNI error has occurred, please check your installation and try ...
0
votes
0
answers
11
views
javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not extract ResultSet
Here the error:
javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not extract ResultSet
at org.hibernate.internal.ExceptionConverterImpl.convert(...
0
votes
0
answers
11
views
I have implemented the code to raise local reminder notification everyday at specific time. On Android 14 phone not able to receive this notification
Below is my code snippet.
AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
android.icu.util.Calendar calendar = android.icu.util.Calendar.getInstance(...
0
votes
0
answers
27
views
Java Stream API memory consumption of multiple .filter() in chain [duplicate]
Have a question regarding .filter (or any other non-terminal) methods in Stream API chain (code in the block below is just for example):
var s1 = Stream.of(1,2,3,4,5,6,7,8,9);
var intemidiate1 = s1....
-1
votes
1
answer
25
views
Mocking a vendor class that is not initialized by my code in Mockito [closed]
I have a very unique challenge with respect to unit testing a scenario.
There is a vendor application provided by a jar file. I have to write code on top of it. Internal to vendor application the ...
1
vote
0
answers
28
views
how to specify the author of commit created by revert() in JGit?
Suppose there is a file that is added and committed to a Git repository with the change reverted:
try (Git gitParent = Git.init().setDirectory(parentRepositoryRoot).call()) {
final String fooName =...