Questions tagged [spring-framework-beans]

195 questions
16
votes
6 answers

bean of type 'org.springframework.http.codec.ServerCodecConfigurer' that could not be found

APPLICATION FAILED TO START Description: Parameter 0 of method modifyRequestBodyGatewayFilterFactory in org.springframework.cloud.gateway.config.GatewayAutoConfiguration required a bean of type 'org.springframework.http.codec.ServerCodecConfigurer'…
11
votes
1 answer

Registering test bean with same name in Spring Framework 5.1

I'm having following config in my production files: @Configuration internal class Config { @Bean fun clock() = Clock.systemUTC() } In tests: @Configuration class ClockTestConfiguration { @Bean fun clock() = SetableClock() } My test…
pixel
  • 24,905
  • 36
  • 149
  • 251
8
votes
5 answers

What is the replacement for deprecated BasicAuthorizationInterceptor?

I am using a new BasicAuthorizationInterceptor to do the basic authentication in oauth2.0. I can't find a replacement for the deprecated BasicAuthorizationInterceptor. Please help me with it
Shivaraja HN
  • 168
  • 1
  • 10
7
votes
1 answer

spring framework : expected single matching bean but found 2

This super class DAO: public class CrudDAO{ } This child class: @Repository public class JnsTimeDao extends CrudDAO { } @Repository public class BatchDAO extends CrudDAO { } this super service class @Transactional(readOnly = true) public…
HelloWorld
  • 147
  • 1
  • 1
  • 14
6
votes
1 answer

Do we need static fields in Spring Beans?

I have seen general practice to create Logger instance as static properties of a class annotated with any of the Spring's Annotation ( @Component, @Service ). Since, all beans created are by default singleton in nature. Do we really need static…
Gaurav
  • 3,614
  • 3
  • 30
  • 51
6
votes
0 answers

Springs BeanUtils.copyProperties() vs Apache Commons BeanUtils.copyProperties

Trying to do something simple here. Take an Entity object and copy it's identically named properties to another bean. You can do this with Apache commons org.apache.commons.beanutils.BeanUtils.copyProperties(source,target) but the issue here is…
4
votes
1 answer

Why is Lazy creation of beans leading to classes with different References/hashCodes in SpringBoot?

Why do bean of classes created using @Lazy annotation have different reference compared to the normal Autowired objects of the same class. I am aware that @Lazy provides bean instance when it is required but i thought it would always be the same…
Luv
  • 169
  • 2
  • 13
4
votes
1 answer

How to resolve java.lang.NoClassDefFoundError: com/fasterxml/classmate/TypeResolver while running spring boot app

I am trying to run one sample application integrated with keycloak (for IAM). Build is success but while running the application, I get below error ... Error starting ApplicationContext. To display the conditions report re-run your application with…
AmitK
  • 81
  • 2
  • 8
4
votes
0 answers

How can I change port for Camunda webapp (cockpit) on tomcat

I want to change "camunda-bpm-spring-boot-starter-webapp" port when I springframework application. My project is running on 8181 "application.properties server.port = 8181" and I did implement camunda-bpm-spring-boot-starter-webapp on my…
4
votes
1 answer

How to customize java spring @NotNull validation error message

@POST @Path("") @Consumes({"application/x-www-form-urlencoded"}) TokenDTO login(@ApiParam(value = "The id of the channel used", required = true ) @HeaderParam("channel") @NotEmpty(message = "email.notempty") String channel) throws…
ps138
  • 137
  • 1
  • 11
3
votes
1 answer

Intermittent occurrences of: No bean named 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry' available

Our application somehow gets into an unusable state very intermittently and in a hard to reproduce fashion. We found it follows a path that uses this code that we think is likely the cause of the issue but aren't sure why or how to fix it. We don't…
3
votes
0 answers

Is there built in support for appending Handlers to the set HandlerResolver in JaxWsPortProxyFactoryBean?

I'm creating a JaxWsPortProxyFactoryBean instance and want to set a HandlerResolver on it to log requests. @Bean(name="serviceName") public JaxWsPortProxyFactoryBean serviceNameFactory() throws MalformedURLException { JaxWsPortProxyFactoryBean…
NominSim
  • 8,447
  • 3
  • 28
  • 38
3
votes
1 answer

Exception : a bean of type 'org.springframework.http.codec.ServerCodecConfigurer' that could not be found

I am getting the below error in my program after adding the below maven dependencies. org.springframework.boot spring-boot-starter-web 2.2.2.RELEASE Error Unsatisfied dependency…
ITIB
  • 353
  • 6
  • 16
3
votes
3 answers

Reading file available in resources folder with SpringBoot

I am going to read a file available in resources folder in my Springboot application. I have used ResourceLoader to do it. But I get a FileNotFoundException when I try to execute my application. Error creating bean with name 'demoController':…
user5489038
  • 31
  • 1
  • 5
3
votes
2 answers

How to set Spring component scan in the Spring YML configuration file?

I can see that I can do component scan and restrict what packages are scanned using XML file. How can I do the same in YML file?
Phil
  • 46,436
  • 33
  • 110
  • 175
1
2 3
12 13