All Questions
Tagged with annotations spring
2,189 questions
0
votes
0
answers
38
views
What is an annotation in Spring Boot [duplicate]
I have been trying to find a simple definition of an annotation is Spring Boot, specifically:
a) What it does
b) When / how you would use it
While I am using annotations in my code such as @Repository ...
1
vote
0
answers
29
views
Spring doesnt subscribe to Mono in Scheduled automatically when used cron
When i use cron like this:
@Scheduled(cron = "0 0/5 16-19 * * *")
spring does not subscirbe to Mono returned from method autimatically, and i need to do that manually.
When i use @Scheduled ...
-3
votes
2
answers
74
views
Java Spring expected at least 1 bean which qualifies as autowire candidate. Dependency annotations
Spring boot application throws No Qualifying bean of type available: expected at least 1 bean which qualifies as autowire candidate. error at runtime.
Please find my code below.
SpringBoot version : 2....
0
votes
1
answer
46
views
Changing value passed into custom @Qualifier
Is there a way to change the value passed to a custom @Qualifier, and pass it to the delegating @Qualifier?
I understand that we can create custom qualifiers by
@Qualifier
@Target({ ElementType.FIELD, ...
0
votes
0
answers
31
views
PDAnnotationLink with image
Code snippet to add PDAnnotationLink
final PDAnnotationLink txtLink = new PDAnnotationLink();
PDBorderStyleDictionary pdBorderStyle = new PDBorderStyleDictionary();
pdBorderStyle.setStyle(...
0
votes
0
answers
99
views
Why does my java annotation is not detected?
I try to make my own annotation in Java for my exercise which know if a string is a number in parameter but i don't understand why it don't run.
that is my interface
@Constraint(validatedBy = ...
0
votes
1
answer
31
views
spring annotation to get rid of configuration name prefix without changing variable names
I have configuration with
a-configuration-group
prop1: some-hyphen-val1
prop2: some-hyphen-val2
.
.
propn: some-hyphen-valn
There are various classes using the configuration so:
SomeClass {
...
0
votes
0
answers
28
views
How can I override the first part of @Min err message in Spring (Hibernate Validator - Bean Validation)?
I have an annotation as to not register the negative numbers
@Min(value = 0, message = "{msg.cannot.be.negatif}")
private Integer joursPerturbationDto;
<input type="number" ...
-1
votes
1
answer
37
views
Spring Ambiguity
I am confused as to why we would use the @Qualifier and @Primary annotations. If we have to specify which implementation we want to use, and that then becomes the bean which we instantiate, why have ...
0
votes
1
answer
52
views
Wildcard in @Pointcut annotation in Spring
is it possible to define a Method Pointcut Expression with Annotation wildcards?
For example "Match for all annotations starting with 'Has'"
tried:
@Pointcut("execution(@Has.* * *(*))&...
-1
votes
1
answer
46
views
Spring 4 calculated placeholders for annotations
I have an annotation, with a String attribute, and I want it to be calculated at runtime.
In the specific case I am talking about
@Scheduled(initialDelayString = "10000" )
According to ...
0
votes
2
answers
54
views
How to get method annotation field values
My Controller Class is this:
@RestController
@RequestMapping("/api/admin")
@SecurityRequirement(name = "E-Commerce Application")
public class AddressController {
@...
0
votes
1
answer
112
views
Application.properties boolean defined value not used in bean
I have a bean class that I want to load a boolean value that is defined in the application.properties file of a springboot app. This is my application.properties file:
APP_CONTAINERIZED_VALUE=true
My ...
-1
votes
1
answer
30
views
How to inject specific arguments into constructor in spring?
@Component
public class A {
String one;
int two;
public A a = new ("bro",1);
public A b = new ("come",2);
public A(String one, int two) {
this.one = ...
1
vote
2
answers
550
views
@Qualifier annotation is not working in Spring for me, everything looks fine
I am using @Qualifier along with @Autowired but it giving me this exception:
Exception:
No qualifying bean of type 'com.springcore.autowiring.annotation.B'
available: expected single matching ...