All Questions

Tagged with
0 votes
0 answers
2 views

How to integrated micrometer @Timed with prometheus in springboot application

Have written a springboot application, and wanted to measure the time taken to execute a method using @Timed annotation from micrometer, and display this value in prometheus. Have tried below ...
  • 111
0 votes
0 answers
4 views

Springboot Override Global Allowed Origins configuration from a Controller/Method

I have an application with cors filter which only allows certain origins. @Configuration public class WebConfiguration { @Value("${allowed.origins}") private String[] allowedOrigins;...
1 vote
1 answer
11 views

Retry the call if server is down in JAVA

I am trying to implement the retry logic or mechanism on micro-services to micro-services call. Basically, have to attempt retry 2 times if server is down only. I tried to use @Retry and @Recover to ...
0 votes
0 answers
4 views

Trouble with Springboot custom id generator with year and month prefix

I'm using Spring Boot 2.7.3 with Java 17 and MySQL. I've only been using Java for around 3 months so my debugging skills are very limited. I wanted to make a custom sequence id generator and found ...
0 votes
0 answers
7 views

Error while generating swagger json from Spring boot

I have been trying to generate the swagger json from spring boot. But while trying with below code I am getting I/O error. Here is my code. package com.tf.redis; import org.junit.jupiter.api....
0 votes
1 answer
8 views

Get distinct names of objects from a lists defined inside the mongodb documents

I work with Spring Boot and MongoDB. I am looking for a solution to get a list of distinct hobbies names. Additionally all of the hobbies have to have requested group. The problem is that hobbies are ...
  • 35
-2 votes
1 answer
12 views

Need to download image from url and find its length width and file size using java [closed]

I need a Java program to download an image from a URL and print its file size, width, and height.
  • 5
1 vote
1 answer
13 views

class software.amazon.awssdk.services.s3.model.CommonPrefix cannot be cast to class java.lang.String

I have fetched all the common prefix from S3 and now i want to store these common prefix in fixed size array of String, so i tried to loop over the List and tried to cat the element into Stirng but ...
  • 68
0 votes
1 answer
9 views

Actions while logging in java with log4j and slf4j

I am using log4j wrapped with slf4j in my springboot application. Every time I call log.warn() or log.error(), I want to call a function (to increment a count). What's the simplest and cleanest way to ...
  • 102
0 votes
2 answers
12 views

NoClassDefFound is thrown on attempt to create JedisConnectionFactory

I have generated a brand new springboot project using SpringInitializr in my IntellijIDEA (v.2022.2.1). As a result I got pom.xml like this: <?xml version="1.0" encoding="UTF-8"?...
0 votes
0 answers
7 views

Camunda -> An exception occurred in the persistence layer

Here Im using camunda platform 7.16 with java 8 - 1.8 When I'm running my project, I get an error as -> org.camunda.bpm.engine.ProcessEngineException: An exception occurred in the persistence layer....
0 votes
0 answers
37 views

@Value can't get yml value [closed]

When I want to get the value of the yml configuration file, I use @Value("${filepath}") private String path; and my yml is: filepath: xxx but my path is null and I don't know why @...
  • 1
0 votes
1 answer
16 views

How to switch/change bean implementation at runtime spring boot?

I have a parent bean and a child bean in the spring configuration class like attached. How can I inject the child bean dynamically into parent bean based on some condition (like feature toggle). @...
  • 457
0 votes
1 answer
43 views

Duplicate Json in Spring Boot Response

I have a RestController class with a method that returns duplicate json. Weird thing is when I pass a string to the response object. The Json is okay. However when I pass any other object, be it a ...
2 votes
0 answers
20 views

Already existing SecurityFilterChain is preventing my configuration on Spring Security?

I'm making a configuration on the newest Spring Security version. Based on Beans rather than the deprecated WebSecurityConfigurerAdapter. I follow the Spring recomendation on configure a Beanfor ...

15 30 50 per page
1
2 3 4 5
4416