Spring 4.1 and Integration 4.0.4 results in Caused by: java.lang.NoClassDefFoundError: com/rometools/rome/io/FeedException using HttpRequestHandlingEndpointSupport [INT-3517]
#7482
Using Spring Integration 4.0.4 in combination with Spring Framework 4.1.x results in the following exception:
Caused by: java.lang.NoClassDefFoundError: com/rometools/rome/io/FeedException
at org.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupport.<init>(HttpRequestHandlingEndpointSupport.java:185) ~[spring-integration-http-4.0.4.RELEASE.jar:?]
at org.springframework.integration.http.inbound.HttpRequestHandlingMessagingGateway.<init>(HttpRequestHandlingMessagingGateway.java:72) ~[spring-integration-http-4.0.4.RELEASE.jar:?]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_20]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_20]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_20]
at java.lang.reflect.Constructor.newInstance(Constructor.java:408) ~[?:1.8.0_20]
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147) ~[spring-beans-4.1.0.RELEASE.jar:4.1.0.RELEASE]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:125) ~[spring-beans-4.1.0.RELEASE.jar:4.1.0.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:270) ~[spring-beans-4.1.0.RELEASE.jar:4.1.0.RELEASE]
... 27 more
This seems to be caused by the conditional on L184:
if ((spring41Present && romeToolsPresent) || romePresent) {
Should be:
if ((spring41Present && romeToolsPresent) || (!spring41Present && romePresent)) {
as romePresent is true causing the attempt to create an instance of AtomFeedHttpMessageConverter, but this actually requires romeToolsPresent to be true (which it isn't in my case) where spring41Present is true as the implementation in Spring 4.1 uses.
OK. Thank you for pointing that out.
We definitely must fix it as you suggest, but I'm really not sure that it is so critical.
If you aren't just interested in AtomFeedHttpMessageConverter you can remove rome-fetcher jar from your classpath.
From other side, if you need it and you use Spring 4.1 the message from that exception exactly says what is wrong.
Something similar we get when want to use <object-to-json-transformer>, but don't have Jackson in the classpath.
Andrew Tulloch opened INT-3517* and commented
Using Spring Integration 4.0.4 in combination with Spring Framework 4.1.x results in the following exception:
This seems to be caused by the conditional on L184:
Should be:
as
romePresent
is true causing the attempt to create an instance ofAtomFeedHttpMessageConverter
, but this actually requiresromeToolsPresent
to be true (which it isn't in my case) where spring41Present is true as the implementation in Spring 4.1 uses.Affects: 4.0.4
Referenced from: pull request #1275
The text was updated successfully, but these errors were encountered: