grails / grails-core

The Grails Web Application Framework
http://grails.org
Apache License 2.0
2.79k stars 950 forks source link

Move GrailsFilters configuration from grails-spring to grails-web-common module so that grails-spring to is not required for grails-boot. #13855

Closed codeconsole closed 6 days ago

codeconsole commented 1 week ago

Fixes #13854 (See for discussion)

matrei commented 6 days ago

I'm trying to unravel this, help me out.

  1. GrailsFilters was created in grails-plugin-controllers to house Servlet Filter order values. (ea6b1930a46eac6fde1440a2d9580f0c92bbe56c)
  2. GrailsFilters was moved to grails-spring with motivation "Move GrailsFilters configuration to grails-spring module so that grails-plugin-controllers is not required.". (6f9d173e0af20a852971aad78a42cc42bba7fd80)
  3. This PR moves GrailsFilters to grails-web-common. But the commit message says: "Move GrailsFilters configuration to grails-spring module so that grails-spring is not required for grails-boot."

I believe it is the commit message of step 3 that trips me up.

codeconsole commented 6 days ago

@matrei it was a typo. if you look at the commit it is from -> to

matrei commented 6 days ago

This seems to blow up in grails-functional-tests:

         java.lang.NoClassDefFoundError: org/grails/spring/config/http/GrailsFilters
                at org.sitemesh.grails.plugins.sitemesh3.Sitemesh3GrailsPlugin.getDefaultPropertySource(Sitemesh3GrailsPlugin.groovy:35)
                at org.sitemesh.grails.plugins.sitemesh3.Sitemesh3GrailsPlugin.doWithSpring_closure2(Sitemesh3GrailsPlugin.groovy:63)
                at groovy.lang.Closure.call(Closure.java:433)
                at groovy.lang.Closure.call(Closure.java:412)
                at grails.spring.BeanBuilder.invokeBeanDefiningClosure(BeanBuilder.java:759)
                at grails.spring.BeanBuilder.beans(BeanBuilder.java:588)
                at grails.spring.BeanBuilder.invokeMethod(BeanBuilder.java:531)
                at org.grails.plugins.DefaultGrailsPlugin.doWithRuntimeConfiguration(DefaultGrailsPlugin.java:545)
                at org.grails.plugins.AbstractGrailsPluginManager.doRuntimeConfiguration(AbstractGrailsPluginManager.java:152)
                at grails.boot.config.GrailsApplicationPostProcessor.postProcessBeanDefinitionRegistry(GrailsApplicationPostProcessor.groovy:155)
                at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:349)
                at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:148)
                at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:791)
                at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:609)
                at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146)
                at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:752)
                at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:439)
                at org.springframework.boot.SpringApplication.run(SpringApplication.java:318)
                ... 25 more
matrei commented 6 days ago

As GrailsFilters is such a new class, I guess it has not been used in many places outside grails-core yet. But, I guess, grails-plugin-sitemesh3 is one such place :smile: .

Try and update that right after merging this so we are back to working tests.

codeconsole commented 6 days ago

yes, the plugin is a required update.