1,915,932 questions
Best practices
1
vote
2
replies
69
views
How do you write your Springboot main class?
I argue this is the best template:
Because it tells you when the yaml had an issue which stopped the app from starting up, instead of quietly exiting.
Example if you have a extra space before your ...
0
votes
1
answer
60
views
Cannot connect to MySQL with docker compose
I have a Spring Boot microservice application which uses MySQL DB for storing user credentials and some other stuff.
All services are up after I start docker compose but I cannot access database and I ...
-3
votes
0
answers
60
views
Why can a protected variable be accessed in a subclass but not from another class in Java? [duplicate]
I am learning Java inheritance and access modifiers.
I am trying to understand how the protected modifier works between parent and child classes.
I created these classes:
class Animal {
protected ...
Best practices
1
vote
5
replies
72
views
Other Methods for printing a string in a box with corners
I was looking to see how some one else would have approached this coding problem.
One of my assignments was to print a string within a box that contains 4 plus signs in the corner.
+-----+
!Hello!
+---...
Best practices
0
votes
5
replies
84
views
How to cross validate properties in Spring Boot?
My application has the following properties
employeeEngine.callLegacy=true
employeeEngine.callNewApi=true
I want to make it possible to call either only the legacy service, or the new api endpoint (...
2
votes
1
answer
67
views
Kafka Share Consumer issue
I tried to test the new Share Consumer feature, after reading the Spring Kafka doc, and created an example project, but I cannot make it work as expected.
My example is based on Spring Boot 4.1.0-RC1, ...
-3
votes
0
answers
124
views
Performance of Depth-First Search (DFS) algorithm in Java [closed]
I implemented Depth-First Search (DFS) recursively in Java.
My current implementation searches the entire node list every time I follow an edge in order to find the target node.
public void dfsSearch(...
Best practices
0
votes
4
replies
74
views
How to find the 3rd largest number from a List using StreamAPI functions
I have a list of arrays in integer and want to know third largest number from the list. But I need to use the Stream API functions.
List<Integer> list = Arrays.asList(1, 2, 3, 1, 4, 5, 28, 23, ...
-5
votes
0
answers
36
views
Redisson cluster client doesn’t recover after node outage (RedisNodeNotFoundException) until application restart [closed]
Environment
- Redisson version: 3.11.0
- Redis deployment: Redis Cluster (3 master + 3 slave)
- Client creation: Redisson.create(config) with useClusterServers()
- scanInterval explicitly set to ...
Best practices
1
vote
11
replies
90
views
Generate x509 Certificate in Java
I'm looking for a free Java code to generate an in-memory x509 security certificate v.3, not a certificate file on the disk. Should support extensions and RSA algo.
I need a low-level Java code, ...
1
vote
0
answers
44
views
AbstractMethodError on XSSFColor.getStoredRGB() when using custom fill color with Poiji 4.1.1 on classpath
Problem
I'm trying to set a custom hex color (#00458D) on Excel header cells using Apache POI in a Spring Boot project. The only approach that works without throwing an error is using an indexed color:...
1
vote
1
answer
72
views
Java DFS not finding correct path in weighted directed graph [closed]
I have a weighted directed graph implementation in Java.
My DFS sometimes doesn't find the correct path when there are multiple routes.
Here is my code:
// Graph.java
package at.htl;
import java.util....
0
votes
0
answers
39
views
Java-GI Gtk/Adw bindings - Animation error
I’m using the Java-GI bindings library and I’m getting an error when I use Adw.Animation:
private void fadeWidget(Widget widget, DoneCallback onDone) { // widget is a Gtk.Image
AnimationTarget ...
0
votes
3
answers
106
views
JaCoCo indicates missed branch on two-part RegEx matches/find which is proved to be covered between multiple unit tests
I have the following Email Validation method which checks an Email Address based on 2 conditions: (1) The main format must be valid, (2) UUID cannot appear anywhere in the string. There are 2 Regexes ...
3
votes
2
answers
157
views
Error while sending mail in Java (Spring Boot)
I am trying to send email using Spring Boot with Gmail SMTP, but I am getting the following exception:
org.springframework.mail.MailSendException: Mail server connection failed.
Failed messages: ...