Skip to content

Commit ce42e56

Browse files
artembilangaryrussell
authored andcommitted
INT-4551: Fail if old Java DSL jar is present
JIRA: https://jira.spring.io/browse/INT-4551 **Cherry-pick to 5.0.x**
1 parent 6d523e2 commit ce42e56

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

spring-integration-core/src/main/java/org/springframework/integration/config/IntegrationRegistrar.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import org.springframework.beans.factory.support.ManagedList;
3939
import org.springframework.beans.factory.support.ManagedSet;
4040
import org.springframework.beans.factory.support.RootBeanDefinition;
41+
import org.springframework.context.ApplicationContextException;
4142
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
4243
import org.springframework.core.io.Resource;
4344
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
@@ -85,6 +86,17 @@ public void setBeanClassLoader(ClassLoader classLoader) {
8586
this.classLoader = classLoader;
8687
}
8788

89+
static {
90+
if (ClassUtils.isPresent("org.springframework.integration.dsl.support.Function",
91+
IntegrationRegistrar.class.getClassLoader())) {
92+
93+
throw new ApplicationContextException("Starting with Spring Integration 5.0, "
94+
+ "the 'spring-integration-java-dsl' dependency is no longer needed; "
95+
+ "the Java DSL has been merged into the core project. "
96+
+ "Having it present it on the classpath causes class loading conflicts.");
97+
}
98+
}
99+
88100
/**
89101
* Invoked by the framework when an @EnableIntegration annotation is encountered.
90102
* Also called with {@code null} {@code importingClassMetadata} from {@code AbstractIntegrationNamespaceHandler}

0 commit comments

Comments
 (0)