Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.3.6
-
Fix Version/s: 2.3-M2
-
Component/s: None
-
Labels:None
-
Patch Submitted:Yes
Description
Apparently, from the beanBuilder used in
resources.groovy, i can't access the bean definitions present in the
beanBuilder of the plugins (app and plugins don't share
the same RuntimeSpringConfiguration). So i cannot redefine the beanClass of a
specific beanDefinition.
====
The below source code snippets produce different results proving they aren't sharing the same RuntimeSpringConfiguration.
Inside a plugin:
++++++++++++++++++++++++
+++ TestGrailsPlugin.groovy +++
++++++++++++++++++++++++
def doWithSpring = {
println "== doWithSpring =="
delegate.getBeanDefinitions().each
}
Inside an application:
++++++++++++++++++++++++
+++ resources.groovy +++
++++++++++++++++++++++++
beans = {
println "== beans =="
delegate.getBeanDefinitions().each
}
====
Analyzing the source code, the problematic call stack is:
Hibernate plugin is calling GrailsRuntimeConfigurator.loadExternalSpringConfig which initializes springGroovyResourcesBeanBuilder with a different RuntimeSpringConfiguration.
So, when GrailsRuntimeConfigurator.doPostResourceConfiguration is called, springGroovyResourcesBeanBuilder is non-null
Should Hibernate plugin call GrailsRuntimeConfigurator.reset?
====
Read this in the context:
===
Thanks.
Patch files generated using "diff -u base_file modified_file".
Grails 1.3.6 was used as base.