You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gateway definition in xml works correctly like in spring boot 2 and spring integration 5.
Actual Behaviour
App throws this error during startup:
The provided 'BeanDefinitionRegistry' must be an instance of 'ConfigurableBeanFactory' or 'ConfigurableApplicationContext', but given is: class org.springframework.beans.factory.support.SimpleBeanDefinitionRegistry
Steps To Reproduce
grails create-app
create TestInterface with void send(Message message)
add resources.xml with int:gateway definition in it, referring to testInterface
./gradlew bootRun
Commenting out the gateway definition in resources.xml causes the app to startup fine.
A workaround for this seems to be removing the gateway xml definition and defining the gateway interface like this instead:
It looks like this commit db4f120d in spring-integration is what causes this new error, it has this comment:
Functional gateway bean definitions
* Rework `MessagingGatewayRegistrar` to parse messaging gateway annotation
an `<gateway>` XML using a supplier variant for bean definition.
Such a feature is required by Spring Native - otherwise we would need to
register reflection info for to many internal Spring Integration classes
* Such a change should benefit from regular JDK perspective, too -
we don't do reflection for this kind of bean registrations
I assume that we can take the same approach as when we initialize the spring config and use the unrefreshedApplicationContext to load these beans. @codeconsole you're more familiar on the spring side. Do you have a suggestion on how to fix this?
As for a workaround, you should be able to remove the xml configuration & adopt the annotation based spring configuration @Configuration to work around this issue since it's specific to the registry we're using to load beans using the beanBuilder dsl.
Ya I mentioned the workaround above, which is ok for this specific issue, but reworking all our thousands of lines of xml config into annotation based would be a pretty large effort that we might not be able to dedicate time to
Expected Behavior
Gateway definition in xml works correctly like in spring boot 2 and spring integration 5.
Actual Behaviour
App throws this error during startup:
Steps To Reproduce
void send(Message message)
int:gateway
definition in it, referring to testInterfaceCommenting out the gateway definition in resources.xml causes the app to startup fine.
A workaround for this seems to be removing the gateway xml definition and defining the gateway interface like this instead:
This isn't the best workaround for projects that have thousands of lines of spring integration xml definition.
Environment Information
Example Application
https://github.com/ice1080/grails-spring-integration-xml
Version
6.2.3
The text was updated successfully, but these errors were encountered: