codeconsole opened a new pull request, #13863:
URL: https://github.com/apache/grails-core/pull/13863

   This produces unknown/unexpected behavior and should not be done.  
@EnableWebMvc is a Spring Framework configuration annotation not to be used 
with Spring Boot.  It produces undesired behavior by automatically creating 
beans that are not wanted. WebMvcAutoConfiguration performs all the behavior of 
this configuration because it extends it and adds conditional logic. 
   
   Fixes 
   ```
   Overriding bean definition for bean 'localeResolver' with a different 
definition: replacing [Root bean: class=null; scope=; abstract=false; 
lazyInit=null; autowireMode=3; dependencyCheck=0; autowireCandidate=true; 
primary=false; fallback=false; 
factoryBeanName=org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration;
 factoryMethodName=localeResolver; initMethodNames=null; 
destroyMethodNames=[(inferred)]; defined in 
org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration]
 with [Generic bean: 
class=org.springframework.web.servlet.i18n.SessionLocaleResolver; 
scope=singleton; abstract=false; lazyInit=false; autowireMode=0; 
dependencyCheck=0; autowireCandidate=true; primary=false; fallback=false; 
factoryBeanName=null; factoryMethodName=null; initMethodNames=null; 
destroyMethodNames=null]
   Overriding bean definition for bean 
'org.springframework.aop.config.internalAutoProxyCreator' with a different 
definition: replacing [Root bean: 
class=org.springframework.aop.framework.autoproxy.InfrastructureAdvisorAutoProxyCreator;
 scope=; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; 
autowireCandidate=true; primary=false; fallback=false; factoryBeanName=null; 
factoryMethodName=null; initMethodNames=null; destroyMethodNames=null] with 
[Generic bean: 
class=org.grails.spring.aop.autoproxy.GroovyAwareInfrastructureAdvisorAutoProxyCreator;
 scope=singleton; abstract=false; lazyInit=false; autowireMode=0; 
dependencyCheck=0; autowireCandidate=true; primary=false; fallback=false; 
factoryBeanName=null; factoryMethodName=null; initMethodNames=null; 
destroyMethodNames=null]
   ```
   
   ```java
   class WebMvcAutoConfiguration {
       static class EnableWebMvcConfiguration extends 
DelegatingWebMvcConfiguration { 
       } 
   }
   
   class DelegatingWebMvcConfiguration extends WebMvcConfigurationSupport {
   }
   
   class WebMvcConfigurationSupport extends WebMvcConfigurationSupport {
       @Bean public LocaleResolver localeResolver() { }
   }
   
   ```
   
   vs
   
   ```java
   @Import(DelegatingWebMvcConfiguration.class)
   public @interface EnableWebMvc { }
   ```
   
   
   # This pull request is not finished


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to